diff --git a/ChangeLog b/ChangeLog index 9213768193..f9536d5a56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-10-11 Michael Natterer + + * 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. + 2008-10-11 Martin Nordholts * app/gegl/gimpoperationadditionmode.c diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c index 7c65518512..71685bdf9c 100644 --- a/app/actions/view-actions.c +++ b/app/actions/view-actions.c @@ -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 @@ static const GimpToggleActionEntry view_toggle_actions[] = 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 @@ view_actions_update (GimpActionGroup *group, 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)) diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index d7cb6fe88a..4817a1d0e1 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -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 @@ view_fullscreen_cmd_callback (GtkAction *action, 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 */ diff --git a/app/actions/view-commands.h b/app/actions/view-commands.h index f71ee2607f..b3107a40ed 100644 --- a/app/actions/view-commands.h +++ b/app/actions/view-commands.h @@ -87,5 +87,8 @@ void view_shrink_wrap_cmd_callback (GtkAction *action, void view_fullscreen_cmd_callback (GtkAction *action, gpointer data); +void view_use_gegl_cmd_callback (GtkAction *action, + gpointer data); + #endif /* __VIEW_COMMANDS_H__ */ diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index e43bf56407..023573077a 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -153,7 +153,7 @@ gimp_projection_construct (GimpProjection *proj, /* 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); } diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 204531ef2b..fccf63d54d 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -64,6 +64,8 @@ struct _GimpProjection gboolean construct_flag; gboolean invalidate_preview; + + gboolean use_gegl; }; struct _GimpProjectionClass diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in index 21abba18f7..39d51b67a3 100644 --- a/menus/image-menu.xml.in +++ b/menus/image-menu.xml.in @@ -288,6 +288,8 @@ + +