gimp r27242 - in trunk: . app/actions app/core menus



Author: mitch
Date: Sat Oct 11 19:17:42 2008
New Revision: 27242
URL: http://svn.gnome.org/viewvc/gimp?rev=27242&view=rev

Log:
2008-10-11  Michael Natterer  <mitch gimp org>

	* app/core/gimpprojection.h: add a "use_gegl" boolean member.

	* app/core/gimpprojection-construct.c (gimp_projection_construct):
	use the boolean instead of hardcoding FALSE.

	* app/actions/view-actions.c
	* app/actions/view-commands.[ch]: add a "Use GEGL" action and
	callback which sets the boolean and exposes the display.

	* menus/image-menu.xml.in: add it to the "View" menu.



Modified:
   trunk/ChangeLog
   trunk/app/actions/view-actions.c
   trunk/app/actions/view-commands.c
   trunk/app/actions/view-commands.h
   trunk/app/core/gimpprojection-construct.c
   trunk/app/core/gimpprojection.h
   trunk/menus/image-menu.xml.in

Modified: trunk/app/actions/view-actions.c
==============================================================================
--- trunk/app/actions/view-actions.c	(original)
+++ trunk/app/actions/view-actions.c	Sat Oct 11 19:17:42 2008
@@ -32,6 +32,7 @@
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
+#include "core/gimpprojection.h"
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimprender.h"
@@ -232,7 +233,14 @@
     N_("Toggle fullscreen view"),
     G_CALLBACK (view_fullscreen_cmd_callback),
     FALSE,
-    GIMP_HELP_VIEW_FULLSCREEN }
+    GIMP_HELP_VIEW_FULLSCREEN },
+
+  { "view-use-gegl", GIMP_STOCK_GEGL,
+    "Use GEGL", NULL,
+    "Use GEGL to create this window's projection",
+    G_CALLBACK (view_use_gegl_cmd_callback),
+    FALSE,
+    NULL }
 };
 
 static const GimpEnumActionEntry view_zoom_actions[] =
@@ -657,6 +665,7 @@
   SET_SENSITIVE ("view-shrink-wrap", image);
   SET_SENSITIVE ("view-fullscreen",  image);
   SET_ACTIVE    ("view-fullscreen",  display && fullscreen);
+  SET_ACTIVE    ("view-use-gegl",    image && display->image->projection->use_gegl);
 
   if (GIMP_IS_DISPLAY (group->user_data) ||
       GIMP_IS_GIMP (group->user_data))

Modified: trunk/app/actions/view-commands.c
==============================================================================
--- trunk/app/actions/view-commands.c	(original)
+++ trunk/app/actions/view-commands.c	Sat Oct 11 19:17:42 2008
@@ -31,6 +31,7 @@
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
+#include "core/gimpprojection.h"
 
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplay-foreach.h"
@@ -683,6 +684,25 @@
   gimp_display_shell_set_fullscreen (shell, active);
 }
 
+void
+view_use_gegl_cmd_callback (GtkAction *action,
+                            gpointer   data)
+{
+  GimpImage        *image;
+  GimpDisplay      *display;
+  GimpDisplayShell *shell;
+  gboolean   active;
+  return_if_no_image (image, data);
+  return_if_no_display (display, data);
+
+  shell = GIMP_DISPLAY_SHELL (display->shell);
+
+  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+
+  image->projection->use_gegl = active;
+  gimp_display_shell_expose_full (shell);
+}
+
 
 /*  private functions  */
 

Modified: trunk/app/actions/view-commands.h
==============================================================================
--- trunk/app/actions/view-commands.h	(original)
+++ trunk/app/actions/view-commands.h	Sat Oct 11 19:17:42 2008
@@ -87,5 +87,8 @@
 void   view_fullscreen_cmd_callback            (GtkAction *action,
                                                 gpointer   data);
 
+void   view_use_gegl_cmd_callback              (GtkAction *action,
+                                                gpointer   data);
+
 
 #endif /* __VIEW_COMMANDS_H__ */

Modified: trunk/app/core/gimpprojection-construct.c
==============================================================================
--- trunk/app/core/gimpprojection-construct.c	(original)
+++ trunk/app/core/gimpprojection-construct.c	Sat Oct 11 19:17:42 2008
@@ -153,7 +153,7 @@
   /*  call functions which process the list of layers and
    *  the list of channels
    */
-  if (FALSE)
+  if (proj->use_gegl)
     {
       gimp_projection_construct_gegl (proj, x, y, w, h);
     }

Modified: trunk/app/core/gimpprojection.h
==============================================================================
--- trunk/app/core/gimpprojection.h	(original)
+++ trunk/app/core/gimpprojection.h	Sat Oct 11 19:17:42 2008
@@ -64,6 +64,8 @@
 
   gboolean                  construct_flag;
   gboolean                  invalidate_preview;
+
+  gboolean                  use_gegl;
 };
 
 struct _GimpProjectionClass

Modified: trunk/menus/image-menu.xml.in
==============================================================================
--- trunk/menus/image-menu.xml.in	(original)
+++ trunk/menus/image-menu.xml.in	Sat Oct 11 19:17:42 2008
@@ -288,6 +288,8 @@
       <menuitem action="view-show-scrollbars" />
       <menuitem action="view-show-statusbar" />
       <separator />
+      <menuitem action="view-use-gegl" />
+      <separator />
     </menu>
 
     <menu action="image-menu" name="Image">



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