[Xfce4-commits] [apps/mousepad] 05/11: Make it compile with GTK3

noreply at xfce.org noreply at xfce.org
Sat Jul 19 13:54:47 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit 053c6c59e6e4a395e17d8a41204925b3d7bff18e
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Wed Jul 16 02:06:08 2014 -0700

    Make it compile with GTK3
    
    And various other fixups from previous commits.
---
 mousepad/mousepad-action-group.c        |   31 ++++++++++++++++---------------
 mousepad/mousepad-document.c            |    5 +++--
 mousepad/mousepad-encoding-dialog.c     |    1 +
 mousepad/mousepad-file.c                |    7 ++++---
 mousepad/mousepad-gtkcompat.h           |   17 +++++++++++++++++
 mousepad/mousepad-language-action.c     |    9 +++++----
 mousepad/mousepad-print.c               |    4 +++-
 mousepad/mousepad-replace-dialog.c      |   22 +++++++++++-----------
 mousepad/mousepad-statusbar.c           |    2 ++
 mousepad/mousepad-style-scheme-action.c |    7 ++++---
 mousepad/mousepad-util.c                |    2 +-
 mousepad/mousepad-view.c                |    9 +++++----
 mousepad/mousepad-window.c              |   12 ++++++++----
 13 files changed, 80 insertions(+), 48 deletions(-)

diff --git a/mousepad/mousepad-action-group.c b/mousepad/mousepad-action-group.c
index 8362ea8..156ebbb 100644
--- a/mousepad/mousepad-action-group.c
+++ b/mousepad/mousepad-action-group.c
@@ -16,6 +16,7 @@
 
 #include <mousepad/mousepad-private.h>
 #include <mousepad/mousepad-action-group.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-language-action.h>
 #include <mousepad/mousepad-style-scheme-action.h>
 #include <mousepad/mousepad-settings.h>
@@ -124,7 +125,7 @@ mousepad_action_group_class_init (MousepadActionGroupClass *klass)
                 0, NULL, NULL,
                 g_cclosure_marshal_VOID__OBJECT,
                 G_TYPE_NONE, 0,
-                GTK_TYPE_SOURCE_LANGUAGE);
+                GTK_SOURCE_TYPE_LANGUAGE);
 }
 
 
@@ -138,10 +139,10 @@ mousepad_action_group_finalize (GObject *object)
 
   self = MOUSEPAD_ACTION_GROUP (object);
 
-  if (GTK_IS_SOURCE_LANGUAGE (self->active_language))
+  if (GTK_SOURCE_IS_LANGUAGE (self->active_language))
     g_object_unref (self->active_language);
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (self->active_scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (self->active_scheme))
     g_object_unref (self->active_scheme);
 
   G_OBJECT_CLASS (mousepad_action_group_parent_class)->finalize (object);
