Branch: refs/heads/master Author: Thomas Martitz kugel@rockbox.org Committer: Thomas Martitz kugel@rockbox.org Date: Sat, 29 May 2021 12:17:42 UTC Commit: b524a58e12e85c94a32f64fb72615978b2628af1 https://github.com/geany/geany/commit/b524a58e12e85c94a32f64fb72615978b2628a...
Log Message: ----------- Merge branch 'gh-codebrainz/remove-gtk2' into master
This merge removes GTK2 support entirely only GTK3 is left.
Closes #2602
Modified Paths: -------------- .travis.yml HACKING README configure.ac data/Makefile.am data/geany.gtkrc doc/geany.txt doc/plugins.dox m4/geany-mac-integration.m4 plugins/classbuilder.c plugins/demoplugin.c plugins/export.c plugins/filebrowser.c plugins/saveactions.c plugins/splitwindow.c scripts/cross-build-mingw.sh scripts/gtk-bundle-from-msys2.sh src/about.c src/build.c src/callbacks.c src/dialogs.c src/document.c src/documentprivate.h src/editor.c src/filetypesprivate.h src/gb.c src/geanywraplabel.c src/gtkcompat.h src/keybindings.c src/keybindings.h src/libmain.c src/log.c src/msgwindow.c src/navqueue.c src/notebook.c src/plugindata.h src/pluginprivate.h src/plugins.c src/pluginutils.c src/prefs.c src/printing.c src/project.c src/search.c src/sidebar.c src/socket.c src/stash.c src/symbols.c src/templates.c src/toolbar.c src/tools.c src/ui_utils.c src/vte.c
Modified: .travis.yml 16 lines changed, 6 insertions(+), 10 deletions(-) =================================================================== @@ -5,17 +5,14 @@ dist: bionic compiler: - gcc env: - - GTK2=no BINRELOC=no - - GTK2=yes BINRELOC=no - - GTK2=no BINRELOC=yes - - GTK2=yes BINRELOC=yes - - GTK2=no MINGW=yes - - GTK2=yes MINGW=yes + - GTK3=yes BINRELOC=no + - GTK3=yes BINRELOC=yes + - GTK3=yes MINGW=yes before_install: - sudo apt-get update -qq install: - sudo apt-get install -y intltool libtool - - test -n "$MINGW" || sudo apt-get install -y libgtk2.0-dev libgtk-3-dev + - test -n "$MINGW" || sudo apt-get install -y libgtk-3-dev - test -z "$MINGW" || sudo apt-get install -y mingw-w64-tools g++-mingw-w64-i686 gcc-mingw-w64-i686 binutils-mingw-w64-i686 # fix broken pkg-config-crosswrapper, see https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/1327242 - test -z "$MINGW" || sudo sed -e 's/PKG_CONFIG_PATH=/&$PKG_CONFIG_PATH:/' -i /usr/bin/i686-w64-mingw32-pkg-config @@ -29,11 +26,10 @@ script: - NOCONFIGURE=1 ./autogen.sh - > if [ -n "$MINGW" ]; then - arg=-3; [ "$GTK2" = yes ] && arg=-2; unset CC CXX; - sh ./scripts/cross-build-mingw.sh $arg; + sh ./scripts/cross-build-mingw.sh; else - CONFIGURE_FLAGS="--enable-gtk2=$GTK2 --enable-binreloc=$BINRELOC"; + CONFIGURE_FLAGS="--enable-binreloc=$BINRELOC"; mkdir _build && cd _build && { ../configure $CONFIGURE_FLAGS || { cat config.log; exit 1; } ; } &&
Modified: HACKING 15 lines changed, 6 insertions(+), 9 deletions(-) =================================================================== @@ -167,11 +167,11 @@ unmanageable diffs.
GTK versions & API documentation -------------------------------- -Geany requires GTK >= 2.24 or GTK 3 (with the --enable-gtk3 configure option) -and GLib >= 2.32. API symbols from newer GTK/GLib versions should be -avoided or made optional to keep the source code building on older systems. +Geany requires GTK >= 3.0 and GLib >= 2.32. API symbols from newer GTK/GLib +versions should be avoided or made optional to keep the source code building +on older systems.
-It is recommended to use the 2.24 API documentation of the GTK +It is recommended to use the 3.0 API documentation of the GTK libs (including GLib, GDK and Pango) has the advantages that you don't get confused by any newer API additions and you don't have to take care about whether you can use them or not. @@ -196,8 +196,8 @@ Coding them down into smaller static functions where possible. This makes code much easier to read and maintain. * Use GLib types and functions - gint not int, g_free() not free(). -* Your code should build against GLib 2.32 and GTK 2.24. At least for the - moment, we want to keep the minimum requirement for GTK at 2.24 (of +* Your code should build against GLib 2.32 and GTK 3.0. At least for the + moment, we want to keep the minimum requirement for GTK at 3.0 (of course, you can use the GTK_CHECK_VERSION macro to protect code using later versions). * Variables should be declared (and initialized) as close as practical @@ -781,9 +781,6 @@ Building Plugins The geany-plugins autotools script automatically detects the installed system Geany and builds the plugins against that.
-Plugins will build with either GTK2 or GTK3, whichever the detected -Geany was built with. - To use plugins with a development version of Geany built with a different prefix, the plugins will need to be compiled against that version if the ABI has changed.
Modified: README 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -49,10 +49,10 @@ Installation from sources
Requirements ++++++++++++ -For compiling Geany yourself, you will need the GTK2 (>= 2.24) or -GTK3 libraries and header files. You will also need its dependency libraries -and header files, such as Pango, Glib and ATK. All these files are -available at https://www.gtk.org. +For compiling Geany yourself, you will need the GTK3 libraries and +header files. You will also need its dependency libraries and header +files, such as Pango, Glib and ATK. All these files are available at +https://www.gtk.org.
Furthermore you need, of course, a C compiler and the Make tool; a C++ compiler is also needed for the required Scintilla library included. The
Modified: configure.ac 29 lines changed, 4 insertions(+), 25 deletions(-) =================================================================== @@ -82,38 +82,17 @@ AC_CHECK_DECLS([_NSGetEnviron],,,[[#include <crt_externs.h>]]) GEANY_CHECK_REVISION([dnl force debug mode for a VCS working copy CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
-# GTK version check -AC_ARG_ENABLE([gtk2], - [AS_HELP_STRING([--enable-gtk2], - [compile against deprecated GTK2 [default=no]])], - [enable_gtk2=$enableval], - [enable_gtk2=no]) - -gtk2_package=gtk+-2.0 -gtk2_min_version=2.24 -gtk3_package=gtk+-3.0 -gtk3_min_version=3.0 - -AS_IF([test "x$enable_gtk2" = "xyes"], - [gtk_package=$gtk2_package - gtk_min_version=$gtk2_min_version], - [gtk_package=$gtk3_package - gtk_min_version=$gtk3_min_version]) - -AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "x$gtk3_package"]) - # GTK/GLib/GIO checks -gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.32" +gtk_modules="gtk+-3.0 >= 3.0 glib-2.0 >= 2.32" gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0" PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private]) AC_SUBST([DEPENDENCIES], [$gtk_modules]) AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"]) -dnl Disable all GTK deprecations on 3.x so long as we want to keep 2.x support and only require 3.0. -dnl No need on 2.x as we target the latest version. -AM_COND_IF([GTK3], [AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])]) +dnl Disable all GTK deprecations +AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"]) AC_SUBST([GTK_CFLAGS]) AC_SUBST([GTK_LIBS]) -GTK_VERSION=`$PKG_CONFIG --modversion $gtk_package` +GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0` AC_SUBST([GTK_VERSION]) GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}]) # GTHREAD checks
Modified: data/Makefile.am 13 lines changed, 3 insertions(+), 10 deletions(-) =================================================================== @@ -121,17 +121,10 @@ nobase_dist_pkgdata_DATA = \ filetype_extensions.conf \ snippets.conf \ ui_toolbar.xml \ - geany.glade - -nobase_pkgdata_DATA = \ - $(filetypes_nodist) - -if GTK3 -nobase_dist_pkgdata_DATA += \ + geany.glade \ geany-3.0.css \ geany-3.20.css \ geany.css -else -nobase_dist_pkgdata_DATA += geany.gtkrc -endif
+nobase_pkgdata_DATA = \ + $(filetypes_nodist)
Modified: data/geany.gtkrc 72 lines changed, 0 insertions(+), 72 deletions(-) =================================================================== @@ -1,72 +0,0 @@ -# custom GTK2 style for Geany - -# make close button on the editor's tabs smaller -style "geany-close-tab-button-style" { - GtkWidget::focus-padding = 0 - GtkWidget::focus-line-width = 0 - xthickness = 0 - ythickness = 0 -} -widget "*.geany-close-tab-button" style "geany-close-tab-button-style" - -# use monospaced font in search entries for easier reading of regexp (#1907117) -style "geany-monospace" { - font_name = "Monospace" -} -widget "GeanyDialogSearch.*.GtkEntry" style "geany-monospace" -widget "GeanyDialogSearch.*.geany-search-entry-no-match" style "geany-monospace" - -# set red background for GtkEntries showing unmatched searches -style "geany-search-entry-no-match-style" { - base[NORMAL] = "#ffff66666666" - text[NORMAL] = "#ffffffffffff" - base[SELECTED] = "#777711111111" - text[SELECTED] = "#ffffffffffff" - # try and remove the entry background image on pixmap engine so that our - # background color is visible, and we don't end up with white text on white - # background (workaround for Adwaita 3.20). - engine "pixmap" { - image { - function = FLAT_BOX - detail = "entry_bg" - } - } -} -widget "*.geany-search-entry-no-match" style "geany-search-entry-no-match-style" - -# document status colors -style "geany-document-status-changed-style" { - fg[NORMAL] = "#ffff00000000" - fg[ACTIVE] = "#ffff00000000" -} -style "geany-document-status-disk-changed-style" { - fg[NORMAL] = "#ffff7fff0000" - fg[ACTIVE] = "#ffff7fff0000" -} -style "geany-document-status-readonly-style" { - fg[NORMAL] = "#00007fff0000" - fg[ACTIVE] = "#00007fff0000" -} -widget "*.geany-document-status-changed" style "geany-document-status-changed-style" -widget "*.geany-document-status-disk-changed" style "geany-document-status-disk-changed-style" -widget "*.geany-document-status-readonly" style "geany-document-status-readonly-style" - -# compiler message colors -style "geany-compiler-error-style" { - fg[NORMAL] = "#ffff00000000" - fg[ACTIVE] = "#ffff00000000" -} -style "geany-compiler-context-style" { - fg[NORMAL] = "#7f7f00000000" - fg[ACTIVE] = "#7f7f00000000" -} -style "geany-compiler-message-style" { - fg[NORMAL] = "#00000000D000" - fg[ACTIVE] = "#00000000D000" -} -widget "*.geany-compiler-error" style "geany-compiler-error-style" -widget "*.geany-compiler-context" style "geany-compiler-context-style" -widget "*.geany-compiler-message" style "geany-compiler-message-style" - -# red "Terminal" label when terminal dirty -widget "*.geany-terminal-dirty" style "geany-document-status-changed-style"
Modified: doc/geany.txt 83 lines changed, 20 insertions(+), 63 deletions(-) =================================================================== @@ -452,50 +452,8 @@ by specifying the command line option ``--with-vte-module-path`` to ./configure.
-Defining own widget styles using .gtkrc-2.0 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -You can define your widget style for many of Geany's GUI parts. To -do this, just edit your ``.gtkrc-2.0`` (usually found in your home -directory on UNIX-like systems and in the etc subdirectory of your -Geany installation on Windows). - -To have a defined style used by Geany you must assign it to -at least one of Geany's widgets. For example use the following line:: - - widget "Geany*" style "geanyStyle" - -This would assign your style "geany_style" to all Geany -widgets. You can also assign styles only to specific widgets. At the -moment you can use the following widgets: - -* GeanyMainWindow -* GeanyEditMenu -* GeanyToolbarMenu -* GeanyDialog -* GeanyDialogPrefs -* GeanyDialogProject -* GeanyDialogSearch -* GeanyMenubar -* GeanyToolbar - -An example of a simple ``.gtkrc-2.0``:: - - style "geanyStyle" - { - font_name="Sans 12" - } - widget "GeanyMainWindow" style "geanyStyle" - - style "geanyStyle" - { - font_name="Sans 10" - } - widget "GeanyPrefsDialog" style "geanyStyle" - - -Customizing Geany's appearance using GTK+ 3 CSS -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Customizing Geany's appearance using GTK+ CSS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To override GTK+ CSS styles, you can use traditional mechanisms or you can create a file named ``geany.css`` in the user configuration directory @@ -1240,25 +1198,18 @@ Remove Markers command from the Document menu. Change font in search dialog text fields ````````````````````````````````````````
-All search related dialogs use a Monospace for the text input fields to +All search related dialogs use a Monospace font for the text input fields to increase the readability of input text. This is useful when you are typing input such as regular expressions with spaces, periods and commas which -might it hard to read with a proportional font. +might be hard to read with a proportional font.
-If you want to change the font, you can do this easily -by inserting the following style into your ``.gtkrc-2.0`` -(usually found in your home directory on UNIX-like systems and in the -etc subdirectory of your Geany installation on Windows):: +If you want to change the font, you can do this easily by using the following +custom CSS snippet, see `Customizing Geany's appearance using GTK+ CSS`_::
- style "search_style" - { - font_name="Monospace 8" + #GeanyDialogSearch GtkEntry /* GTK < 3.20 */, + #GeanyDialogSearch entry /* GTK >= 3.20 */ { + font: 8pt monospace; } - widget "GeanyDialogSearch.*.GtkEntry" style:highest "search_style" - -Please note the addition of ":highest" in the last line which sets the priority -of this style to the highest available. Otherwise, the style is ignored -for the search dialogs.
Find selection @@ -3269,13 +3220,19 @@ On Unix-like systems the provided print dialog offers a print preview. The preview file is opened with a PDF viewer and by default GTK uses ``evince`` for print preview. If you have not installed evince or just want to use another PDF viewer, you can change the program to use in the file -``.gtkrc-2.0`` (usually found in your home directory). Simply add a line -like:: +``settings.ini`` (usually found in ``~/.config/gtk-3.0``, see the +`GTK documentation`_). For example, use:: + + [Settings] + gtk-print-preview-command = epdfview %f + +Of course, you can also use xpdf, kpdf or whatever as the print preview +command. That command should ideally delete the temporary file referenced by +``%f``. See the `GTK documentation for the setting`_ for more details.
- gtk-print-preview-command = "epdfview %f" +.. _GTK documentation: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings.descrip... +.. _GTK documentation for the setting: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-pr...
-at the end of the file. Of course, you can also use xpdf, kpdf or whatever -as the print preview command.
Geany also provides an alternative basic printing support using a custom print command. However, the printed document contains no syntax highlighting.
Modified: doc/plugins.dox 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -159,7 +159,7 @@ following. First you need to have Geany installed. Then install the development files for GTK and its dependencies. The easiest way to do this is to use your distribution's package management system, e.g. on Debian and Ubuntu systems you can use -@code apt-get install libgtk2.0-dev intltool @endcode +@code apt-get install libgtk-3-dev intltool @endcode This will install all necessary files to be able to compile plugins for Geany. On other distributions, the package names and commands to use may differ.
Modified: m4/geany-mac-integration.m4 4 lines changed, 1 insertions(+), 3 deletions(-) =================================================================== @@ -12,8 +12,6 @@ AC_DEFUN([GEANY_CHECK_MAC_INTEGRATION], AM_CONDITIONAL(ENABLE_MAC_INTEGRATION, [test "x$geany_enable_mac_integration" = "xyes"]) AM_COND_IF(ENABLE_MAC_INTEGRATION, [ - AS_IF([test "x$enable_gtk2" = xyes], - [PKG_CHECK_MODULES(MAC_INTEGRATION, gtk-mac-integration-gtk2)], - [PKG_CHECK_MODULES(MAC_INTEGRATION, gtk-mac-integration-gtk3)]) + PKG_CHECK_MODULES(MAC_INTEGRATION, gtk-mac-integration-gtk3) ]) ])
Modified: plugins/classbuilder.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -494,7 +494,7 @@ static void show_dialog_create_class(gint type) cc_dlg->base_header_entry = cc_table_attach_option_entry(table, _("Base source:"), row++); else { - hdr_hbox = gtk_hbox_new(FALSE, 6); + hdr_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
label = cc_table_attach_option_label(table, _("Base header:"), row);
Modified: plugins/demoplugin.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -182,7 +182,7 @@ static GtkWidget *demo_configure(GeanyPlugin *plugin, GtkDialog *dialog, gpointe GtkWidget *label, *entry, *vbox;
/* example configuration dialog */ - vbox = gtk_vbox_new(FALSE, 6); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
/* add a label and a text entry to the dialog */ label = gtk_label_new(_("Welcome text to show:"));
Modified: plugins/export.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -178,7 +178,7 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func, gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
/* file chooser extra widget */ - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), vbox); { GtkWidget *check_line_numbers;
Modified: plugins/filebrowser.c 18 lines changed, 9 insertions(+), 9 deletions(-) =================================================================== @@ -758,20 +758,20 @@ static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer dat return TRUE; }
- if (event->keyval == GDK_space) + if (event->keyval == GDK_KEY_space) { on_open_clicked(NULL, GINT_TO_POINTER(TRUE)); return TRUE; }
- if (( (event->keyval == GDK_Up || event->keyval == GDK_KP_Up) && (event->state & GDK_MOD1_MASK)) || /* FIXME: Alt-Up doesn't seem to work! */ - (event->keyval == GDK_BackSpace) ) + if (( (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) && (event->state & GDK_MOD1_MASK)) || /* FIXME: Alt-Up doesn't seem to work! */ + (event->keyval == GDK_KEY_BackSpace) ) { on_go_up(); return TRUE; }
- if ((event->keyval == GDK_F10 && event->state & GDK_SHIFT_MASK) || event->keyval == GDK_Menu) + if ((event->keyval == GDK_KEY_F10 && event->state & GDK_SHIFT_MASK) || event->keyval == GDK_KEY_Menu) { GdkEventButton button_event;
@@ -942,7 +942,7 @@ static GtkWidget *make_filterbar(void) { GtkWidget *label, *filterbar;
- filterbar = gtk_hbox_new(FALSE, 1); + filterbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
label = gtk_label_new(_("Filter:"));
@@ -1133,7 +1133,7 @@ void plugin_init(GeanyData *data)
filter = NULL;
- file_view_vbox = gtk_vbox_new(FALSE, 0); + file_view_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); toolbar = make_toolbar(); gtk_box_pack_start(GTK_BOX(file_view_vbox), toolbar, FALSE, FALSE, 0);
@@ -1261,8 +1261,8 @@ GtkWidget *plugin_configure(GtkDialog *dialog) GtkWidget *label, *entry, *checkbox_of, *checkbox_hf, *checkbox_fp, *checkbox_pb, *vbox; GtkWidget *box, *align;
- vbox = gtk_vbox_new(FALSE, 6); - box = gtk_vbox_new(FALSE, 3); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); + box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
label = gtk_label_new(_("External open command:")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); @@ -1287,7 +1287,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) pref_widgets.show_hidden_checkbox = checkbox_hf; g_signal_connect(checkbox_hf, "toggled", on_toggle_hidden, NULL);
- box = gtk_vbox_new(FALSE, 3); + box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3); checkbox_of = gtk_check_button_new_with_label(_("Hide file extensions:")); gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_of), FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_of), hide_object_files);
Modified: plugins/saveactions.c 20 lines changed, 10 insertions(+), 10 deletions(-) =================================================================== @@ -589,7 +589,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) GtkWidget *vbox, *label, *notebook_vbox, *checkbox_enable; GtkWidget *notebook, *inner_vbox;
- vbox = gtk_vbox_new(FALSE, 6); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
notebook = gtk_notebook_new(); gtk_widget_set_can_focus(notebook, FALSE); @@ -602,8 +602,8 @@ GtkWidget *plugin_configure(GtkDialog *dialog) { GtkWidget *spin, *hbox, *checkbox, *checkbox_enable_as_lf, *radio1, *radio2;
- notebook_vbox = gtk_vbox_new(FALSE, 2); - inner_vbox = gtk_vbox_new(FALSE, 5); + notebook_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2); + inner_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); gtk_container_set_border_width(GTK_CONTAINER(inner_vbox), 5); gtk_box_pack_start(GTK_BOX(notebook_vbox), inner_vbox, TRUE, TRUE, 5); gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), @@ -633,7 +633,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
label = gtk_label_new(_("seconds"));
- hbox = gtk_hbox_new(FALSE, 5); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5); gtk_box_pack_start(GTK_BOX(hbox), spin, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
@@ -670,8 +670,8 @@ GtkWidget *plugin_configure(GtkDialog *dialog) guint i; const GSList *node;
- notebook_vbox = gtk_vbox_new(FALSE, 2); - inner_vbox = gtk_vbox_new(FALSE, 5); + notebook_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2); + inner_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); gtk_container_set_border_width(GTK_CONTAINER(inner_vbox), 5); gtk_box_pack_start(GTK_BOX(notebook_vbox), inner_vbox, TRUE, TRUE, 5); gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), @@ -711,8 +711,8 @@ GtkWidget *plugin_configure(GtkDialog *dialog) { GtkWidget *hbox, *entry_dir, *entry_time, *button, *image, *spin_dir_levels;
- notebook_vbox = gtk_vbox_new(FALSE, 2); - inner_vbox = gtk_vbox_new(FALSE, 5); + notebook_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2); + inner_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); gtk_container_set_border_width(GTK_CONTAINER(inner_vbox), 5); gtk_box_pack_start(GTK_BOX(notebook_vbox), inner_vbox, TRUE, TRUE, 5); gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), @@ -742,7 +742,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON); gtk_container_add(GTK_CONTAINER(button), image);
- hbox = gtk_hbox_new(FALSE, 6); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(hbox), entry_dir, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
@@ -759,7 +759,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) gtk_entry_set_text(GTK_ENTRY(entry_time), backupcopy_time_fmt); gtk_box_pack_start(GTK_BOX(inner_vbox), entry_time, FALSE, FALSE, 0);
- hbox = gtk_hbox_new(FALSE, 6); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
label = gtk_label_new_with_mnemonic( _("Directory _levels to include in the backup destination:"));
Modified: plugins/splitwindow.c 8 lines changed, 2 insertions(+), 6 deletions(-) =================================================================== @@ -256,7 +256,6 @@ static void on_doc_show_menu(GtkMenuToolButton *button, GtkMenu *menu) }
-#if GTK_CHECK_VERSION(3, 0, 0) /* Blocks the ::show-menu signal if the menu's parent toggle button was inactive in the previous run. * This is a hack to workaround https://bugzilla.gnome.org/show_bug.cgi?id=769287 * and should NOT be used for any other version than 3.15.9 to 3.21.4, although the code tries and @@ -281,7 +280,6 @@ static void show_menu_gtk316_fix(GtkMenuToolButton *button, gpointer data) block_next = TRUE; } } -#endif
static GtkWidget *create_toolbar(void) @@ -302,11 +300,9 @@ static GtkWidget *create_toolbar(void)
item = gtk_menu_new(); gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(tool_item), item); -#if GTK_CHECK_VERSION (3, 0, 0) /* hack for https://bugzilla.gnome.org/show_bug.cgi?id=769287 */ if (! gtk_check_version(3, 15, 9) && gtk_check_version(3, 21, 4+1)) g_signal_connect(tool_item, "show-menu", G_CALLBACK(show_menu_gtk316_fix), NULL); -#endif g_signal_connect(tool_item, "show-menu", G_CALLBACK(on_doc_show_menu), item);
tool_item = gtk_tool_item_new(); @@ -343,13 +339,13 @@ static void split_view(gboolean horizontal) g_object_ref(notebook); gtk_container_remove(GTK_CONTAINER(parent), notebook);
- pane = horizontal ? gtk_hpaned_new() : gtk_vpaned_new(); + pane = gtk_paned_new(horizontal ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); gtk_container_add(GTK_CONTAINER(parent), pane);
gtk_container_add(GTK_CONTAINER(pane), notebook); g_object_unref(notebook);
- box = gtk_vbox_new(FALSE, 0); + box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); toolbar = create_toolbar(); gtk_box_pack_start(GTK_BOX(box), toolbar, FALSE, FALSE, 0); edit_window.vbox = box;
Modified: scripts/cross-build-mingw.sh 19 lines changed, 3 insertions(+), 16 deletions(-) =================================================================== @@ -15,24 +15,18 @@
# You may change those HOST=i686-w64-mingw32 -GTK2_BUNDLE_ZIP="https://download.geany.org/contrib/gtk/gtk+-bundle_2.24.10-20120208_win32.zi..." -GTK3_BUNDLE_ZIP="https://download.geany.org/contrib/gtk/gtk+-bundle_3.8.2-20131001_win32.zip" +GTK_BUNDLE_ZIP="https://download.geany.org/contrib/gtk/gtk+-bundle_3.8.2-20131001_win32.zip" BUILDDIR=_build-cross-mingw -GTK3=yes CONFIGUREFLAGS="--enable-nls" MAKEFLAGS="${MAKEFLAGS:--j2}"
while getopts '32b:h' o; do case "$o" in - 3) GTK3=yes;; - 2) GTK3=no;; b) BUILDDIR="$OPTARG";; h) cat <<EOF -USAGE: $0 [-2|-3] [-b DIR] [-h] +USAGE: $0 [-b DIR] [-h]
--2 Build against GTK2 (deprecated) --3 Build against GTK3 (default) -b DIR Use DIR as build directory -h Show this help and exit EOF @@ -81,14 +75,7 @@ cd "$BUILDDIR"
mkdir _deps
-# both the GTK2 and GTK3 build require files from the GTK3 bundle -# so download and unzip it unconditionally -fetch_and_unzip "$GTK3_BUNDLE_ZIP" _deps - -if [ "$GTK3" = no ]; then - fetch_and_unzip "$GTK2_BUNDLE_ZIP" _deps - CONFIGUREFLAGS="$CONFIGUREFLAGS --enable-gtk2=yes" -fi +fetch_and_unzip "$GTK_BUNDLE_ZIP" _deps
# fixup the prefix= in the pkg-config files sed -i "s%^(prefix=).*$%\1$PWD/_deps%" _deps/lib/pkgconfig/*.pc
Modified: scripts/gtk-bundle-from-msys2.sh 8 lines changed, 1 insertions(+), 7 deletions(-) =================================================================== @@ -18,7 +18,6 @@ UNX_UTILS_URL="https://download.geany.org/contrib/UnxUpdates.zip" MSYS2_ABI_PATH="/c/msys32"
package_urls="" -gtk2_dependency_pkgs="" gtk3_dependency_pkgs=" libepoxy hicolor-icon-theme @@ -62,23 +61,19 @@ handle_command_line_options() { "-z"|"--zip") make_zip="yes" ;; - "-2") - gtkv="2" - ;; "-3") gtkv="3" ;; "-n") run_pi="" ;; "-h"|"--help") - echo "gtk-bundle-from-msys2.sh [-c] [-h] [-n] [-z] [-2 | -3] [CACHEDIR]" + echo "gtk-bundle-from-msys2.sh [-c] [-h] [-n] [-z] [-3] [CACHEDIR]" echo " -c Use pacman cache. Otherwise pacman will download" echo " archive files" echo " -h Show this help screen" echo " -n Do not run post install scripts of the packages" echo " -z Create a zip afterwards" - echo " -2 Prefer gtk2" echo " -3 Prefer gtk3" echo "CACHEDIR Directory where to look for cached packages (default: /var/cache/pacman/pkg)" exit 1 @@ -200,7 +195,6 @@ cleanup_unnecessary_files() { rm -rf share/glib-2.0/gdb rm -rf share/glib-2.0/gettext rm -rf share/graphite2 - rm -rf share/gtk-2.0 rm -rf share/gtk-3.0 rm -rf share/gtk-doc rm -rf share/info
Modified: src/about.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -37,7 +37,7 @@ #include "ui_utils.h" #include "utils.h"
-#include "gtkcompat.h" +#include <gtk/gtk.h>
#define HEADER "<span size="larger" weight="bold">Geany %s</span>" #define INFO "<span size="larger" weight="bold">%s</span>" @@ -180,7 +180,7 @@ static GtkWidget *create_dialog(void) /* create header */ header_eventbox = gtk_event_box_new(); gtk_widget_show(header_eventbox); - header_hbox = gtk_hbox_new(FALSE, 12); + header_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width(GTK_CONTAINER(header_hbox), 4); gtk_widget_show(header_hbox); gtk_container_add(GTK_CONTAINER(header_eventbox), header_hbox); @@ -206,7 +206,7 @@ static GtkWidget *create_dialog(void) gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), notebook, TRUE, TRUE, 0);
/* create "Info" tab */ - info_box = gtk_vbox_new(FALSE, 0); + info_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width(GTK_CONTAINER(info_box), 6); gtk_widget_show(info_box);
@@ -259,7 +259,7 @@ static GtkWidget *create_dialog(void) gtk_widget_show(runtime_label); gtk_box_pack_start(GTK_BOX(info_box), runtime_label, FALSE, FALSE, 0);
- box = gtk_hbutton_box_new(); + box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL); url_button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(url_button), GTK_RELIEF_NONE); g_signal_connect(url_button, "clicked", G_CALLBACK(homepage_clicked), (gpointer)GEANY_HOMEPAGE);
Modified: src/build.c 35 lines changed, 11 insertions(+), 24 deletions(-) =================================================================== @@ -50,13 +50,12 @@ #include "vte.h" #include "win32.h"
-#include "gtkcompat.h" - #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> #include <errno.h> +#include <gtk/gtk.h> #include <glib/gstdio.h>
@@ -1733,14 +1732,10 @@ typedef struct RowWidgets gboolean used_dst; } RowWidgets;
-#if GTK_CHECK_VERSION(3,0,0) -typedef GdkRGBA InsensitiveColor; -#else -typedef GdkColor InsensitiveColor; -#endif -static InsensitiveColor insensitive_color;
-static void set_row_color(RowWidgets *r, InsensitiveColor *color) +static GdkRGBA insensitive_color; + +static void set_row_color(RowWidgets *r, GdkRGBA *color) { enum GeanyBuildCmdEntries i;
@@ -1749,11 +1744,7 @@ static void set_row_color(RowWidgets *r, InsensitiveColor *color) if (i == GEANY_BC_LABEL) continue;
-#if GTK_CHECK_VERSION(3,0,0) gtk_widget_override_color(r->entries[i], GTK_STATE_FLAG_NORMAL, color); -#else - gtk_widget_modify_text(r->entries[i], GTK_STATE_NORMAL, color); -#endif } }
@@ -1866,23 +1857,19 @@ static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gui enum GeanyBuildCmdEntries i; guint column = 0; gchar *text; + GtkStyleContext *ctx;
g_return_val_if_fail(doc == NULL || doc->is_valid, NULL);
text = g_strdup_printf("%d.", cmd + 1); label = gtk_label_new(text); g_free(text); -#if GTK_CHECK_VERSION(3,0,0) -{ - GtkStyleContext *ctx = gtk_widget_get_style_context(label);
+ ctx = gtk_widget_get_style_context(label); gtk_style_context_save(ctx); gtk_style_context_get_color(ctx, GTK_STATE_FLAG_INSENSITIVE, &insensitive_color); gtk_style_context_restore(ctx); -} -#else - insensitive_color = gtk_widget_get_style(label)->text[GTK_STATE_INSENSITIVE]; -#endif + gtk_table_attach(table, label, column, column + 1, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding); roww = g_new0(RowWidgets, 1); @@ -1979,7 +1966,7 @@ GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildT gtk_table_attach(table, label, col, col + 1, 0, 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding); } - sep = gtk_hseparator_new(); + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_table_attach(table, sep, 0, DC_N_COL, 1, 2, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, sep_padding); if (ft != NULL && ft->id != GEANY_FILETYPES_NONE) @@ -2018,7 +2005,7 @@ GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildT gtk_widget_set_sensitive(fields->fileregex, sensitivity); gtk_widget_set_sensitive(clear, sensitivity); ++row; - sep = gtk_hseparator_new(); + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_table_attach(table, sep, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, sep_padding); ++row; @@ -2059,7 +2046,7 @@ GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildT gtk_table_attach(table, label, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding); ++row; - sep = gtk_hseparator_new(); + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_table_attach(table, sep, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, sep_padding); ++row; @@ -2069,7 +2056,7 @@ GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildT entry_x_padding, entry_y_padding); for (++row, cmd = 0; cmd < build_groups_count[GEANY_GBG_EXEC]; ++row, ++cmdindex, ++cmd) fields->rows[cmdindex] = build_add_dialog_row(doc, table, row, dst, GEANY_GBG_EXEC, cmd, TRUE); - sep = gtk_hseparator_new(); + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_table_attach(table, sep, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, sep_padding); ++row;
Modified: src/callbacks.c 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -63,11 +63,10 @@ #include "utils.h" #include "vte.h"
-#include "gtkcompat.h" - #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <glib/gstdio.h> #include <time.h> @@ -1640,7 +1639,7 @@ gboolean on_escape_key_press_event(GtkWidget *widget, GdkEventKey *event, gpoint guint state = keybindings_get_modifiers(event->state);
/* make pressing escape in the sidebar and toolbar focus the editor */ - if (event->keyval == GDK_Escape && state == 0) + if (event->keyval == GDK_KEY_Escape && state == 0) { keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR); return TRUE;
Modified: src/dialogs.c 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -40,8 +40,7 @@ #include "ui_utils.h" #include "win32.h"
-#include "gtkcompat.h" - +#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <string.h>
@@ -305,7 +304,7 @@ static GtkWidget *add_file_open_extra_widget(GtkWidget *dialog) GtkWidget *encoding_ebox, *encoding_label, *encoding_combo;
expander = gtk_expander_new_with_mnemonic(_("_More Options")); - vbox = gtk_vbox_new(FALSE, 6); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_container_add(GTK_CONTAINER(expander), vbox);
table = gtk_table_new(2, 4, FALSE);
Modified: src/document.c 26 lines changed, 7 insertions(+), 19 deletions(-) =================================================================== @@ -54,8 +54,6 @@ #include "vte.h" #include "win32.h"
-#include "gtkcompat.h" - #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif @@ -78,6 +76,7 @@ /*#define USE_GIO_FILEMON 1*/ #include <gio/gio.h>
+#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h>
@@ -3285,7 +3284,6 @@ const GdkColor *document_get_status_color(GeanyDocument *doc) return NULL; if (! document_status_styles[status].loaded) { -#if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA color; GtkWidgetPath *path = gtk_widget_path_new(); GtkStyleContext *ctx = gtk_style_context_new(); @@ -3303,16 +3301,6 @@ const GdkColor *document_get_status_color(GeanyDocument *doc) document_status_styles[status].loaded = TRUE; gtk_widget_path_unref(path); g_object_unref(ctx); -#else - GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(doc->editor->sci)); - gchar *path = g_strconcat("GeanyMainWindow.GtkHBox.GtkNotebook.", - document_status_styles[status].name, NULL); - GtkStyle *style = gtk_rc_get_style_by_paths(settings, path, NULL, GTK_TYPE_LABEL); - - document_status_styles[status].color = style->fg[GTK_STATE_NORMAL]; - document_status_styles[status].loaded = TRUE; - g_free(path); -#endif } return &document_status_styles[status].color; } @@ -3482,7 +3470,7 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
g_signal_connect(info_widget, "response", G_CALLBACK(response_cb), doc);
- hbox = gtk_hbox_new(FALSE, 12); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE, 0);
switch (msgtype) @@ -3509,7 +3497,7 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
if (extra_text) { - GtkWidget *vbox = gtk_vbox_new(FALSE, 6); + GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); GtkWidget *extra_label = geany_wrap_label_new(extra_text);
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); @@ -3568,15 +3556,15 @@ static gboolean on_sci_key(GtkWidget *widget, GdkEventKey *event, gpointer data)
switch (event->keyval) { - case GDK_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_ISO_Left_Tab: { GtkWidget *action_area = gtk_info_bar_get_action_area(bar); - GtkDirectionType dir = event->keyval == GDK_Tab ? GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD; + GtkDirectionType dir = event->keyval == GDK_KEY_Tab ? GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD; gtk_widget_child_focus(action_area, dir); return TRUE; } - case GDK_Escape: + case GDK_KEY_Escape: { gtk_info_bar_response(bar, GTK_RESPONSE_CANCEL); return TRUE;
Modified: src/documentprivate.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -22,7 +22,7 @@ #ifndef GEANY_DOCUMENT_PRIVATE_H #define GEANY_DOCUMENT_PRIVATE_H 1
-#include "gtkcompat.h" +#include <gtk/gtk.h>
G_BEGIN_DECLS
Modified: src/editor.c 20 lines changed, 3 insertions(+), 17 deletions(-) =================================================================== @@ -57,11 +57,10 @@
#include "SciLexer.h"
-#include "gtkcompat.h" - #include <ctype.h> #include <string.h>
+#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h>
@@ -2667,7 +2666,7 @@ gboolean editor_complete_snippet(GeanyEditor *editor, gint pos) return FALSE; /* return if we are editing an existing line (chars on right of cursor) */ if (keybindings_lookup_item(GEANY_KEY_GROUP_EDITOR, - GEANY_KEYS_EDITOR_COMPLETESNIPPET)->key == GDK_space && + GEANY_KEYS_EDITOR_COMPLETESNIPPET)->key == GDK_KEY_space && ! editor_prefs.complete_snippets_whilst_editing && ! at_eol(sci, pos)) return FALSE;
@@ -4814,8 +4813,7 @@ static gboolean on_editor_focus_in(GtkWidget *widget, GdkEventFocus *event, gpoi }
-static gboolean on_editor_expose_event(GtkWidget *widget, GdkEventExpose *event, - gpointer user_data) +static gboolean on_editor_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data) { GeanyEditor *editor = user_data;
@@ -4826,14 +4824,6 @@ static gboolean on_editor_expose_event(GtkWidget *widget, GdkEventExpose *event, }
-#if GTK_CHECK_VERSION(3, 0, 0) -static gboolean on_editor_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data) -{ - return on_editor_expose_event(widget, NULL, user_data); -} -#endif - - static void setup_sci_keys(ScintillaObject *sci) { /* disable some Scintilla keybindings to be able to redefine them cleanly */ @@ -4978,11 +4968,7 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor) g_signal_connect(sci, "scroll-event", G_CALLBACK(on_editor_scroll_event), editor); g_signal_connect(sci, "motion-notify-event", G_CALLBACK(on_motion_event), NULL); g_signal_connect(sci, "focus-in-event", G_CALLBACK(on_editor_focus_in), editor); -#if GTK_CHECK_VERSION(3, 0, 0) g_signal_connect(sci, "draw", G_CALLBACK(on_editor_draw), editor); -#else - g_signal_connect(sci, "expose-event", G_CALLBACK(on_editor_expose_event), editor); -#endif } return sci; }
Modified: src/filetypesprivate.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -24,7 +24,7 @@
#include "build.h"
-#include "gtkcompat.h" +#include <gtk/gtk.h>
G_BEGIN_DECLS
Modified: src/gb.c 45 lines changed, 6 insertions(+), 39 deletions(-) =================================================================== @@ -24,7 +24,7 @@
#include "utils.h"
-#include "gtkcompat.h" +#include <gtk/gtk.h>
#define AREA_SIZE 300 @@ -78,22 +78,14 @@ static GType geany_pong_get_type(void) G_GNUC_CONST; G_DEFINE_TYPE(GeanyPong, geany_pong, GTK_TYPE_DIALOG)
-#if GTK_CHECK_VERSION(3, 0, 0) static void geany_pong_set_cairo_source_color(cairo_t *cr, GdkRGBA *c, gdouble a) { cairo_set_source_rgba(cr, c->red, c->green, c->blue, MIN(c->alpha, a)); } -#else -static void geany_pong_set_cairo_source_color(cairo_t *cr, GdkColor *c, gdouble a) -{ - cairo_set_source_rgba(cr, c->red/65535.0, c->green/65535.0, c->blue/65535.0, a); -} -#endif
static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *self) { -#if GTK_CHECK_VERSION(3, 0, 0) /* we use the window style context because the area one has a transparent * background and we want something to paint for the overlay */ GtkStyleContext *ctx = gtk_widget_get_style_context(GTK_WIDGET(self)); @@ -102,11 +94,6 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se
gtk_style_context_get_color(ctx, state, &fg); gtk_style_context_get_background_color(ctx, state, &bg); -#else - GtkStyle *style = gtk_widget_get_style(area); - GdkColor fg = style->fg[GTK_STATE_NORMAL]; - GdkColor bg = style->bg[GTK_STATE_NORMAL]; -#endif
self->area_width = gtk_widget_get_allocated_width(area); self->area_height = gtk_widget_get_allocated_height(area); @@ -134,24 +121,22 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se PangoLayout *layout; gint pw, ph; gdouble scale; + PangoFontDescription *font = NULL;
geany_pong_set_cairo_source_color(cr, &bg, 0.8); cairo_rectangle(cr, 0, 0, self->area_width, self->area_height); cairo_paint(cr);
geany_pong_set_cairo_source_color(cr, &fg, 1.0); layout = pango_cairo_create_layout(cr); -#if GTK_CHECK_VERSION(3, 0, 0) - PangoFontDescription *font = NULL; + gtk_style_context_get(ctx, state, GTK_STYLE_PROPERTY_FONT, &font, NULL); if (font) { pango_layout_set_font_description(layout, font); pango_font_description_free(font); } -#else - pango_layout_set_font_description(layout, style->font_desc); -#endif + if (! self->handle_width) pango_layout_set_markup(layout, "<b>You won!</b>\n<small>OK, go back to work now.</small>", -1); else @@ -171,20 +156,6 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se }
-#if ! GTK_CHECK_VERSION(3, 0, 0) -static gboolean geany_pong_area_expose(GtkWidget *area, GdkEventExpose *event, GeanyPong *self) -{ - cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(area)); - gboolean ret; - - ret = geany_pong_area_draw(area, cr, self); - cairo_destroy(cr); - - return ret; -} -#endif - - static void geany_pong_reset_ball(GeanyPong *self) { self->ball_speed = 5; @@ -349,11 +320,11 @@ static void geany_pong_init(GeanyPong *self) gtk_window_set_skip_pager_hint(GTK_WINDOW(self), TRUE); gtk_window_set_resizable(GTK_WINDOW(self), FALSE);
- vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(self))), vbox, TRUE, TRUE, 0);
- hbox = gtk_hbox_new(FALSE, 6); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new("Score:"); @@ -365,11 +336,7 @@ static void geany_pong_init(GeanyPong *self)
self->area = gtk_drawing_area_new(); gtk_widget_add_events(self->area, GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK); -#if GTK_CHECK_VERSION(3, 0, 0) g_signal_connect(self->area, "draw", G_CALLBACK(geany_pong_area_draw), self); -#else - g_signal_connect(self->area, "expose-event", G_CALLBACK(geany_pong_area_expose), self); -#endif g_signal_connect(self->area, "button-press-event", G_CALLBACK(geany_pong_area_button_press), self); g_signal_connect(self->area, "motion-notify-event", G_CALLBACK(geany_pong_area_motion_notify), self); gtk_widget_set_size_request(self->area, AREA_SIZE, AREA_SIZE);
Modified: src/geanywraplabel.c 45 lines changed, 4 insertions(+), 41 deletions(-) =================================================================== @@ -48,7 +48,6 @@ struct _GeanyWrapLabel };
-#if GTK_CHECK_VERSION(3, 0, 0) static gboolean geany_wrap_label_draw(GtkWidget *widget, cairo_t *cr); static void geany_wrap_label_get_preferred_width (GtkWidget *widget, gint *minimal_width, gint *natural_width); @@ -59,10 +58,6 @@ static void geany_wrap_label_get_preferred_width_for_height (GtkWidget *widget, static void geany_wrap_label_get_preferred_height_for_width (GtkWidget *widget, gint width, gint *minimal_height, gint *natural_height); static GtkSizeRequestMode geany_wrap_label_get_request_mode(GtkWidget *widget); -#else -static gboolean geany_wrap_label_expose (GtkWidget *widget, GdkEventExpose *event); -static void geany_wrap_label_size_request (GtkWidget *widget, GtkRequisition *req); -#endif static void geany_wrap_label_size_allocate (GtkWidget *widget, GtkAllocation *alloc); static void geany_wrap_label_set_wrap_width (GtkWidget *widget, gint width); static void geany_wrap_label_label_notify (GObject *object, GParamSpec *pspec, gpointer data); @@ -75,17 +70,12 @@ static void geany_wrap_label_class_init(GeanyWrapLabelClass *klass) GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
widget_class->size_allocate = geany_wrap_label_size_allocate; -#if GTK_CHECK_VERSION(3, 0, 0) widget_class->draw = geany_wrap_label_draw; widget_class->get_preferred_width = geany_wrap_label_get_preferred_width; widget_class->get_preferred_width_for_height = geany_wrap_label_get_preferred_width_for_height; widget_class->get_preferred_height = geany_wrap_label_get_preferred_height; widget_class->get_preferred_height_for_width = geany_wrap_label_get_preferred_height_for_width; widget_class->get_request_mode = geany_wrap_label_get_request_mode; -#else - widget_class->size_request = geany_wrap_label_size_request; - widget_class->expose_event = geany_wrap_label_expose; -#endif
g_type_class_add_private(klass, sizeof (GeanyWrapLabelPrivate)); } @@ -140,7 +130,6 @@ static void geany_wrap_label_label_notify(GObject *object, GParamSpec *pspec, gp }
-#if GTK_CHECK_VERSION(3, 0, 0) /* makes sure the layout is setup for rendering and chains to parent renderer */ static gboolean geany_wrap_label_draw(GtkWidget *widget, cairo_t *cr) { @@ -199,48 +188,22 @@ static GtkSizeRequestMode geany_wrap_label_get_request_mode(GtkWidget *widget) return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT; }
-#else /* GTK3 */ - -/* makes sure the layout is setup for rendering and chains to parent renderer */ -static gboolean geany_wrap_label_expose(GtkWidget *widget, GdkEventExpose *event) -{ - GeanyWrapLabel *self = GEANY_WRAP_LABEL(widget); - PangoLayout *layout = gtk_label_get_layout(GTK_LABEL(widget)); - - pango_layout_set_width(layout, self->priv->wrap_width * PANGO_SCALE); - pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); - - return (* GTK_WIDGET_CLASS(geany_wrap_label_parent_class)->expose_event)(widget, event); -} - - -/* Forces the height to be the size necessary for the Pango layout, while allowing the - * width to be flexible. */ -static void geany_wrap_label_size_request(GtkWidget *widget, GtkRequisition *req) -{ - req->width = 0; - req->height = GEANY_WRAP_LABEL(widget)->priv->wrap_height; -} -#endif /* GTK3 */ -
/* Sets the wrap width to the width allocated to us. */ static void geany_wrap_label_size_allocate(GtkWidget *widget, GtkAllocation *alloc) { + GtkWidget *parent; + (* GTK_WIDGET_CLASS(geany_wrap_label_parent_class)->size_allocate)(widget, alloc);
geany_wrap_label_set_wrap_width(widget, alloc->width);
-#if GTK_CHECK_VERSION(3, 0, 0) -{ - /* ask the parent to recompute our size, because it seems GTK3 size + /* ask the parent to recompute our size, because it seems GTK size * caching is too aggressive */ - GtkWidget *parent = gtk_widget_get_parent(widget); + parent = gtk_widget_get_parent(widget); if (GTK_IS_CONTAINER(parent)) gtk_container_check_resize(GTK_CONTAINER(parent)); } -#endif -}
GtkWidget *geany_wrap_label_new(const gchar *text)
Modified: src/gtkcompat.h 82 lines changed, 6 insertions(+), 76 deletions(-) =================================================================== @@ -18,86 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
-/* Compatibility macros to support older GTK+ versions */ +/* Compatibility macros to support older GTK+ versions + * + * Although this file might not be useful anymore, it might be used by plugins + * so it cannot be removed without care. + */
#ifndef GTK_COMPAT_H #define GTK_COMPAT_H 1
#include <gtk/gtk.h> -#if GTK_CHECK_VERSION(3, 0, 0) -# include <gdk/gdkkeysyms-compat.h> -#endif - -G_BEGIN_DECLS - - -/* GtkComboBoxText */ -/* This is actually available in GTK 2.24, but we expose GtkComboBoxText in the - * API so we don't want the type to change for no good reason (although this - * should probably be harmless since it's only a derivated type). However, since - * a plugin needs to be rebuilt and tuned to work with GTK3 we don't mind that - * a type changes between the GTK2 and GTK3 version */ -#if ! GTK_CHECK_VERSION(3, 0, 0) -/* undef those not to get warnings about redefinitions under GTK 2.24 */ -# undef GTK_COMBO_BOX_TEXT -# undef GTK_COMBO_BOX_TEXT_CLASS -# undef GTK_COMBO_BOX_TEXT_GET_CLASS -# undef GTK_IS_COMBO_BOX_TEXT -# undef GTK_IS_COMBO_BOX_TEXT_CLASS -# undef GTK_TYPE_COMBO_BOX_TEXT - -# define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX -# define GTK_COMBO_BOX_TEXT_CLASS GTK_COMBO_BOX_CLASS -# define GTK_COMBO_BOX_TEXT_GET_CLASS GTK_COMBO_BOX_GET_CLASS -# define GTK_IS_COMBO_BOX_TEXT GTK_IS_COMBO_BOX -# define GTK_IS_COMBO_BOX_TEXT_CLASS GTK_IS_COMBO_BOX_CLASS -# define GTK_TYPE_COMBO_BOX_TEXT GTK_TYPE_COMBO_BOX -# define GtkComboBoxText GtkComboBox -# define gtk_combo_box_text_new gtk_combo_box_new_text -# define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text -# define gtk_combo_box_text_append_text gtk_combo_box_append_text -# define gtk_combo_box_text_insert_text gtk_combo_box_insert_text -# define gtk_combo_box_text_prepend_text gtk_combo_box_prepend_text -# define gtk_combo_box_text_remove gtk_combo_box_remove_text -# define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text -#endif - -/* GtkWidget */ -#if ! GTK_CHECK_VERSION(3, 0, 0) -# define gtk_widget_get_allocated_height(widget) (((GtkWidget *) (widget))->allocation.height) -# define gtk_widget_get_allocated_width(widget) (((GtkWidget *) (widget))->allocation.width) -#endif - - -/* Mappings below only prevent some deprecation warnings on GTK3 for things - * that didn't exist on GTK2. That's not future-proof. */ -#if GTK_CHECK_VERSION(3, 0, 0) -/* Gtk[VH]Box */ -# define compat_gtk_box_new(orientation, homogeneous, spacing) \ - ((GtkWidget *)g_object_new(GTK_TYPE_BOX, \ - "orientation", (orientation), \ - "homogeneous", (homogeneous), \ - "spacing", (spacing), \ - NULL)) -# define gtk_vbox_new(homogeneous, spacing) \ - compat_gtk_box_new(GTK_ORIENTATION_VERTICAL, (homogeneous), (spacing)) -# define gtk_hbox_new(homogeneous, spacing) \ - compat_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, (homogeneous), (spacing)) -/* Gtk[VH]ButtonBox */ -# define gtk_vbutton_box_new() gtk_button_box_new(GTK_ORIENTATION_VERTICAL) -# define gtk_hbutton_box_new() gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL) -/* Gtk[VH]Separator */ -# define gtk_vseparator_new() gtk_separator_new(GTK_ORIENTATION_VERTICAL) -# define gtk_hseparator_new() gtk_separator_new(GTK_ORIENTATION_HORIZONTAL) -/* Gtk[VH]Paned */ -# define gtk_vpaned_new() gtk_paned_new(GTK_ORIENTATION_VERTICAL) -# define gtk_hpaned_new() gtk_paned_new(GTK_ORIENTATION_HORIZONTAL) -/* Gtk[VH]Scrollbar */ -# define gtk_vscrollbar_new(adj) gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, (adj)) -# define gtk_hscrollbar_new(adj) gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, (adj)) -#endif - - -G_END_DECLS +#include <gdk/gdkkeysyms-compat.h>
#endif /* GTK_COMPAT_H */
Modified: src/keybindings.c 265 lines changed, 132 insertions(+), 133 deletions(-) =================================================================== @@ -54,8 +54,7 @@ #include "utils.h" #include "vte.h"
-#include "gtkcompat.h" - +#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <string.h>
@@ -161,7 +160,7 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id) * @param key_id Keybinding index for the group. * @param callback @nullable Function to call when activated, or @c NULL to use the group callback. * Usually it's better to use the group callback instead - see plugin_set_key_group(). - * @param key Default key, e.g. @c GDK_j (must be lower case), but usually 0 for unset. + * @param key Default key, e.g. @c GDK_KEY_j (must be lower case), but usually 0 for unset. * @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset. * @param kf_name Key name used for this item in the keybindings configuration file, i.e. @c "menu_new". * @param label Label used in the preferences dialog keybindings tab. May contain @@ -214,7 +213,7 @@ GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id, * * @param group Group. * @param key_id Keybinding index for the group. - * @param key Default key, e.g. @c GDK_j (must be lower case), but usually 0 for unset. + * @param key Default key, e.g. @c GDK_KEY_j (must be lower case), but usually 0 for unset. * @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset. * @param kf_name Key name used for this item in the keybindings configuration file, i.e. @c "menu_new". * @param label Label used in the preferences dialog keybindings tab. May contain @@ -332,34 +331,34 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_FILE);
add_kb(group, GEANY_KEYS_FILE_NEW, NULL, - GDK_n, GEANY_PRIMARY_MOD_MASK, "menu_new", _("New"), "menu_new1"); + GDK_KEY_n, GEANY_PRIMARY_MOD_MASK, "menu_new", _("New"), "menu_new1"); add_kb(group, GEANY_KEYS_FILE_OPEN, NULL, - GDK_o, GEANY_PRIMARY_MOD_MASK, "menu_open", _("Open"), "menu_open1"); + GDK_KEY_o, GEANY_PRIMARY_MOD_MASK, "menu_open", _("Open"), "menu_open1"); add_kb(group, GEANY_KEYS_FILE_OPENSELECTED, NULL, - GDK_o, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "menu_open_selected", + GDK_KEY_o, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "menu_open_selected", _("Open selected file"), "menu_open_selected_file1"); add_kb(group, GEANY_KEYS_FILE_SAVE, NULL, - GDK_s, GEANY_PRIMARY_MOD_MASK, "menu_save", _("Save"), "menu_save1"); + GDK_KEY_s, GEANY_PRIMARY_MOD_MASK, "menu_save", _("Save"), "menu_save1"); add_kb(group, GEANY_KEYS_FILE_SAVEAS, NULL, 0, 0, "menu_saveas", _("Save as"), "menu_save_as1"); add_kb(group, GEANY_KEYS_FILE_SAVEALL, NULL, - GDK_s, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "menu_saveall", _("Save all"), + GDK_KEY_s, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "menu_saveall", _("Save all"), "menu_save_all1"); add_kb(group, GEANY_KEYS_FILE_PROPERTIES, NULL, 0, 0, "file_properties", _("Properties"), "properties1"); add_kb(group, GEANY_KEYS_FILE_PRINT, NULL, - GDK_p, GEANY_PRIMARY_MOD_MASK, "menu_print", _("Print"), "print1"); + GDK_KEY_p, GEANY_PRIMARY_MOD_MASK, "menu_print", _("Print"), "print1"); add_kb(group, GEANY_KEYS_FILE_CLOSE, NULL, - GDK_w, GEANY_PRIMARY_MOD_MASK, "menu_close", _("Close"), "menu_close1"); + GDK_KEY_w, GEANY_PRIMARY_MOD_MASK, "menu_close", _("Close"), "menu_close1"); add_kb(group, GEANY_KEYS_FILE_CLOSEALL, NULL, - GDK_w, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "menu_closeall", _("Close all"), + GDK_KEY_w, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "menu_closeall", _("Close all"), "menu_close_all1"); add_kb(group, GEANY_KEYS_FILE_RELOAD, NULL, - GDK_r, GEANY_PRIMARY_MOD_MASK, "menu_reloadfile", _("Reload file"), "menu_reload1"); + GDK_KEY_r, GEANY_PRIMARY_MOD_MASK, "menu_reloadfile", _("Reload file"), "menu_reload1"); add_kb(group, GEANY_KEYS_FILE_OPENLASTTAB, NULL, 0, 0, "file_openlasttab", _("Re-open last closed tab"), NULL); add_kb(group, GEANY_KEYS_FILE_QUIT, NULL, - GDK_q, GEANY_PRIMARY_MOD_MASK, "menu_quit", _("Quit"), "menu_quit1"); + GDK_KEY_q, GEANY_PRIMARY_MOD_MASK, "menu_quit", _("Quit"), "menu_quit1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_PROJECT);
@@ -376,77 +375,77 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_EDITOR);
add_kb(group, GEANY_KEYS_EDITOR_UNDO, NULL, - GDK_z, GEANY_PRIMARY_MOD_MASK, "menu_undo", _("Undo"), "menu_undo2"); + GDK_KEY_z, GEANY_PRIMARY_MOD_MASK, "menu_undo", _("Undo"), "menu_undo2"); add_kb(group, GEANY_KEYS_EDITOR_REDO, NULL, - GDK_y, GEANY_PRIMARY_MOD_MASK, "menu_redo", _("Redo"), "menu_redo2"); + GDK_KEY_y, GEANY_PRIMARY_MOD_MASK, "menu_redo", _("Redo"), "menu_redo2"); add_kb(group, GEANY_KEYS_EDITOR_DUPLICATELINE, NULL, - GDK_d, GEANY_PRIMARY_MOD_MASK, "edit_duplicateline", _("D_uplicate Line or Selection"), + GDK_KEY_d, GEANY_PRIMARY_MOD_MASK, "edit_duplicateline", _("D_uplicate Line or Selection"), "duplicate_line_or_selection1"); add_kb(group, GEANY_KEYS_EDITOR_DELETELINE, NULL, - GDK_k, GEANY_PRIMARY_MOD_MASK, "edit_deleteline", _("_Delete Current Line(s)"), + GDK_KEY_k, GEANY_PRIMARY_MOD_MASK, "edit_deleteline", _("_Delete Current Line(s)"), "delete_current_lines1"); add_kb(group, GEANY_KEYS_EDITOR_DELETELINETOEND, NULL, - GDK_Delete, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetoend", + GDK_KEY_Delete, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetoend", _("Delete to line end"), NULL); add_kb(group, GEANY_KEYS_EDITOR_DELETELINETOBEGINNING, NULL, - GDK_BackSpace, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetobegin", + GDK_KEY_BackSpace, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetobegin", _("Delete to beginning of line"), NULL); /* Note: transpose may fit better in format group, but that would break the API */ add_kb(group, GEANY_KEYS_EDITOR_TRANSPOSELINE, NULL, 0, 0, "edit_transposeline", _("_Transpose Current Line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SCROLLTOLINE, NULL, - GDK_l, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_scrolltoline", _("Scroll to current line"), NULL); + GDK_KEY_l, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_scrolltoline", _("Scroll to current line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SCROLLLINEUP, NULL, - GDK_Up, GDK_MOD1_MASK, "edit_scrolllineup", _("Scroll up the view by one line"), NULL); + GDK_KEY_Up, GDK_MOD1_MASK, "edit_scrolllineup", _("Scroll up the view by one line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SCROLLLINEDOWN, NULL, - GDK_Down, GDK_MOD1_MASK, "edit_scrolllinedown", _("Scroll down the view by one line"), NULL); + GDK_KEY_Down, GDK_MOD1_MASK, "edit_scrolllinedown", _("Scroll down the view by one line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_COMPLETESNIPPET, NULL, - GDK_Tab, 0, "edit_completesnippet", _("Complete snippet"), NULL); + GDK_KEY_Tab, 0, "edit_completesnippet", _("Complete snippet"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SNIPPETNEXTCURSOR, NULL, 0, 0, "move_snippetnextcursor", _("Move cursor in snippet"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SUPPRESSSNIPPETCOMPLETION, NULL, 0, 0, "edit_suppresssnippetcompletion", _("Suppress snippet completion"), NULL); add_kb(group, GEANY_KEYS_EDITOR_CONTEXTACTION, NULL, 0, 0, "popup_contextaction", _("Context Action"), NULL); add_kb(group, GEANY_KEYS_EDITOR_AUTOCOMPLETE, NULL, - GDK_space, GEANY_PRIMARY_MOD_MASK, "edit_autocomplete", _("Complete word"), NULL); + GDK_KEY_space, GEANY_PRIMARY_MOD_MASK, "edit_autocomplete", _("Complete word"), NULL); add_kb(group, GEANY_KEYS_EDITOR_CALLTIP, NULL, - GDK_space, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_calltip", _("Show calltip"), NULL); + GDK_KEY_space, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_calltip", _("Show calltip"), NULL); add_kb(group, GEANY_KEYS_EDITOR_WORDPARTCOMPLETION, NULL, - GDK_Tab, 0, "edit_wordpartcompletion", _("Word part completion"), NULL); + GDK_KEY_Tab, 0, "edit_wordpartcompletion", _("Word part completion"), NULL); add_kb(group, GEANY_KEYS_EDITOR_MOVELINEUP, NULL, - GDK_Page_Up, GDK_MOD1_MASK, "edit_movelineup", + GDK_KEY_Page_Up, GDK_MOD1_MASK, "edit_movelineup", _("Move line(s) up"), "move_lines_up1"); add_kb(group, GEANY_KEYS_EDITOR_MOVELINEDOWN, NULL, - GDK_Page_Down, GDK_MOD1_MASK, "edit_movelinedown", + GDK_KEY_Page_Down, GDK_MOD1_MASK, "edit_movelinedown", _("Move line(s) down"), "move_lines_down1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_CLIPBOARD);
add_kb(group, GEANY_KEYS_CLIPBOARD_CUT, NULL, - GDK_x, GEANY_PRIMARY_MOD_MASK, "menu_cut", _("Cut"), "menu_cut1"); + GDK_KEY_x, GEANY_PRIMARY_MOD_MASK, "menu_cut", _("Cut"), "menu_cut1"); add_kb(group, GEANY_KEYS_CLIPBOARD_COPY, NULL, - GDK_c, GEANY_PRIMARY_MOD_MASK, "menu_copy", _("Copy"), "menu_copy1"); + GDK_KEY_c, GEANY_PRIMARY_MOD_MASK, "menu_copy", _("Copy"), "menu_copy1"); add_kb(group, GEANY_KEYS_CLIPBOARD_PASTE, NULL, - GDK_v, GEANY_PRIMARY_MOD_MASK, "menu_paste", _("Paste"), "menu_paste1"); + GDK_KEY_v, GEANY_PRIMARY_MOD_MASK, "menu_paste", _("Paste"), "menu_paste1"); add_kb(group, GEANY_KEYS_CLIPBOARD_COPYLINE, NULL, - GDK_c, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_copyline", _("_Copy Current Line(s)"), + GDK_KEY_c, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_copyline", _("_Copy Current Line(s)"), "copy_current_lines1"); add_kb(group, GEANY_KEYS_CLIPBOARD_CUTLINE, NULL, - GDK_x, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_cutline", _("Cu_t Current Line(s)"), + GDK_KEY_x, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "edit_cutline", _("Cu_t Current Line(s)"), "cut_current_lines1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_SELECT);
add_kb(group, GEANY_KEYS_SELECT_ALL, NULL, - GDK_a, GEANY_PRIMARY_MOD_MASK, "menu_selectall", _("Select All"), "menu_select_all1"); + GDK_KEY_a, GEANY_PRIMARY_MOD_MASK, "menu_selectall", _("Select All"), "menu_select_all1"); add_kb(group, GEANY_KEYS_SELECT_WORD, NULL, - GDK_w, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectword", _("Select current word"), NULL); + GDK_KEY_w, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectword", _("Select current word"), NULL); add_kb(group, GEANY_KEYS_SELECT_LINE, NULL, - GDK_l, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectline", _("S_elect Current Line(s)"), + GDK_KEY_l, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectline", _("S_elect Current Line(s)"), "select_current_lines1"); add_kb(group, GEANY_KEYS_SELECT_PARAGRAPH, NULL, - GDK_p, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectparagraph", _("Se_lect Current Paragraph"), + GDK_KEY_p, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectparagraph", _("Se_lect Current Paragraph"), "select_current_paragraph1"); add_kb(group, GEANY_KEYS_SELECT_WORDPARTLEFT, NULL, 0, 0, "edit_selectwordpartleft", _("Select to previous word part"), NULL); @@ -456,20 +455,20 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_FORMAT);
add_kb(group, GEANY_KEYS_FORMAT_TOGGLECASE, NULL, - GDK_u, GEANY_PRIMARY_MOD_MASK | GDK_MOD1_MASK, "edit_togglecase", + GDK_KEY_u, GEANY_PRIMARY_MOD_MASK | GDK_MOD1_MASK, "edit_togglecase", _("T_oggle Case of Selection"), "menu_toggle_case2"); add_kb(group, GEANY_KEYS_FORMAT_COMMENTLINETOGGLE, NULL, - GDK_e, GEANY_PRIMARY_MOD_MASK, "edit_commentlinetoggle", _("Toggle line commentation"), + GDK_KEY_e, GEANY_PRIMARY_MOD_MASK, "edit_commentlinetoggle", _("Toggle line commentation"), "menu_toggle_line_commentation1"); add_kb(group, GEANY_KEYS_FORMAT_COMMENTLINE, NULL, 0, 0, "edit_commentline", _("Comment line(s)"), "menu_comment_line1"); add_kb(group, GEANY_KEYS_FORMAT_UNCOMMENTLINE, NULL, 0, 0, "edit_uncommentline", _("Uncomment line(s)"), "menu_uncomment_line1"); add_kb(group, GEANY_KEYS_FORMAT_INCREASEINDENT, NULL, - GDK_i, GEANY_PRIMARY_MOD_MASK, "edit_increaseindent", _("Increase indent"), + GDK_KEY_i, GEANY_PRIMARY_MOD_MASK, "edit_increaseindent", _("Increase indent"), "menu_increase_indent1"); add_kb(group, GEANY_KEYS_FORMAT_DECREASEINDENT, NULL, - GDK_u, GEANY_PRIMARY_MOD_MASK, "edit_decreaseindent", _("Decrease indent"), + GDK_KEY_u, GEANY_PRIMARY_MOD_MASK, "edit_decreaseindent", _("Decrease indent"), "menu_decrease_indent1"); add_kb(group, GEANY_KEYS_FORMAT_INCREASEINDENTBYSPACE, NULL, 0, 0, "edit_increaseindentbyspace", _("Increase indent by one space"), NULL); @@ -478,11 +477,11 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_FORMAT_AUTOINDENT, NULL, 0, 0, "edit_autoindent", _("S_mart Line Indent"), "smart_line_indent1"); add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD1, NULL, - GDK_1, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd1", _("Send to Custom Command 1"), NULL); + GDK_KEY_1, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd1", _("Send to Custom Command 1"), NULL); add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD2, NULL, - GDK_2, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd2", _("Send to Custom Command 2"), NULL); + GDK_KEY_2, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd2", _("Send to Custom Command 2"), NULL); add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD3, NULL, - GDK_3, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd3", _("Send to Custom Command 3"), NULL); + GDK_KEY_3, GEANY_PRIMARY_MOD_MASK, "edit_sendtocmd3", _("Send to Custom Command 3"), NULL); add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD4, NULL, 0, 0, "edit_sendtocmd4", _("Send to Custom Command 4"), NULL); add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD5, NULL, @@ -499,15 +498,15 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_FORMAT_SENDTOVTE, NULL, 0, 0, "edit_sendtovte", _("_Send Selection to Terminal"), "send_selection_to_vte1"); add_kb(group, GEANY_KEYS_FORMAT_REFLOWPARAGRAPH, NULL, - GDK_j, GEANY_PRIMARY_MOD_MASK, "format_reflowparagraph", _("_Reflow Lines/Block"), + GDK_KEY_j, GEANY_PRIMARY_MOD_MASK, "format_reflowparagraph", _("_Reflow Lines/Block"), "reflow_lines_block1"); keybindings_set_item(group, GEANY_KEYS_FORMAT_JOINLINES, NULL, 0, 0, "edit_joinlines", _("Join lines"), NULL);
group = keybindings_get_core_group(GEANY_KEY_GROUP_INSERT);
add_kb(group, GEANY_KEYS_INSERT_DATE, NULL, - GDK_d, GDK_SHIFT_MASK | GDK_MOD1_MASK, "menu_insert_date", _("Insert date"), + GDK_KEY_d, GDK_SHIFT_MASK | GDK_MOD1_MASK, "menu_insert_date", _("Insert date"), "insert_date_custom1"); add_kb(group, GEANY_KEYS_INSERT_ALTWHITESPACE, NULL, 0, 0, "edit_insertwhitespace", _("Insert Alternative _White Space"), @@ -520,116 +519,116 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_SETTINGS);
add_kb(group, GEANY_KEYS_SETTINGS_PREFERENCES, cb_func_menu_preferences, - GDK_p, GEANY_PRIMARY_MOD_MASK | GDK_MOD1_MASK, "menu_preferences", _("Preferences"), + GDK_KEY_p, GEANY_PRIMARY_MOD_MASK | GDK_MOD1_MASK, "menu_preferences", _("Preferences"), "preferences1"); add_kb(group, GEANY_KEYS_SETTINGS_PLUGINPREFERENCES, cb_func_menu_preferences, 0, 0, "menu_pluginpreferences", _("P_lugin Preferences"), "plugin_preferences1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_SEARCH);
add_kb(group, GEANY_KEYS_SEARCH_FIND, NULL, - GDK_f, GEANY_PRIMARY_MOD_MASK, "menu_find", _("Find"), "find1"); + GDK_KEY_f, GEANY_PRIMARY_MOD_MASK, "menu_find", _("Find"), "find1"); add_kb(group, GEANY_KEYS_SEARCH_FINDNEXT, NULL, - GDK_g, GEANY_PRIMARY_MOD_MASK, "menu_findnext", _("Find Next"), "find_next1"); + GDK_KEY_g, GEANY_PRIMARY_MOD_MASK, "menu_findnext", _("Find Next"), "find_next1"); add_kb(group, GEANY_KEYS_SEARCH_FINDPREVIOUS, NULL, - GDK_g, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "menu_findprevious", _("Find Previous"), + GDK_KEY_g, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "menu_findprevious", _("Find Previous"), "find_previous1"); add_kb(group, GEANY_KEYS_SEARCH_FINDNEXTSEL, NULL, 0, 0, "menu_findnextsel", _("Find Next _Selection"), "find_nextsel1"); add_kb(group, GEANY_KEYS_SEARCH_FINDPREVSEL, NULL, 0, 0, "menu_findprevsel", _("Find Pre_vious Selection"), "find_prevsel1"); add_kb(group, GEANY_KEYS_SEARCH_REPLACE, NULL, - GDK_h, GEANY_PRIMARY_MOD_MASK, "menu_replace", _("Replace"), "replace1"); - add_kb(group, GEANY_KEYS_SEARCH_FINDINFILES, NULL, GDK_f, + GDK_KEY_h, GEANY_PRIMARY_MOD_MASK, "menu_replace", _("Replace"), "replace1"); + add_kb(group, GEANY_KEYS_SEARCH_FINDINFILES, NULL, GDK_KEY_f, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "menu_findinfiles", _("Find in Files"), "find_in_files1"); add_kb(group, GEANY_KEYS_SEARCH_NEXTMESSAGE, NULL, 0, 0, "menu_nextmessage", _("Next Message"), "next_message1"); add_kb(group, GEANY_KEYS_SEARCH_PREVIOUSMESSAGE, NULL, 0, 0, "menu_previousmessage", _("Previous Message"), "previous_message1"); add_kb(group, GEANY_KEYS_SEARCH_FINDUSAGE, NULL, - GDK_e, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_findusage", + GDK_KEY_e, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_findusage", _("Find Usage"), "find_usage1"); add_kb(group, GEANY_KEYS_SEARCH_FINDDOCUMENTUSAGE, NULL, - GDK_d, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_finddocumentusage", + GDK_KEY_d, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_finddocumentusage", _("Find Document Usage"), "find_document_usage1"); add_kb(group, GEANY_KEYS_SEARCH_MARKALL, NULL, - GDK_m, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "find_markall", _("_Mark All"), "mark_all1"); + GDK_KEY_m, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "find_markall", _("_Mark All"), "mark_all1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_GOTO);
add_kb(group, GEANY_KEYS_GOTO_BACK, NULL, - GDK_Left, GDK_MOD1_MASK, "nav_back", _("Navigate back a location"), NULL); + GDK_KEY_Left, GDK_MOD1_MASK, "nav_back", _("Navigate back a location"), NULL); add_kb(group, GEANY_KEYS_GOTO_FORWARD, NULL, - GDK_Right, GDK_MOD1_MASK, "nav_forward", _("Navigate forward a location"), NULL); + GDK_KEY_Right, GDK_MOD1_MASK, "nav_forward", _("Navigate forward a location"), NULL); add_kb(group, GEANY_KEYS_GOTO_LINE, NULL, - GDK_l, GEANY_PRIMARY_MOD_MASK, "menu_gotoline", _("Go to Line"), "go_to_line1"); + GDK_KEY_l, GEANY_PRIMARY_MOD_MASK, "menu_gotoline", _("Go to Line"), "go_to_line1"); add_kb(group, GEANY_KEYS_GOTO_MATCHINGBRACE, NULL, - GDK_b, GEANY_PRIMARY_MOD_MASK, "edit_gotomatchingbrace", + GDK_KEY_b, GEANY_PRIMARY_MOD_MASK, "edit_gotomatchingbrace", _("Go to matching brace"), NULL); add_kb(group, GEANY_KEYS_GOTO_TOGGLEMARKER, NULL, - GDK_m, GEANY_PRIMARY_MOD_MASK, "edit_togglemarker", + GDK_KEY_m, GEANY_PRIMARY_MOD_MASK, "edit_togglemarker", _("Toggle marker"), NULL); add_kb(group, GEANY_KEYS_GOTO_NEXTMARKER, NULL, - GDK_period, GEANY_PRIMARY_MOD_MASK, "edit_gotonextmarker", + GDK_KEY_period, GEANY_PRIMARY_MOD_MASK, "edit_gotonextmarker", _("Go to Ne_xt Marker"), "go_to_next_marker1"); add_kb(group, GEANY_KEYS_GOTO_PREVIOUSMARKER, NULL, - GDK_comma, GEANY_PRIMARY_MOD_MASK, "edit_gotopreviousmarker", + GDK_KEY_comma, GEANY_PRIMARY_MOD_MASK, "edit_gotopreviousmarker", _("Go to Pre_vious Marker"), "go_to_previous_marker1"); add_kb(group, GEANY_KEYS_GOTO_TAGDEFINITION, NULL, - GDK_t, GEANY_PRIMARY_MOD_MASK, "popup_gototagdefinition", + GDK_KEY_t, GEANY_PRIMARY_MOD_MASK, "popup_gototagdefinition", _("Go to Symbol Definition"), "goto_tag_definition1"); add_kb(group, GEANY_KEYS_GOTO_TAGDECLARATION, NULL, - GDK_t, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_gototagdeclaration", + GDK_KEY_t, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "popup_gototagdeclaration", _("Go to Symbol Declaration"), "goto_tag_declaration1"); add_kb(group, GEANY_KEYS_GOTO_LINESTART, NULL, - GDK_Home, 0, "edit_gotolinestart", _("Go to Start of Line"), NULL); + GDK_KEY_Home, 0, "edit_gotolinestart", _("Go to Start of Line"), NULL); add_kb(group, GEANY_KEYS_GOTO_LINEEND, NULL, - GDK_End, 0, "edit_gotolineend", _("Go to End of Line"), NULL); + GDK_KEY_End, 0, "edit_gotolineend", _("Go to End of Line"), NULL); add_kb(group, GEANY_KEYS_GOTO_LINESTARTVISUAL, NULL, - GDK_Home, GDK_MOD1_MASK, "edit_gotolinestartvisual", _("Go to Start of Display Line"), NULL); + GDK_KEY_Home, GDK_MOD1_MASK, "edit_gotolinestartvisual", _("Go to Start of Display Line"), NULL); add_kb(group, GEANY_KEYS_GOTO_LINEENDVISUAL, NULL, - GDK_End, GDK_MOD1_MASK, "edit_gotolineendvisual", _("Go to End of Display Line"), NULL); + GDK_KEY_End, GDK_MOD1_MASK, "edit_gotolineendvisual", _("Go to End of Display Line"), NULL); add_kb(group, GEANY_KEYS_GOTO_PREVWORDPART, NULL, - GDK_slash, GEANY_PRIMARY_MOD_MASK, "edit_prevwordstart", _("Go to Previous Word Part"), NULL); + GDK_KEY_slash, GEANY_PRIMARY_MOD_MASK, "edit_prevwordstart", _("Go to Previous Word Part"), NULL); add_kb(group, GEANY_KEYS_GOTO_NEXTWORDPART, NULL, - GDK_backslash, GEANY_PRIMARY_MOD_MASK, "edit_nextwordstart", _("Go to Next Word Part"), NULL); + GDK_KEY_backslash, GEANY_PRIMARY_MOD_MASK, "edit_nextwordstart", _("Go to Next Word Part"), NULL);
group = keybindings_get_core_group(GEANY_KEY_GROUP_VIEW);
add_kb(group, GEANY_KEYS_VIEW_TOGGLEALL, NULL, 0, 0, "menu_toggleall", _("Toggle All Additional Widgets"), "menu_toggle_all_additional_widgets1"); add_kb(group, GEANY_KEYS_VIEW_FULLSCREEN, cb_func_menu_fullscreen, - GDK_F11, 0, "menu_fullscreen", _("Fullscreen"), "menu_fullscreen1"); + GDK_KEY_F11, 0, "menu_fullscreen", _("Fullscreen"), "menu_fullscreen1"); add_kb(group, GEANY_KEYS_VIEW_MESSAGEWINDOW, cb_func_menu_messagewindow, 0, 0, "menu_messagewindow", _("Toggle Messages Window"), "menu_show_messages_window1"); add_kb(group, GEANY_KEYS_VIEW_SIDEBAR, NULL, 0, 0, "toggle_sidebar", _("Toggle Sidebar"), "menu_show_sidebar1"); add_kb(group, GEANY_KEYS_VIEW_ZOOMIN, NULL, - GDK_plus, GEANY_PRIMARY_MOD_MASK, "menu_zoomin", _("Zoom In"), "menu_zoom_in1"); + GDK_KEY_plus, GEANY_PRIMARY_MOD_MASK, "menu_zoomin", _("Zoom In"), "menu_zoom_in1"); add_kb(group, GEANY_KEYS_VIEW_ZOOMOUT, NULL, - GDK_minus, GEANY_PRIMARY_MOD_MASK, "menu_zoomout", _("Zoom Out"), "menu_zoom_out1"); + GDK_KEY_minus, GEANY_PRIMARY_MOD_MASK, "menu_zoomout", _("Zoom Out"), "menu_zoom_out1"); add_kb(group, GEANY_KEYS_VIEW_ZOOMRESET, NULL, - GDK_0, GEANY_PRIMARY_MOD_MASK, "normal_size", _("Zoom Reset"), "normal_size1"); + GDK_KEY_0, GEANY_PRIMARY_MOD_MASK, "normal_size", _("Zoom Reset"), "normal_size1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_FOCUS);
add_kb(group, GEANY_KEYS_FOCUS_EDITOR, NULL, - GDK_F2, 0, "switch_editor", _("Switch to Editor"), NULL); + GDK_KEY_F2, 0, "switch_editor", _("Switch to Editor"), NULL); add_kb(group, GEANY_KEYS_FOCUS_SEARCHBAR, NULL, - GDK_F7, 0, "switch_search_bar", _("Switch to Search Bar"), NULL); + GDK_KEY_F7, 0, "switch_search_bar", _("Switch to Search Bar"), NULL); add_kb(group, GEANY_KEYS_FOCUS_MESSAGE_WINDOW, NULL, 0, 0, "switch_message_window", _("Switch to Message Window"), NULL); add_kb(group, GEANY_KEYS_FOCUS_COMPILER, NULL, 0, 0, "switch_compiler", _("Switch to Compiler"), NULL); add_kb(group, GEANY_KEYS_FOCUS_MESSAGES, NULL, 0, 0, "switch_messages", _("Switch to Messages"), NULL); add_kb(group, GEANY_KEYS_FOCUS_SCRIBBLE, NULL, - GDK_F6, 0, "switch_scribble", _("Switch to Scribble"), NULL); + GDK_KEY_F6, 0, "switch_scribble", _("Switch to Scribble"), NULL); add_kb(group, GEANY_KEYS_FOCUS_VTE, NULL, - GDK_F4, 0, "switch_vte", _("Switch to VTE"), NULL); + GDK_KEY_F4, 0, "switch_vte", _("Switch to VTE"), NULL); add_kb(group, GEANY_KEYS_FOCUS_SIDEBAR, NULL, 0, 0, "switch_sidebar", _("Switch to Sidebar"), NULL); add_kb(group, GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST, NULL, @@ -640,16 +639,16 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_NOTEBOOK);
add_kb(group, GEANY_KEYS_NOTEBOOK_SWITCHTABLEFT, cb_func_switch_tableft, - GDK_Page_Up, GEANY_PRIMARY_MOD_MASK, "switch_tableft", _("Switch to left document"), NULL); + GDK_KEY_Page_Up, GEANY_PRIMARY_MOD_MASK, "switch_tableft", _("Switch to left document"), NULL); add_kb(group, GEANY_KEYS_NOTEBOOK_SWITCHTABRIGHT, cb_func_switch_tabright, - GDK_Page_Down, GEANY_PRIMARY_MOD_MASK, "switch_tabright", _("Switch to right document"), NULL); + GDK_KEY_Page_Down, GEANY_PRIMARY_MOD_MASK, "switch_tabright", _("Switch to right document"), NULL); add_kb(group, GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED, cb_func_switch_tablastused, - GDK_Tab, GEANY_PRIMARY_MOD_MASK, "switch_tablastused", _("Switch to last used document"), NULL); + GDK_KEY_Tab, GEANY_PRIMARY_MOD_MASK, "switch_tablastused", _("Switch to last used document"), NULL); add_kb(group, GEANY_KEYS_NOTEBOOK_MOVETABLEFT, cb_func_move_tab, - GDK_Page_Up, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "move_tableft", + GDK_KEY_Page_Up, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "move_tableft", _("Move document left"), NULL); add_kb(group, GEANY_KEYS_NOTEBOOK_MOVETABRIGHT, cb_func_move_tab, - GDK_Page_Down, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "move_tabright", + GDK_KEY_Page_Down, GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK, "move_tabright", _("Move document right"), NULL); add_kb(group, GEANY_KEYS_NOTEBOOK_MOVETABFIRST, cb_func_move_tab, 0, 0, "move_tabfirst", _("Move document first"), NULL); @@ -677,7 +676,7 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_DOCUMENT_UNFOLDALL, NULL, 0, 0, "menu_unfoldall", _("Unfold all"), "menu_unfold_all1"); add_kb(group, GEANY_KEYS_DOCUMENT_RELOADTAGLIST, NULL, - GDK_r, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "reloadtaglist", _("Reload symbol list"), NULL); + GDK_KEY_r, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "reloadtaglist", _("Reload symbol list"), NULL); add_kb(group, GEANY_KEYS_DOCUMENT_REMOVE_MARKERS, NULL, 0, 0, "remove_markers", _("Remove Markers"), "remove_markers1"); add_kb(group, GEANY_KEYS_DOCUMENT_REMOVE_ERROR_INDICATORS, NULL, @@ -688,22 +687,22 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_BUILD);
add_kb(group, GEANY_KEYS_BUILD_COMPILE, NULL, - GDK_F8, 0, "build_compile", _("Compile"), NULL); + GDK_KEY_F8, 0, "build_compile", _("Compile"), NULL); add_kb(group, GEANY_KEYS_BUILD_LINK, NULL, - GDK_F9, 0, "build_link", _("Build"), NULL); + GDK_KEY_F9, 0, "build_link", _("Build"), NULL); add_kb(group, GEANY_KEYS_BUILD_MAKE, NULL, - GDK_F9, GDK_SHIFT_MASK, "build_make", _("Make all"), NULL); + GDK_KEY_F9, GDK_SHIFT_MASK, "build_make", _("Make all"), NULL); add_kb(group, GEANY_KEYS_BUILD_MAKEOWNTARGET, NULL, - GDK_F9, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "build_makeowntarget", + GDK_KEY_F9, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "build_makeowntarget", _("Make custom target"), NULL); add_kb(group, GEANY_KEYS_BUILD_MAKEOBJECT, NULL, - GDK_F8, GDK_SHIFT_MASK, "build_makeobject", _("Make object"), NULL); + GDK_KEY_F8, GDK_SHIFT_MASK, "build_makeobject", _("Make object"), NULL); add_kb(group, GEANY_KEYS_BUILD_NEXTERROR, NULL, 0, 0, "build_nexterror", _("Next error"), NULL); add_kb(group, GEANY_KEYS_BUILD_PREVIOUSERROR, NULL, 0, 0, "build_previouserror", _("Previous error"), NULL); add_kb(group, GEANY_KEYS_BUILD_RUN, NULL, - GDK_F5, 0, "build_run", _("Run"), NULL); + GDK_KEY_F5, 0, "build_run", _("Run"), NULL); add_kb(group, GEANY_KEYS_BUILD_OPTIONS, NULL, 0, 0, "build_options", _("Build options"), NULL);
@@ -715,7 +714,7 @@ static void init_default_kb(void) group = keybindings_get_core_group(GEANY_KEY_GROUP_HELP);
add_kb(group, GEANY_KEYS_HELP_HELP, cb_func_menu_help, - GDK_F1, 0, "menu_help", _("Help"), "help1"); + GDK_KEY_F1, 0, "menu_help", _("Help"), "help1"); }
@@ -1090,13 +1089,13 @@ void keybindings_show_shortcuts(void) static gboolean check_fixed_kb(guint keyval, guint state) { /* check alt-0 to alt-9 for setting current notebook page */ - if (state == GDK_MOD1_MASK && keyval >= GDK_0 && keyval <= GDK_9) + if (state == GDK_MOD1_MASK && keyval >= GDK_KEY_0 && keyval <= GDK_KEY_9) { - gint page = keyval - GDK_0 - 1; + gint page = keyval - GDK_KEY_0 - 1; gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
/* alt-0 is for the rightmost tab */ - if (keyval == GDK_0) + if (keyval == GDK_KEY_0) page = npages - 1; /* invert the order if tabs are added on the other side */ if (swap_alt_tab_order && ! file_prefs.tab_order_ltr) @@ -1106,14 +1105,14 @@ static gboolean check_fixed_kb(guint keyval, guint state) return TRUE; } /* note: these are now overridden by default with move tab bindings */ - if (keyval == GDK_Page_Up || keyval == GDK_Page_Down) + if (keyval == GDK_KEY_Page_Up || keyval == GDK_KEY_Page_Down) { /* switch to first or last document */ if (state == (GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK)) { - if (keyval == GDK_Page_Up) + if (keyval == GDK_KEY_Page_Up) gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), 0); - if (keyval == GDK_Page_Down) + if (keyval == GDK_KEY_Page_Down) gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), -1); return TRUE; } @@ -1173,7 +1172,7 @@ static gboolean check_menu_key(GeanyDocument *doc, guint keyval, guint state, gu { g_return_val_if_fail(doc == NULL || doc->is_valid, FALSE);
- if ((keyval == GDK_Menu && state == 0) || (keyval == GDK_F10 && state == GDK_SHIFT_MASK)) + if ((keyval == GDK_KEY_Menu && state == 0) || (keyval == GDK_KEY_F10 && state == GDK_SHIFT_MASK)) { GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); if (doc != NULL) @@ -1185,7 +1184,7 @@ static gboolean check_menu_key(GeanyDocument *doc, guint keyval, guint state, gu } if (focusw == GTK_WIDGET(doc->editor->sci)) { - if (keyval == GDK_Menu) + if (keyval == GDK_KEY_Menu) { /* show editor popup menu */ trigger_button_event(focusw, event_time); return TRUE; @@ -1233,14 +1232,14 @@ static gboolean check_vte(GdkModifierType state, guint keyval) if (gtk_window_get_focus(GTK_WINDOW(main_widgets.window)) != vc->vte) return FALSE; /* let VTE copy/paste override any user keybinding */ - if (state == (GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK) && (keyval == GDK_c || keyval == GDK_v)) + if (state == (GEANY_PRIMARY_MOD_MASK | GDK_SHIFT_MASK) && (keyval == GDK_KEY_c || keyval == GDK_KEY_v)) return TRUE; if (! vc->enable_bash_keys) return FALSE; /* prevent menubar flickering: */ - if (state == GDK_SHIFT_MASK && (keyval >= GDK_a && keyval <= GDK_z)) + if (state == GDK_SHIFT_MASK && (keyval >= GDK_KEY_a && keyval <= GDK_KEY_z)) return FALSE; - if (state == 0 && (keyval < GDK_F1 || keyval > GDK_F35)) /* e.g. backspace */ + if (state == 0 && (keyval < GDK_KEY_F1 || keyval > GDK_KEY_F35)) /* e.g. backspace */ return FALSE;
/* make focus commands override any bash commands */ @@ -1271,26 +1270,26 @@ static guint key_kp_translate(guint key_in) { switch (key_in) { - case GDK_KP_Down: - return GDK_Down; - case GDK_KP_Up: - return GDK_Up; - case GDK_KP_Left: - return GDK_Left; - case GDK_KP_Right: - return GDK_Right; - case GDK_KP_Home: - return GDK_Home; - case GDK_KP_End: - return GDK_End; - case GDK_KP_Page_Up: - return GDK_Page_Up; - case GDK_KP_Page_Down: - return GDK_Page_Down; - case GDK_KP_Delete: - return GDK_Delete; - case GDK_KP_Insert: - return GDK_Insert; + case GDK_KEY_KP_Down: + return GDK_KEY_Down; + case GDK_KEY_KP_Up: + return GDK_KEY_Up; + case GDK_KEY_KP_Left: + return GDK_KEY_Left; + case GDK_KEY_KP_Right: + return GDK_KEY_Right; + case GDK_KEY_KP_Home: + return GDK_KEY_Home; + case GDK_KEY_KP_End: + return GDK_KEY_End; + case GDK_KEY_KP_Page_Up: + return GDK_KEY_Page_Up; + case GDK_KEY_KP_Page_Down: + return GDK_KEY_Page_Down; + case GDK_KEY_KP_Delete: + return GDK_KEY_Delete; + case GDK_KEY_KP_Insert: + return GDK_KEY_Insert; default: return key_in; } @@ -1307,12 +1306,12 @@ gboolean keybindings_check_event(GdkEventKey *ev, GeanyKeyBinding *kb)
keyval = ev->keyval; state = keybindings_get_modifiers(ev->state); - /* hack to get around that CTRL+Shift+r results in GDK_R not GDK_r */ + /* hack to get around that CTRL+Shift+r results in GDK_KEY_R not GDK_KEY_r */ if ((ev->state & GDK_SHIFT_MASK) || (ev->state & GDK_LOCK_MASK)) - if (keyval >= GDK_A && keyval <= GDK_Z) - keyval += GDK_a - GDK_A; + if (keyval >= GDK_KEY_A && keyval <= GDK_KEY_Z) + keyval += GDK_KEY_a - GDK_KEY_A;
- if (keyval >= GDK_KP_Space && keyval < GDK_KP_Equal) + if (keyval >= GDK_KEY_KP_Space && keyval < GDK_KEY_KP_Equal) keyval = key_kp_translate(keyval);
return (keyval == kb->key && state == kb->mods); @@ -1366,12 +1365,12 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
keyval = ev->keyval; state = keybindings_get_modifiers(ev->state); - /* hack to get around that CTRL+Shift+r results in GDK_R not GDK_r */ + /* hack to get around that CTRL+Shift+r results in GDK_KEY_R not GDK_KEY_r */ if ((ev->state & GDK_SHIFT_MASK) || (ev->state & GDK_LOCK_MASK)) - if (keyval >= GDK_A && keyval <= GDK_Z) - keyval += GDK_a - GDK_A; + if (keyval >= GDK_KEY_A && keyval <= GDK_KEY_Z) + keyval += GDK_KEY_a - GDK_KEY_A;
- if (keyval >= GDK_KP_Space && keyval < GDK_KP_Equal) + if (keyval >= GDK_KEY_KP_Space && keyval < GDK_KEY_KP_Equal) keyval = key_kp_translate(keyval);
/*geany_debug("%d (%d) %d (%d)", keyval, ev->keyval, state, ev->state);*/ @@ -2162,10 +2161,10 @@ static gboolean cb_func_editor_action(guint key_id)
switch (kb->key) { - case GDK_space: + case GDK_KEY_space: sci_add_text(doc->editor->sci, " "); break; - case GDK_Tab: + case GDK_KEY_Tab: sci_send_command(doc->editor->sci, SCI_TAB); break; default:
Modified: src/keybindings.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -73,7 +73,7 @@ typedef gboolean (*GeanyKeyBindingFunc)(GeanyKeyBinding *key, guint key_id, gpoi * Use keybindings_set_item() to set. */ struct GeanyKeyBinding { - guint key; /**< Key value in lower-case, such as @c GDK_a or 0 */ + guint key; /**< Key value in lower-case, such as @c GDK_KEY_a or 0 */ GdkModifierType mods; /**< Modifier keys, such as @c GDK_CONTROL_MASK or 0 */ gchar *name; /**< Key name for the configuration file, such as @c "menu_new" */ /** Label used in the preferences dialog keybindings tab.
Modified: src/libmain.c 55 lines changed, 3 insertions(+), 52 deletions(-) =================================================================== @@ -63,8 +63,6 @@ #include "win32.h" #include "osx.h"
-#include "gtkcompat.h" - #include <signal.h> #include <time.h> #include <sys/types.h> @@ -73,6 +71,7 @@ #include <string.h> #include <stdlib.h>
+#include <gtk/gtk.h> #include <glib/gstdio.h>
#ifdef G_OS_UNIX @@ -290,7 +289,7 @@ static void main_init(void) osx_ui_init(); #endif
- /* set widget names for matching with .gtkrc-2.0 */ + /* set widget names for matching with GTK CSS */ gtk_widget_set_name(main_widgets.window, "GeanyMainWindow"); gtk_widget_set_name(ui_widgets.toolbar_menu, "GeanyToolbarMenu"); gtk_widget_set_name(main_widgets.editor_menu, "GeanyEditMenu"); @@ -1007,52 +1006,6 @@ static const gchar *get_locale(void) }
-#if ! GTK_CHECK_VERSION(3, 0, 0) -/* This prepends our own gtkrc file to the list of RC files to be loaded by GTK at startup. - * This function *has* to be called before gtk_init(). - * - * We have a custom RC file defining various styles we need, and we want the user to be - * able to override them (e.g. if they want -- or need -- other colors). Fair enough, one - * would simply call gtk_rc_parse() with the appropriate filename. However, the styling - * rules applies in the order they are loaded, then if we load our styles after GTK has - * loaded the user's ones we'd override them. - * - * There are 2 solutions to fix this: - * 1) set our styles' priority to something with lower than "user" (actually "theme" - * priority because rules precedence are first calculated depending on the priority - * no matter of how precise the rules is, so we need to override the theme). - * 2) prepend our custom style to GTK's list while keeping priority to user (which is the - * default), so it gets loaded before real user's ones and so gets overridden by them. - * - * One would normally go for 1 because it's ways simpler and requires less code: you just - * have to add the priorities to your styles, which is a matter of adding a few ":theme" in - * the RC file. However, KDE being a bitch it doesn't set the gtk-theme-name but rather - * directly includes the style to use in a user gtkrc file, which makes the theme have - * "user" priority, hence overriding our styles. So, we cannot set priorities in the RC - * file if we want to support running under KDE, which pretty much leave us with no choice - * but to go with solution 2, which unfortunately requires writing ugly code since GTK - * don't have a gtk_rc_prepend_default_file() function. Thank you very much KDE. - * - * Though, as a side benefit it also makes the code work with people using gtk-chtheme, - * which also found it funny to include the theme in the user RC file. */ -static void setup_gtk2_styles(void) -{ - gchar **gtk_files = gtk_rc_get_default_files(); - gchar **new_files = g_malloc(sizeof *new_files * (g_strv_length(gtk_files) + 2)); - guint i = 0; - - new_files[i++] = g_build_filename(app->datadir, "geany.gtkrc", NULL); - for (; *gtk_files; gtk_files++) - new_files[i++] = g_strdup(*gtk_files); - new_files[i] = NULL; - - gtk_rc_set_default_files(new_files); - - g_strfreev(new_files); -} -#endif - - GEANY_EXPORT_SYMBOL gint main_lib(gint argc, gchar **argv) { @@ -1081,9 +1034,7 @@ gint main_lib(gint argc, gchar **argv) memset(&ui_widgets, 0, sizeof(UIWidgets));
setup_paths(); -#if ! GTK_CHECK_VERSION(3, 0, 0) - setup_gtk2_styles(); -#endif + #ifdef ENABLE_NLS main_locale_init(utils_resource_dir(RESOURCE_DIR_LOCALE), GETTEXT_PACKAGE); #endif
Modified: src/log.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -33,7 +33,7 @@ #include "utils.h" #include "ui_utils.h"
-#include "gtkcompat.h" +#include <gtk/gtk.h>
#ifdef HAVE_LOCALE_H # include <locale.h>
Modified: src/msgwindow.c 12 lines changed, 1 insertions(+), 11 deletions(-) =================================================================== @@ -120,7 +120,6 @@ void msgwin_set_messages_dir(const gchar *messages_dir)
static void load_color(const gchar *color_name, GdkColor *color) { -#if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA rgba_color; GtkWidgetPath *path = gtk_widget_path_new(); GtkStyleContext *ctx = gtk_style_context_new(); @@ -137,15 +136,6 @@ static void load_color(const gchar *color_name, GdkColor *color)
gtk_widget_path_unref(path); g_object_unref(ctx); -#else - gchar *path = g_strconcat("*.", color_name, NULL); - - GtkSettings *settings = gtk_settings_get_default(); - GtkStyle *style = gtk_rc_get_style_by_paths(settings, path, NULL, GTK_TYPE_WIDGET); - *color = style->fg[GTK_STATE_NORMAL]; - - g_free(path); -#endif }
@@ -184,7 +174,7 @@ static gboolean on_msgwin_key_press_event(GtkWidget *widget, GdkEventKey *event, { gboolean enter_or_return = ui_is_keyval_enter_or_return(event->keyval);
- if (enter_or_return || event->keyval == GDK_space) + if (enter_or_return || event->keyval == GDK_KEY_space) { switch (GPOINTER_TO_INT(data)) {
Modified: src/navqueue.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -34,7 +34,7 @@ #include "toolbar.h" #include "utils.h"
-#include "gtkcompat.h" +#include <gtk/gtk.h>
/* for the navigation history queue */
Modified: src/notebook.c 33 lines changed, 16 insertions(+), 17 deletions(-) =================================================================== @@ -37,8 +37,7 @@ #include "ui_utils.h" #include "utils.h"
-#include "gtkcompat.h" - +#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h>
@@ -148,18 +147,18 @@ static gboolean is_modifier_key(guint keyval) { switch (keyval) { - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_Super_L: - case GDK_Super_R: - case GDK_Hyper_L: - case GDK_Hyper_R: + case GDK_KEY_Shift_L: + case GDK_KEY_Shift_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: + case GDK_KEY_Meta_L: + case GDK_KEY_Meta_R: + case GDK_KEY_Alt_L: + case GDK_KEY_Alt_R: + case GDK_KEY_Super_L: + case GDK_KEY_Super_R: + case GDK_KEY_Hyper_L: + case GDK_KEY_Hyper_R: return TRUE; default: return FALSE; @@ -199,7 +198,7 @@ static GtkWidget *create_switch_dialog(void) gtk_window_set_decorated(GTK_WINDOW(dialog), FALSE); gtk_window_set_default_size(GTK_WINDOW(dialog), 200, -1);
- vbox = gtk_vbox_new(FALSE, 6); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); gtk_container_add(GTK_CONTAINER(dialog), vbox);
@@ -679,7 +678,7 @@ gint notebook_new_tab(GeanyDocument *this) g_return_val_if_fail(this != NULL, -1);
/* page is packed into a vbox so we can stack infobars above it */ - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); page = GTK_WIDGET(this->editor->sci); gtk_box_pack_start(GTK_BOX(vbox), page, TRUE, TRUE, 0);
@@ -694,7 +693,7 @@ gint notebook_new_tab(GeanyDocument *this) g_signal_connect_after(ebox, "button-release-event", G_CALLBACK(focus_sci), NULL);
- hbox = gtk_hbox_new(FALSE, 2); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start(GTK_BOX(hbox), this->priv->tab_label, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(ebox), hbox);
Modified: src/plugindata.h 11 lines changed, 4 insertions(+), 7 deletions(-) =================================================================== @@ -60,13 +60,10 @@ G_BEGIN_DECLS */ #define GEANY_API_VERSION 239
-/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins - * with GTK3-linked Geany leads to crash */ -#if GTK_CHECK_VERSION(3, 0, 0) -# define GEANY_ABI_SHIFT 8 -#else -# define GEANY_ABI_SHIFT 0 -#endif +/* hack to have a different ABI when built with different GTK major versions + * because loading plugins linked to a different one leads to crashes. + * Only GTK3 is currently supported. */ +#define GEANY_ABI_SHIFT 8 /** The Application Binary Interface (ABI) version, incremented whenever * existing fields in the plugin data types have to be changed or reordered. * Changing this forces all plugins to be recompiled before Geany can load them. */
Modified: src/pluginprivate.h 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -26,8 +26,6 @@ #include "ui_utils.h" /* GeanyAutoSeparator */ #include "keybindings.h" /* GeanyKeyGroup */
-#include "gtkcompat.h" -
G_BEGIN_DECLS
Modified: src/plugins.c 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -54,8 +54,7 @@ #include "utils.h" #include "win32.h"
-#include "gtkcompat.h" - +#include <gtk/gtk.h> #include <string.h>
@@ -1997,7 +1996,7 @@ static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data) pm_widgets.popup_help_menu_item = menu_item;
/* put it together */ - vbox2 = gtk_vbox_new(FALSE, 6); + vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox2), filter_entry, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox2), swin, TRUE, TRUE, 0);
Modified: src/pluginutils.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -395,7 +395,7 @@ static GtkWidget *create_pref_page(Plugin *p, GtkWidget *dialog)
gtk_alignment_set_padding(GTK_ALIGNMENT(align), 6, 6, 6, 6); gtk_container_add(GTK_CONTAINER(align), page); - page = gtk_vbox_new(FALSE, 0); + page = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start(GTK_BOX(page), align, TRUE, TRUE, 0); } }
Modified: src/prefs.c 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -57,10 +57,9 @@ #include "vte.h" #include "osx.h"
-#include "gtkcompat.h" - #include <stdlib.h> #include <string.h> +#include <gtk/gtk.h> #include <gdk/gdkkeysyms.h>
@@ -1420,7 +1419,7 @@ static gboolean kb_grab_key_dialog_key_press_cb(GtkWidget *dialog, GdkEventKey *
state = keybindings_get_modifiers(event->state);
- if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) return FALSE; /* close the dialog, don't allow escape when detecting keybindings. */
str = gtk_accelerator_name(event->keyval, state);
Modified: src/printing.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -231,7 +231,7 @@ static GtkWidget *create_custom_widget(GtkPrintOperation *operation, gpointer us
gtk_print_operation_set_custom_tab_label(operation, _("Document Setup"));
- page = gtk_vbox_new(FALSE, 0); + page = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width(GTK_CONTAINER(page), 5);
w->check_print_linenumbers = gtk_check_button_new_with_mnemonic(_("Print line numbers")); @@ -259,15 +259,15 @@ static GtkWidget *create_custom_widget(GtkPrintOperation *operation, gpointer us gtk_container_add(GTK_CONTAINER(frame33), alignment36); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment36), 0, 0, 12, 0);
- vbox30 = gtk_vbox_new(FALSE, 1); + vbox30 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1); gtk_container_add(GTK_CONTAINER(alignment36), vbox30);
w->check_print_basename = gtk_check_button_new_with_mnemonic(_("Use the basename of the printed file")); gtk_box_pack_start(GTK_BOX(vbox30), w->check_print_basename, FALSE, FALSE, 0); gtk_widget_set_tooltip_text(w->check_print_basename, _("Print only the basename(without the path) of the printed file")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w->check_print_basename), printing_prefs.page_header_basename);
- hbox10 = gtk_hbox_new(FALSE, 5); + hbox10 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5); gtk_box_pack_start(GTK_BOX(vbox30), hbox10, TRUE, TRUE, 0);
label203 = gtk_label_new(_("Date format:"));
Modified: src/project.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -195,7 +195,7 @@ void project_new(void) g_signal_connect(button, "clicked", G_CALLBACK(on_file_save_button_clicked), &e); image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON); gtk_container_add(GTK_CONTAINER(button), image); - bbox = gtk_hbox_new(FALSE, 6); + bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(bbox), e.file_name, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
Modified: src/search.c 36 lines changed, 18 insertio@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).