Branch: refs/heads/gtk3-support Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 08 Oct 2012 18:08:07 UTC Commit: c5985f0cd172f6196c0966eaa14e4c7ea5799391 https://github.com/geany/geany/commit/c5985f0cd172f6196c0966eaa14e4c7ea57993...
Log Message: ----------- Add ::draw handler for GTK3 where we have ::expose-event handlers
Modified Paths: -------------- src/editor.c src/keybindings.c src/sidebar.c
Modified: src/editor.c 12 files changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -4625,6 +4625,14 @@ 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 */ @@ -4710,7 +4718,11 @@ 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/keybindings.c 12 files changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -1068,6 +1068,14 @@ static gboolean on_menu_expose_event(GtkWidget *widget, GdkEventExpose *event, }
+#if GTK_CHECK_VERSION(3, 0, 0) +static gboolean on_menu_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data) +{ + return on_menu_expose_event(widget, NULL, user_data); +} +#endif + + static gboolean set_sensitive(gpointer widget) { gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE); @@ -1112,7 +1120,11 @@ static gboolean check_vte(GdkModifierType state, guint keyval) /* make the menubar sensitive before it is redrawn */ static gboolean connected = FALSE; if (!connected) +#if GTK_CHECK_VERSION(3, 0, 0) + g_signal_connect(widget, "draw", G_CALLBACK(on_menu_draw), NULL); +#else g_signal_connect(widget, "expose-event", G_CALLBACK(on_menu_expose_event), NULL); +#endif }
widget = main_widgets.editor_menu;
Modified: src/sidebar.c 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -588,16 +588,24 @@ void sidebar_add_common_menu_items(GtkMenu *menu)
item = gtk_check_menu_item_new_with_mnemonic(_("Show S_ymbol List")); gtk_container_add(GTK_CONTAINER(menu), item); +#if GTK_CHECK_VERSION(3, 0, 0) + g_signal_connect(item, "draw", G_CALLBACK(on_sidebar_display_symbol_list_show), NULL); +#else g_signal_connect(item, "expose-event", G_CALLBACK(on_sidebar_display_symbol_list_show), NULL); +#endif gtk_widget_show(item); g_signal_connect(item, "activate", G_CALLBACK(on_list_symbol_activate), NULL);
item = gtk_check_menu_item_new_with_mnemonic(_("Show _Document List")); gtk_container_add(GTK_CONTAINER(menu), item); +#if GTK_CHECK_VERSION(3, 0, 0) + g_signal_connect(item, "draw", G_CALLBACK(on_sidebar_display_open_files_show), NULL); +#else g_signal_connect(item, "expose-event", G_CALLBACK(on_sidebar_display_open_files_show), NULL); +#endif gtk_widget_show(item); g_signal_connect(item, "activate", G_CALLBACK(on_list_document_activate), NULL);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).