@@ -248,10 +249,10 @@ mousepad_action_group_set_active_language (MousepadActionGroup *self,
 
   g_return_if_fail (MOUSEPAD_IS_ACTION_GROUP (self));
 
-  if (GTK_IS_SOURCE_LANGUAGE (self->active_language))
+  if (GTK_SOURCE_IS_LANGUAGE (self->active_language))
     g_object_unref (self->active_language);
 
-  if (GTK_IS_SOURCE_LANGUAGE (language))
+  if (GTK_SOURCE_IS_LANGUAGE (language))
     self->active_language = g_object_ref (language);
   else
     self->active_language = NULL;
@@ -286,10 +287,10 @@ mousepad_action_group_set_active_style_scheme (MousepadActionGroup  *self,
 
   g_return_if_fail (MOUSEPAD_IS_ACTION_GROUP (self));
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (self->active_scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (self->active_scheme))
     g_object_unref (self->active_scheme);
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (scheme))
     self->active_scheme = g_object_ref (scheme);
   else
     self->active_scheme = NULL;
@@ -567,7 +568,7 @@ mousepad_action_group_get_language_action (MousepadActionGroup *self,
 
   g_return_val_if_fail (MOUSEPAD_IS_ACTION_GROUP (self), NULL);
 
-  if (GTK_IS_SOURCE_LANGUAGE (language))
+  if (GTK_SOURCE_IS_LANGUAGE (language))
     language_id = gtk_source_language_get_id (language);
   else
     language_id = "none";
@@ -587,9 +588,9 @@ mousepad_action_group_languages_name_compare (gconstpointer a,
 {
   const gchar *name_a, *name_b;
 
-  if (G_UNLIKELY (!GTK_IS_SOURCE_LANGUAGE (a)))
+  if (G_UNLIKELY (!GTK_SOURCE_IS_LANGUAGE (a)))
     return -(a != b);
-  if (G_UNLIKELY (!GTK_IS_SOURCE_LANGUAGE (b)))
+  if (G_UNLIKELY (!GTK_SOURCE_IS_LANGUAGE (b)))
     return a != b;
 
   name_a = gtk_source_language_get_name (GTK_SOURCE_LANGUAGE (a));
@@ -614,7 +615,7 @@ mousepad_action_group_get_sorted_section_names (void)
   while (*languages)
     {
       language = gtk_source_language_manager_get_language (manager, *languages);
-      if (G_LIKELY (GTK_IS_SOURCE_LANGUAGE (language)))
+      if (G_LIKELY (GTK_SOURCE_IS_LANGUAGE (language)))
         {
           /* ensure no duplicates in list */
           if (!g_slist_find_custom (list,
@@ -648,7 +649,7 @@ mousepad_action_group_get_sorted_languages_for_section (const gchar *section)
   while (*languages)
     {
       language = gtk_source_language_manager_get_language (manager, *languages);
-      if (G_LIKELY (GTK_IS_SOURCE_LANGUAGE (language)))
+      if (G_LIKELY (GTK_SOURCE_IS_LANGUAGE (language)))
         {
           /* only get languages in the specified section */
           if (g_strcmp0 (gtk_source_language_get_section (language), section) == 0)
@@ -709,7 +710,7 @@ mousepad_action_group_get_style_scheme_action (MousepadActionGroup  *self,
   const gchar *scheme_id;
   GtkAction   *action;
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (scheme))
     scheme_id = gtk_source_style_scheme_get_id (scheme);
   else
     scheme_id = "none";
@@ -729,9 +730,9 @@ mousepad_action_group_style_schemes_name_compare (gconstpointer a,
 {
   const gchar *name_a, *name_b;
 
-  if (G_UNLIKELY (!GTK_IS_SOURCE_STYLE_SCHEME (a)))
+  if (G_UNLIKELY (!GTK_SOURCE_IS_STYLE_SCHEME (a)))
     return -(a != b);
-  if (G_UNLIKELY (!GTK_IS_SOURCE_STYLE_SCHEME (b)))
+  if (G_UNLIKELY (!GTK_SOURCE_IS_STYLE_SCHEME (b)))
     return a != b;
 
   name_a = gtk_source_style_scheme_get_name (GTK_SOURCE_STYLE_SCHEME (a));
diff --git a/mousepad/mousepad-document.c b/mousepad/mousepad-document.c
index 11974c1..1c6a636 100644
--- a/mousepad/mousepad-document.c
+++ b/mousepad/mousepad-document.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-document.h>
@@ -158,7 +159,7 @@ mousepad_document_class_init (MousepadDocumentClass *klass)
                   G_SIGNAL_RUN_LAST,
                   0, NULL, NULL,
                   g_cclosure_marshal_VOID__OBJECT,
-                  G_TYPE_NONE, 1, GTK_TYPE_SOURCE_LANGUAGE);
+                  G_TYPE_NONE, 1, GTK_SOURCE_TYPE_LANGUAGE);
 }
 
 
@@ -323,7 +324,7 @@ mousepad_document_notify_language (GtkSourceBuffer  *buffer,
   GtkSourceLanguage *language;
 
   g_return_if_fail (MOUSEPAD_IS_DOCUMENT (document));
-  g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
+  g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
 
   /* the new language */
   language = gtk_source_buffer_get_language (buffer);
diff --git a/mousepad/mousepad-encoding-dialog.c b/mousepad/mousepad-encoding-dialog.c
index 7441e8a..a912514 100644
--- a/mousepad/mousepad-encoding-dialog.c
+++ b/mousepad/mousepad-encoding-dialog.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-encoding.h>
 #include <mousepad/mousepad-encoding-dialog.h>
diff --git a/mousepad/mousepad-file.c b/mousepad/mousepad-file.c
index d48ee61..bff49d3 100644
--- a/mousepad/mousepad-file.c
+++ b/mousepad/mousepad-file.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-file.h>
 
 #include <glib/gstdio.h>
@@ -395,7 +396,7 @@ mousepad_file_set_language (MousepadFile      *file,
                             GtkSourceLanguage *language)
 {
   g_return_if_fail (MOUSEPAD_IS_FILE (file));
-  g_return_if_fail (GTK_IS_SOURCE_BUFFER (file->buffer));
+  g_return_if_fail (GTK_SOURCE_IS_BUFFER (file->buffer));
 
   gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (file->buffer), language);
 }
@@ -406,7 +407,7 @@ GtkSourceLanguage *
 mousepad_file_get_language (MousepadFile *file)
 {
   g_return_val_if_fail (MOUSEPAD_IS_FILE (file), NULL);
-  g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (file->buffer), NULL);
+  g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (file->buffer), NULL);
 
   return gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (file->buffer));
 }
@@ -420,7 +421,7 @@ mousepad_file_set_language_id (MousepadFile *file,
   GtkSourceLanguage *lang;
 
   g_return_if_fail (MOUSEPAD_IS_FILE (file));
-  g_return_if_fail (GTK_IS_SOURCE_BUFFER (file->buffer));
+  g_return_if_fail (GTK_SOURCE_IS_BUFFER (file->buffer));
 
   if (G_UNLIKELY (language_id == NULL))
     {
diff --git a/mousepad/mousepad-gtkcompat.h b/mousepad/mousepad-gtkcompat.h
index 3de0870..70a4510 100644
--- a/mousepad/mousepad-gtkcompat.h
+++ b/mousepad/mousepad-gtkcompat.h
@@ -14,6 +14,10 @@ G_BEGIN_DECLS
 #if ! GTK_CHECK_VERSION(2, 24, 0)
 # define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
 # define gtk_combo_box_text_new            gtk_combo_box_new_text
+# define gtk_combo_box_text_append_text    gtk_combo_box_append_text
+# define GtkComboBoxText                   GtkComboBox
+# define GTK_COMBO_BOX_TEXT                GTK_COMBO_BOX
+# define gtk_notebook_set_group_name       gtk_notebook_set_group
 #endif
 
 #if ! GTK_CHECK_VERSION(3, 0, 0)
@@ -33,6 +37,19 @@ gtk_widget_get_allocated_height (GtkWidget *widget)
   gtk_widget_get_allocation (widget, &alloc);
   return alloc.height;
 }
+#else
+/* Does nothing */
+# define gtk_dialog_set_has_separator(dialog, setting) do { } while (0)
+#endif
+
+/* GtkSourceView3 compatibility */
+#if ! GTK_CHECK_VERSION(3, 0, 0)
+# define GTK_SOURCE_TYPE_LANGUAGE     GTK_TYPE_SOURCE_LANGUAGE
+# define GTK_SOURCE_IS_LANGUAGE       GTK_IS_SOURCE_LANGUAGE
+# define GTK_SOURCE_TYPE_STYLE_SCHEME GTK_TYPE_SOURCE_STYLE_SCHEME
+# define GTK_SOURCE_IS_STYLE_SCHEME   GTK_IS_SOURCE_STYLE_SCHEME
+# define GTK_SOURCE_IS_BUFFER         GTK_IS_SOURCE_BUFFER
+# define GTK_SOURCE_TYPE_VIEW         GTK_TYPE_SOURCE_VIEW
 #endif
 
 G_END_DECLS
diff --git a/mousepad/mousepad-language-action.c b/mousepad/mousepad-language-action.c
index a97840d..8b3b34e 100644
--- a/mousepad/mousepad-language-action.c
+++ b/mousepad/mousepad-language-action.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-language-action.h>
 #include <mousepad/mousepad-util.h>
 
@@ -79,7 +80,7 @@ mousepad_language_action_class_init (MousepadLanguageActionClass *klass)
       "language",
       "Language",
       "The GtkSourceLanguage associated with the action",
-      GTK_TYPE_SOURCE_LANGUAGE,
+      GTK_SOURCE_TYPE_LANGUAGE,
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
 }
@@ -95,7 +96,7 @@ mousepad_language_action_finalize (GObject *object)
 
   self = MOUSEPAD_LANGUAGE_ACTION (object);
 
-  if (GTK_IS_SOURCE_LANGUAGE (self->language))
+  if (GTK_SOURCE_IS_LANGUAGE (self->language))
     g_object_unref (self->language);
 
   G_OBJECT_CLASS (mousepad_language_action_parent_class)->finalize (object);
@@ -160,7 +161,7 @@ mousepad_language_action_new (GtkSourceLanguage *language)
   const gchar *language_id;
   GtkAction   *action;
 
-  if (GTK_IS_SOURCE_LANGUAGE (language))
+  if (GTK_SOURCE_IS_LANGUAGE (language))
     language_id = gtk_source_language_get_id (language);
   else
     language_id = "none";
@@ -217,7 +218,7 @@ mousepad_language_action_set_language (MousepadLanguageAction *self,
   GIcon  *icon = NULL;
 
   g_return_if_fail (MOUSEPAD_IS_LANGUAGE_ACTION (self));
-  g_return_if_fail (language == NULL || GTK_IS_SOURCE_LANGUAGE (language));
+  g_return_if_fail (language == NULL || GTK_SOURCE_IS_LANGUAGE (language));
 
   if (G_UNLIKELY (self->language != NULL))
     g_object_unref (self->language);
diff --git a/mousepad/mousepad-print.c b/mousepad/mousepad-print.c
index acdcd67..5a83dbc 100644
--- a/mousepad/mousepad-print.c
+++ b/mousepad/mousepad-print.c
@@ -15,10 +15,12 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-print.h>
 
+#include <gtksourceview/gtksourcebuffer.h>
 #include <gtksourceview/gtksourceprintcompositor.h>
 
 #define DOCUMENT_SPACING (10)
@@ -780,7 +782,7 @@ mousepad_print_document_interactive (MousepadPrint     *print,
   g_return_val_if_fail (MOUSEPAD_IS_PRINT (print), FALSE);
   g_return_val_if_fail (GTK_IS_PRINT_OPERATION (print), FALSE);
   g_return_val_if_fail (MOUSEPAD_IS_DOCUMENT (document), FALSE);
-  g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (document->buffer), FALSE);
+  g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (document->buffer), FALSE);
   g_return_val_if_fail (GTK_IS_WINDOW (parent), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
diff --git a/mousepad/mousepad-replace-dialog.c b/mousepad/mousepad-replace-dialog.c
index 6f20d39..6a22d05 100644
--- a/mousepad/mousepad-replace-dialog.c
+++ b/mousepad/mousepad-replace-dialog.c
@@ -33,7 +33,7 @@ static void                 mousepad_replace_dialog_changed             (Mousepa
 static void                 mousepad_replace_dialog_settings_changed    (MousepadReplaceDialog *dialog,
                                                                          gchar                 *key,
                                                                          GSettings             *settings);
-static void                 mousepad_replace_dialog_history_combo_box   (GtkComboBox           *combo_box);
+static void                 mousepad_replace_dialog_history_combo_box   (GtkComboBoxText       *combo_box);
 static void                 mousepad_replace_dialog_history_insert_text (const gchar           *text);
 
 
@@ -166,7 +166,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   gtk_widget_show (label);
 
   combo = gtk_combo_box_text_new_with_entry ();
-  mousepad_replace_dialog_history_combo_box (GTK_COMBO_BOX (combo));
+  mousepad_replace_dialog_history_combo_box (GTK_COMBO_BOX_TEXT (combo));
   gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL(label), combo);
   gtk_widget_show (combo);
@@ -187,7 +187,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   gtk_widget_show (label);
 
   combo = gtk_combo_box_text_new_with_entry ();
-  mousepad_replace_dialog_history_combo_box (GTK_COMBO_BOX (combo));
+  mousepad_replace_dialog_history_combo_box (GTK_COMBO_BOX_TEXT (combo));
   gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
   gtk_widget_show (combo);
 
@@ -209,9 +209,9 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   combo = gtk_combo_box_text_new ();
   gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL(label), combo);
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Up"));
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Down"));
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Both"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Up"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Down"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Both"));
   gtk_widget_show (combo);
 
   mousepad_replace_dialog_bind_setting (dialog, MOUSEPAD_SETTING_SEARCH_DIRECTION, combo, "active");
@@ -246,9 +246,9 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
 
   combo = dialog->search_location_combo = gtk_combo_box_text_new ();
   gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Selection"));
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Document"));
-  gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("All Documents"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Selection"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Document"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("All Documents"));
   gtk_widget_set_sensitive (combo, FALSE);
   gtk_widget_show (combo);
 
@@ -489,7 +489,7 @@ mousepad_replace_dialog_settings_changed (MousepadReplaceDialog *dialog,
  * History functions
  **/
 static void
-mousepad_replace_dialog_history_combo_box (GtkComboBox *combo_box)
+mousepad_replace_dialog_history_combo_box (GtkComboBoxText *combo_box)
 {
   GSList *li;
 
@@ -497,7 +497,7 @@ mousepad_replace_dialog_history_combo_box (GtkComboBox *combo_box)
 
   /* append the items from the history to the combobox */
   for (li = history_list; li != NULL; li = li->next)
-    gtk_combo_box_append_text (combo_box, li->data);
+    gtk_combo_box_text_append_text (combo_box, li->data);
 }
 
 
diff --git a/mousepad/mousepad-statusbar.c b/mousepad/mousepad-statusbar.c
index 027770d..f2fd009 100644
--- a/mousepad/mousepad-statusbar.c
+++ b/mousepad/mousepad-statusbar.c
@@ -108,7 +108,9 @@ mousepad_statusbar_init (MousepadStatusbar *statusbar)
   GList *frame;
 
   /* init statusbar */
+#if ! GTK_CHECK_VERSION(3, 0, 0)
   gtk_statusbar_set_has_resize_grip (bar, TRUE);
+#endif
 
   /* create a new horizontal box */
   box = gtk_hbox_new (FALSE, 8);
diff --git a/mousepad/mousepad-style-scheme-action.c b/mousepad/mousepad-style-scheme-action.c
index 2d8793e..52b256a 100644
--- a/mousepad/mousepad-style-scheme-action.c
+++ b/mousepad/mousepad-style-scheme-action.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-style-scheme-action.h>
 
 #include <glib/gi18n.h>
@@ -81,7 +82,7 @@ mousepad_style_scheme_action_class_init (MousepadStyleSchemeActionClass *klass)
     g_param_spec_object ("style-scheme",
                          "StyleScheme",
                          "The style scheme related to the action",
-                         GTK_TYPE_SOURCE_STYLE_SCHEME,
+                         GTK_SOURCE_TYPE_STYLE_SCHEME,
                          G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 }
 
@@ -96,7 +97,7 @@ mousepad_style_scheme_action_finalize (GObject *object)
 
   self = MOUSEPAD_STYLE_SCHEME_ACTION (object);
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (self->scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (self->scheme))
     g_object_unref (self->scheme);
 
   G_OBJECT_CLASS (mousepad_style_scheme_action_parent_class)->finalize (object);
@@ -161,7 +162,7 @@ mousepad_style_scheme_action_new (GtkSourceStyleScheme *scheme)
   gchar       *name;
   GtkAction   *action;
 
-  if (GTK_IS_SOURCE_STYLE_SCHEME (scheme))
+  if (GTK_SOURCE_IS_STYLE_SCHEME (scheme))
     scheme_id = gtk_source_style_scheme_get_id (scheme);
   else
     scheme_id = "none";
diff --git a/mousepad/mousepad-util.c b/mousepad/mousepad-util.c
index 7d9cf03..d58d558 100644
--- a/mousepad/mousepad-util.c
+++ b/mousepad/mousepad-util.c
@@ -1106,7 +1106,7 @@ static void
 mousepad_util_container_foreach_counter (GtkWidget *widget,
                                          guint     *n_children)
 {
-  *n_children++;
+  *n_children = *n_children + 1;
 }
 
 
diff --git a/mousepad/mousepad-view.c b/mousepad/mousepad-view.c
index ca33767..8c3eba6 100644
--- a/mousepad/mousepad-view.c
+++ b/mousepad/mousepad-view.c
@@ -20,6 +20,7 @@
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-view.h>
 
+#include <gtksourceview/gtksourcebuffer.h>
 #include <gtksourceview/gtksourceview.h>
 #include <gtksourceview/gtksourcestylescheme.h>
 #include <gtksourceview/gtksourcestyleschememanager.h>
@@ -161,7 +162,7 @@ enum
 
 
 
-G_DEFINE_TYPE (MousepadView, mousepad_view, GTK_TYPE_SOURCE_VIEW)
+G_DEFINE_TYPE (MousepadView, mousepad_view, GTK_SOURCE_TYPE_VIEW)
 
 
 
@@ -178,7 +179,7 @@ mousepad_view_class_init (MousepadViewClass *klass)
 
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class->key_press_event      = mousepad_view_key_press_event;
-#ifdef HAVE_MUTLISELECT
+#ifdef HAVE_MULTISELECT
   widget_class->expose_event         = mousepad_view_expose;
   widget_class->style_set            = mousepad_view_style_set;
   widget_class->button_press_event   = mousepad_view_button_press_event;
@@ -250,7 +251,7 @@ mousepad_view_buffer_changed (MousepadView *view,
   GtkSourceBuffer *buffer;
 
   buffer = (GtkSourceBuffer*) gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
-  if (GTK_IS_SOURCE_BUFFER (buffer))
+  if (GTK_SOURCE_IS_BUFFER (buffer))
     {
       GtkSourceStyleSchemeManager *manager;
       GtkSourceStyleScheme        *scheme;
@@ -430,7 +431,7 @@ mousepad_view_get_property (GObject    *object,
 
 
 
-#ifdef HAVE_MUTLISELECT
+#ifdef HAVE_MULTISELECT
 static gboolean
 mousepad_view_expose (GtkWidget      *widget,
                       GdkEventExpose *event)
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index bc179c3..5705c94 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -48,7 +48,7 @@
 #define PADDING                   (2)
 #define PASTE_HISTORY_MENU_LENGTH (30)
 
-static gconstpointer NOTEBOOK_GROUP = "Mousepad";
+static const gchar *NOTEBOOK_GROUP = "Mousepad";
 
 
 
@@ -897,16 +897,17 @@ static void
 mousepad_window_create_notebook (MousepadWindow *window)
 {
   window->notebook = g_object_new (GTK_TYPE_NOTEBOOK,
-                                   "homogeneous", FALSE,
                                    "scrollable", TRUE,
                                    "show-border", FALSE,
                                    "show-tabs", FALSE,
+#if ! GTK_CHECK_VERSION(3, 0, 0)
                                    "tab-hborder", 0,
                                    "tab-vborder", 0,
+#endif
                                    NULL);
 
   /* set the group id */
-  gtk_notebook_set_group (GTK_NOTEBOOK (window->notebook), (gpointer) NOTEBOOK_GROUP);
+  gtk_notebook_set_group_name (GTK_NOTEBOOK (window->notebook), NOTEBOOK_GROUP);
 
   /* connect signals to the notebooks */
   g_signal_connect (G_OBJECT (window->notebook), "switch-page", G_CALLBACK (mousepad_window_notebook_switch_page), window);
@@ -1014,6 +1015,10 @@ mousepad_window_init (MousepadWindow *window)
   window->active = NULL;
   window->recent_manager = NULL;
 
+#if GTK_CHECK_VERSION(3, 0, 0)
+  gtk_window_set_has_resize_grip (GTK_WINDOW (window), TRUE);
+#endif
+
   /* increase clipboard history ref count */
   clipboard_history_ref_count++;
 
@@ -2416,7 +2421,6 @@ mousepad_window_menu_templates (GtkWidget      *item,
 
   g_return_if_fail (MOUSEPAD_IS_WINDOW (window));
   g_return_if_fail (GTK_IS_MENU_ITEM (item));
-  g_return_if_fail (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)) == NULL);
 
   /* schedule the idle build of the recent menu */
   mousepad_window_recent_menu (window);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list