gimp r25223 - in trunk: . app/display



Author: mitch
Date: Tue Mar 25 13:42:40 2008
New Revision: 25223
URL: http://svn.gnome.org/viewvc/gimp?rev=25223&view=rev

Log:
2008-03-25  Michael Natterer  <mitch gimp org>

	* app/display/gimpdisplayshell-callbacks.[ch]: remove the window
	state callback here...

	* app/display/gimpdisplayshell.c: ...add it here and turn it into
	a GtkWidget::window_state_event() implementation instead of a
	signal callback.



Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell-callbacks.c
   trunk/app/display/gimpdisplayshell-callbacks.h
   trunk/app/display/gimpdisplayshell.c

Modified: trunk/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.c	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.c	Tue Mar 25 13:42:40 2008
@@ -48,7 +48,6 @@
 #include "tools/gimptoolcontrol.h"
 #include "tools/tool_manager.h"
 
-#include "widgets/gimpactiongroup.h"
 #include "widgets/gimpcontrollers.h"
 #include "widgets/gimpcontrollerkeyboard.h"
 #include "widgets/gimpcontrollerwheel.h"
@@ -60,7 +59,6 @@
 
 #include "gimpcanvas.h"
 #include "gimpdisplay.h"
-#include "gimpdisplayoptions.h"
 #include "gimpdisplayshell.h"
 #include "gimpdisplayshell-appearance.h"
 #include "gimpdisplayshell-autoscroll.h"
@@ -223,40 +221,6 @@
   return FALSE;
 }
 
-gboolean
-gimp_display_shell_window_state_event (GtkWidget           *widget,
-                                       GdkEventWindowState *event,
-                                       GimpDisplayShell    *shell)
-{
-  shell->window_state = event->new_window_state;
-
-  if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
-    {
-      Gimp            *gimp = shell->display->gimp;
-      GimpActionGroup *group;
-      gboolean         fullscreen;
-
-      gimp_display_shell_appearance_update (shell);
-
-      fullscreen = gimp_display_shell_get_fullscreen (shell);
-
-      group = gimp_ui_manager_get_action_group (shell->menubar_manager, "view");
-      gimp_action_group_set_action_active (group,
-                                           "view-fullscreen", fullscreen);
-
-      if (shell->display ==
-          gimp_context_get_display (gimp_get_user_context (gimp)))
-        {
-          group = gimp_ui_manager_get_action_group (shell->popup_manager,
-                                                    "view");
-          gimp_action_group_set_action_active (group,
-                                               "view-fullscreen", fullscreen);
-        }
-    }
-
-  return FALSE;
-}
-
 void
 gimp_display_shell_canvas_realize (GtkWidget        *canvas,
                                    GimpDisplayShell *shell)

Modified: trunk/app/display/gimpdisplayshell-callbacks.h
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.h	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.h	Tue Mar 25 13:42:40 2008
@@ -34,12 +34,9 @@
                                               GDK_PROXIMITY_OUT_MASK)
 
 
-gboolean   gimp_display_shell_events               (GtkWidget           *widget,
-                                                    GdkEvent            *event,
-                                                    GimpDisplayShell    *shell);
-gboolean   gimp_display_shell_window_state_event   (GtkWidget           *widget,
-                                                    GdkEventWindowState *event,
-                                                    GimpDisplayShell    *shell);
+gboolean   gimp_display_shell_events                  (GtkWidget        *widget,
+                                                       GdkEvent         *event,
+                                                       GimpDisplayShell *shell);
 
 void       gimp_display_shell_canvas_realize          (GtkWidget        *widget,
                                                        GimpDisplayShell *shell);

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Tue Mar 25 13:42:40 2008
@@ -47,6 +47,7 @@
 #include "core/gimpsamplepoint.h"
 #include "core/gimptemplate.h"
 
+#include "widgets/gimpactiongroup.h"
 #include "widgets/gimpdialogfactory.h"
 #include "widgets/gimphelp-ids.h"
 #include "widgets/gimpmenufactory.h"
