add a "use_gegl" boolean member.

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.


svn path=/trunk/; revision=27242
This commit is contained in:
Michael Natterer 2008-10-11 19:17:42 +00:00 committed by Michael Natterer
parent ae75c33bfd
commit ef1df223a8
7 changed files with 51 additions and 2 deletions

View File

@ -1,3 +1,16 @@
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.
2008-10-11 Martin Nordholts <martinn@svn.gnome.org>
* app/gegl/gimpoperationadditionmode.c

View File

@ -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))

View File

@ -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 */

View File

@ -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__ */

View File

@ -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);
}

View File

@ -64,6 +64,8 @@ struct _GimpProjection
gboolean construct_flag;
gboolean invalidate_preview;
gboolean use_gegl;
};
struct _GimpProjectionClass

View File

@ -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">