@@ -115,6 +116,9 @@
                                                     GdkScreen        *previous);
 static gboolean  gimp_display_shell_delete_event   (GtkWidget        *widget,
                                                     GdkEventAny      *aevent);
+static gboolean
+             gimp_display_shell_window_state_event (GtkWidget        *widget,
+                                                    GdkEventWindowState *event);
 static gboolean  gimp_display_shell_popup_menu     (GtkWidget        *widget);
 static void      gimp_display_shell_style_set      (GtkWidget        *widget,
                                                     GtkStyle         *prev_style);
@@ -197,21 +201,22 @@
                   gimp_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
-  object_class->finalize       = gimp_display_shell_finalize;
-  object_class->set_property   = gimp_display_shell_set_property;
-  object_class->get_property   = gimp_display_shell_get_property;
-
-  gtk_object_class->destroy    = gimp_display_shell_destroy;
-
-  widget_class->unrealize      = gimp_display_shell_unrealize;
-  widget_class->screen_changed = gimp_display_shell_screen_changed;
-  widget_class->delete_event   = gimp_display_shell_delete_event;
-  widget_class->popup_menu     = gimp_display_shell_popup_menu;
-  widget_class->style_set      = gimp_display_shell_style_set;
-
-  klass->scaled                = gimp_display_shell_real_scaled;
-  klass->scrolled              = NULL;
-  klass->reconnect             = NULL;
+  object_class->finalize           = gimp_display_shell_finalize;
+  object_class->set_property       = gimp_display_shell_set_property;
+  object_class->get_property       = gimp_display_shell_get_property;
+
+  gtk_object_class->destroy        = gimp_display_shell_destroy;
+
+  widget_class->unrealize          = gimp_display_shell_unrealize;
+  widget_class->screen_changed     = gimp_display_shell_screen_changed;
+  widget_class->delete_event       = gimp_display_shell_delete_event;
+  widget_class->window_state_event = gimp_display_shell_window_state_event;
+  widget_class->popup_menu         = gimp_display_shell_popup_menu;
+  widget_class->style_set          = gimp_display_shell_style_set;
+
+  klass->scaled                    = gimp_display_shell_real_scaled;
+  klass->scrolled                  = NULL;
+  klass->reconnect                 = NULL;
 
   g_object_class_install_property (object_class, PROP_UNIT,
                                    gimp_param_spec_unit ("unit", NULL, NULL,
@@ -366,10 +371,6 @@
                     G_CALLBACK (gimp_display_shell_events),
                     shell);
 
-  g_signal_connect (shell, "window-state-event",
-                    G_CALLBACK (gimp_display_shell_window_state_event),
-                    shell);
-
   gimp_help_connect (GTK_WIDGET (shell), gimp_standard_help_func,
                      GIMP_HELP_IMAGE_WINDOW, NULL);
 }
@@ -570,6 +571,41 @@
 }
 
 static gboolean
+gimp_display_shell_window_state_event (GtkWidget           *widget,
+                                       GdkEventWindowState *event)
+{
+  GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
+
+  shell->window_state = event->new_window_state;
+
+  if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
+    {
+      Gimp            *gimp = shell->display->gimp;
+      GimpActionGroup *group;
+      gboolean         fullscreen;
+
+      gimp_display_shell_appearance_update (shell);
+
+      fullscreen = gimp_display_shell_get_fullscreen (shell);
+
+      group = gimp_ui_manager_get_action_group (shell->menubar_manager, "view");
+      gimp_action_group_set_action_active (group,
+                                           "view-fullscreen", fullscreen);
+
+      if (shell->display ==
+          gimp_context_get_display (gimp_get_user_context (gimp)))
+        {
+          group = gimp_ui_manager_get_action_group (shell->popup_manager,
+                                                    "view");
+          gimp_action_group_set_action_active (group,
+                                               "view-fullscreen", fullscreen);
+        }
+    }
+
+  return FALSE;
+}
+
+static gboolean
 gimp_display_shell_popup_menu (GtkWidget *widget)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]