Let the data editors optionally follow the active brush, palette and
2005-10-25 Michael Natterer <mitch@gimp.org> Let the data editors optionally follow the active brush, palette and gradient. Still needs to be saved in sessionrc and probably be enabled by default. Addresses bug #313547. * app/widgets/gimpdataeditor.[ch]: added new functions gimp_data_editor_set,get_edit_active(). Make it configurable from the palette and gradient editor menus: * app/actions/gradient-editor-actions.c * app/actions/palette-editor-actions.c: added actions... * app/actions/data-editor-commands.[ch]: ...and callbacks... (new file). * app/widgets/gimphelp-ids.h: ...help IDs... * menus/gradient-editor-menu.xml * menus/palette-editor-menu.xml: ...and menu items. Add menu to the brush editor and make it configurable there too: * app/actions/Makefile.am * app/actions/actions.c * app/actions/brush-editor-actions.[ch] * app/menus/menus.c * menus/Makefile.am * menus/brush-editor-menu.xml: added all the bits needed for the new menu. * app/widgets/gimpbrusheditor.[ch]: use the menu. Added menu_factory paramater to the contstructor. * app/dialogs/dialogs-constructors.c: changed accordingly.
This commit is contained in:

committed by
Michael Natterer

parent
3af60ead59
commit
f546e1e701
37
ChangeLog
37
ChangeLog
@ -1,3 +1,40 @@
|
|||||||
|
2005-10-25 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
Let the data editors optionally follow the active brush, palette
|
||||||
|
and gradient. Still needs to be saved in sessionrc and probably
|
||||||
|
be enabled by default. Addresses bug #313547.
|
||||||
|
|
||||||
|
* app/widgets/gimpdataeditor.[ch]: added new functions
|
||||||
|
gimp_data_editor_set,get_edit_active().
|
||||||
|
|
||||||
|
Make it configurable from the palette and gradient editor menus:
|
||||||
|
|
||||||
|
* app/actions/gradient-editor-actions.c
|
||||||
|
* app/actions/palette-editor-actions.c: added actions...
|
||||||
|
|
||||||
|
* app/actions/data-editor-commands.[ch]: ...and callbacks...
|
||||||
|
(new file).
|
||||||
|
|
||||||
|
* app/widgets/gimphelp-ids.h: ...help IDs...
|
||||||
|
|
||||||
|
* menus/gradient-editor-menu.xml
|
||||||
|
* menus/palette-editor-menu.xml: ...and menu items.
|
||||||
|
|
||||||
|
Add menu to the brush editor and make it configurable there too:
|
||||||
|
|
||||||
|
* app/actions/Makefile.am
|
||||||
|
* app/actions/actions.c
|
||||||
|
* app/actions/brush-editor-actions.[ch]
|
||||||
|
* app/menus/menus.c
|
||||||
|
* menus/Makefile.am
|
||||||
|
* menus/brush-editor-menu.xml: added all the bits needed for
|
||||||
|
the new menu.
|
||||||
|
|
||||||
|
* app/widgets/gimpbrusheditor.[ch]: use the menu. Added menu_factory
|
||||||
|
paramater to the contstructor.
|
||||||
|
|
||||||
|
* app/dialogs/dialogs-constructors.c: changed accordingly.
|
||||||
|
|
||||||
2005-10-25 Michael Natterer <mitch@gimp.org>
|
2005-10-25 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/display/gimpdisplayshell-close.c
|
* app/display/gimpdisplayshell-close.c
|
||||||
|
@ -7,6 +7,8 @@ libappactions_a_SOURCES = \
|
|||||||
actions.c \
|
actions.c \
|
||||||
actions.h \
|
actions.h \
|
||||||
\
|
\
|
||||||
|
brush-editor-actions.c \
|
||||||
|
bruah-editor-actions.h \
|
||||||
brushes-actions.c \
|
brushes-actions.c \
|
||||||
brushes-actions.h \
|
brushes-actions.h \
|
||||||
buffers-actions.c \
|
buffers-actions.c \
|
||||||
@ -31,6 +33,8 @@ libappactions_a_SOURCES = \
|
|||||||
cursor-info-commands.h \
|
cursor-info-commands.h \
|
||||||
data-commands.c \
|
data-commands.c \
|
||||||
data-commands.h \
|
data-commands.h \
|
||||||
|
data-editor-commands.c \
|
||||||
|
data-editor-commands.h \
|
||||||
debug-actions.c \
|
debug-actions.c \
|
||||||
debug-actions.h \
|
debug-actions.h \
|
||||||
debug-commands.c \
|
debug-commands.c \
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
#include "dialogs/dialogs.h"
|
#include "dialogs/dialogs.h"
|
||||||
|
|
||||||
|
#include "brush-editor-actions.h"
|
||||||
#include "brushes-actions.h"
|
#include "brushes-actions.h"
|
||||||
#include "buffers-actions.h"
|
#include "buffers-actions.h"
|
||||||
#include "channels-actions.h"
|
#include "channels-actions.h"
|
||||||
@ -94,6 +95,9 @@ GimpActionFactory *global_action_factory = NULL;
|
|||||||
|
|
||||||
static GimpActionFactoryEntry action_groups[] =
|
static GimpActionFactoryEntry action_groups[] =
|
||||||
{
|
{
|
||||||
|
{ "brush-editor", N_("Brush Editor"), GIMP_STOCK_BRUSH,
|
||||||
|
brush_editor_actions_setup,
|
||||||
|
brush_editor_actions_update },
|
||||||
{ "brushes", N_("Brushes"), GIMP_STOCK_BRUSH,
|
{ "brushes", N_("Brushes"), GIMP_STOCK_BRUSH,
|
||||||
brushes_actions_setup,
|
brushes_actions_setup,
|
||||||
brushes_actions_update },
|
brushes_actions_update },
|
||||||
|
99
app/actions/brush-editor-actions.c
Normal file
99
app/actions/brush-editor-actions.c
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
|
||||||
|
#include "actions-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpcontext.h"
|
||||||
|
|
||||||
|
#include "widgets/gimpactiongroup.h"
|
||||||
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
#include "widgets/gimpbrusheditor.h"
|
||||||
|
|
||||||
|
#include "data-editor-commands.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
static GimpActionEntry brush_editor_actions[] =
|
||||||
|
{
|
||||||
|
{ "brush-editor-popup", GIMP_STOCK_BRUSH,
|
||||||
|
N_("Brush Editor Menu"), NULL, NULL, NULL,
|
||||||
|
GIMP_HELP_BRUSH_EDITOR_DIALOG }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GimpToggleActionEntry brush_editor_toggle_actions[] =
|
||||||
|
{
|
||||||
|
{ "brush-editor-edit-active", GIMP_STOCK_LINKED,
|
||||||
|
N_("Edit Active Brush"), NULL, NULL,
|
||||||
|
G_CALLBACK (data_editor_edit_active_cmd_callback),
|
||||||
|
FALSE,
|
||||||
|
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
brush_editor_actions_setup (GimpActionGroup *group)
|
||||||
|
{
|
||||||
|
gimp_action_group_add_actions (group,
|
||||||
|
brush_editor_actions,
|
||||||
|
G_N_ELEMENTS (brush_editor_actions));
|
||||||
|
|
||||||
|
gimp_action_group_add_toggle_actions (group,
|
||||||
|
brush_editor_toggle_actions,
|
||||||
|
G_N_ELEMENTS (brush_editor_toggle_actions));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
brush_editor_actions_update (GimpActionGroup *group,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
|
||||||
|
GimpContext *context;
|
||||||
|
GimpData *data;
|
||||||
|
gboolean editable = FALSE;
|
||||||
|
gboolean edit_active = FALSE;
|
||||||
|
|
||||||
|
context = gimp_get_user_context (group->gimp);
|
||||||
|
|
||||||
|
data = data_editor->data;
|
||||||
|
|
||||||
|
if (data)
|
||||||
|
{
|
||||||
|
if (data_editor->data_editable)
|
||||||
|
editable = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
edit_active = gimp_data_editor_get_edit_active (data_editor);
|
||||||
|
|
||||||
|
#define SET_SENSITIVE(action,condition) \
|
||||||
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||||
|
#define SET_ACTIVE(action,condition) \
|
||||||
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
|
|
||||||
|
SET_ACTIVE ("brush-editor-edit-active", edit_active);
|
||||||
|
|
||||||
|
#undef SET_SENSITIVE
|
||||||
|
#undef SET_ACTIVE
|
||||||
|
}
|
28
app/actions/brush-editor-actions.h
Normal file
28
app/actions/brush-editor-actions.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __BRUSH_EDITOR_ACTIONS_H__
|
||||||
|
#define __BRUSH_EDITOR_ACTIONS_H__
|
||||||
|
|
||||||
|
|
||||||
|
void brush_editor_actions_setup (GimpActionGroup *group);
|
||||||
|
void brush_editor_actions_update (GimpActionGroup *group,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __BRUSH_EDITOR_ACTIONS_H__ */
|
42
app/actions/data-editor-commands.c
Normal file
42
app/actions/data-editor-commands.c
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "actions-types.h"
|
||||||
|
|
||||||
|
#include "widgets/gimpdataeditor.h"
|
||||||
|
|
||||||
|
#include "data-editor-commands.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* public functionss */
|
||||||
|
|
||||||
|
void
|
||||||
|
data_editor_edit_active_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpDataEditor *editor = GIMP_DATA_EDITOR (data);
|
||||||
|
gboolean edit_active;
|
||||||
|
|
||||||
|
edit_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||||
|
|
||||||
|
gimp_data_editor_set_edit_active (editor, edit_active);
|
||||||
|
}
|
27
app/actions/data-editor-commands.h
Normal file
27
app/actions/data-editor-commands.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __DATA_EDITOR_COMMANDS_H__
|
||||||
|
#define __DATA_EDITOR_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
|
void data_editor_edit_active_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __DATA_EDITOR_COMMANDS_H__ */
|
@ -33,6 +33,7 @@
|
|||||||
#include "widgets/gimpgradienteditor.h"
|
#include "widgets/gimpgradienteditor.h"
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
|
||||||
|
#include "data-editor-commands.h"
|
||||||
#include "gradient-editor-actions.h"
|
#include "gradient-editor-actions.h"
|
||||||
#include "gradient-editor-commands.h"
|
#include "gradient-editor-commands.h"
|
||||||
|
|
||||||
@ -114,6 +115,15 @@ static GimpActionEntry gradient_editor_actions[] =
|
|||||||
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
|
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static GimpToggleActionEntry gradient_editor_toggle_actions[] =
|
||||||
|
{
|
||||||
|
{ "gradient-editor-edit-active", GIMP_STOCK_LINKED,
|
||||||
|
N_("Edit Active Gradient"), NULL, NULL,
|
||||||
|
G_CALLBACK (data_editor_edit_active_cmd_callback),
|
||||||
|
FALSE,
|
||||||
|
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define LOAD_LEFT_FROM(num,magic) \
|
#define LOAD_LEFT_FROM(num,magic) \
|
||||||
{ "gradient-editor-load-left-" num, NULL, \
|
{ "gradient-editor-load-left-" num, NULL, \
|
||||||
@ -323,6 +333,10 @@ gradient_editor_actions_setup (GimpActionGroup *group)
|
|||||||
gradient_editor_actions,
|
gradient_editor_actions,
|
||||||
G_N_ELEMENTS (gradient_editor_actions));
|
G_N_ELEMENTS (gradient_editor_actions));
|
||||||
|
|
||||||
|
gimp_action_group_add_toggle_actions (group,
|
||||||
|
gradient_editor_toggle_actions,
|
||||||
|
G_N_ELEMENTS (gradient_editor_toggle_actions));
|
||||||
|
|
||||||
gimp_action_group_add_enum_actions (group,
|
gimp_action_group_add_enum_actions (group,
|
||||||
gradient_editor_load_left_actions,
|
gradient_editor_load_left_actions,
|
||||||
G_N_ELEMENTS (gradient_editor_load_left_actions),
|
G_N_ELEMENTS (gradient_editor_load_left_actions),
|
||||||
@ -379,6 +393,7 @@ gradient_editor_actions_update (GimpActionGroup *group,
|
|||||||
gboolean coloring_equal = TRUE;
|
gboolean coloring_equal = TRUE;
|
||||||
gboolean selection = FALSE;
|
gboolean selection = FALSE;
|
||||||
gboolean delete = FALSE;
|
gboolean delete = FALSE;
|
||||||
|
gboolean edit_active = FALSE;
|
||||||
|
|
||||||
gradient = GIMP_GRADIENT (data_editor->data);
|
gradient = GIMP_GRADIENT (data_editor->data);
|
||||||
|
|
||||||
@ -435,6 +450,8 @@ gradient_editor_actions_update (GimpActionGroup *group,
|
|||||||
if (! GTK_WIDGET_SENSITIVE (editor))
|
if (! GTK_WIDGET_SENSITIVE (editor))
|
||||||
editable = FALSE;
|
editable = FALSE;
|
||||||
|
|
||||||
|
edit_active = gimp_data_editor_get_edit_active (data_editor);
|
||||||
|
|
||||||
#define SET_ACTIVE(action,condition) \
|
#define SET_ACTIVE(action,condition) \
|
||||||
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
#define SET_COLOR(action,color,set_label) \
|
#define SET_COLOR(action,color,set_label) \
|
||||||
@ -696,6 +713,8 @@ gradient_editor_actions_update (GimpActionGroup *group,
|
|||||||
SET_SENSITIVE ("gradient-editor-zoom-in", gradient);
|
SET_SENSITIVE ("gradient-editor-zoom-in", gradient);
|
||||||
SET_SENSITIVE ("gradient-editor-zoom-all", gradient);
|
SET_SENSITIVE ("gradient-editor-zoom-all", gradient);
|
||||||
|
|
||||||
|
SET_ACTIVE ("gradient-editor-edit-active", edit_active);
|
||||||
|
|
||||||
#undef SET_ACTIVE
|
#undef SET_ACTIVE
|
||||||
#undef SET_COLOR
|
#undef SET_COLOR
|
||||||
#undef SET_LABEL
|
#undef SET_LABEL
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimppaletteeditor.h"
|
#include "widgets/gimppaletteeditor.h"
|
||||||
|
|
||||||
|
#include "data-editor-commands.h"
|
||||||
#include "palette-editor-actions.h"
|
#include "palette-editor-actions.h"
|
||||||
#include "palette-editor-commands.h"
|
#include "palette-editor-commands.h"
|
||||||
|
|
||||||
@ -56,6 +57,15 @@ static GimpActionEntry palette_editor_actions[] =
|
|||||||
GIMP_HELP_PALETTE_EDITOR_DELETE }
|
GIMP_HELP_PALETTE_EDITOR_DELETE }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static GimpToggleActionEntry palette_editor_toggle_actions[] =
|
||||||
|
{
|
||||||
|
{ "palette-editor-edit-active", GIMP_STOCK_LINKED,
|
||||||
|
N_("Edit Active Palette"), NULL, NULL,
|
||||||
|
G_CALLBACK (data_editor_edit_active_cmd_callback),
|
||||||
|
FALSE,
|
||||||
|
GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE }
|
||||||
|
};
|
||||||
|
|
||||||
static GimpEnumActionEntry palette_editor_new_actions[] =
|
static GimpEnumActionEntry palette_editor_new_actions[] =
|
||||||
{
|
{
|
||||||
{ "palette-editor-new-color-fg", GTK_STOCK_NEW,
|
{ "palette-editor-new-color-fg", GTK_STOCK_NEW,
|
||||||
@ -100,6 +110,10 @@ palette_editor_actions_setup (GimpActionGroup *group)
|
|||||||
palette_editor_actions,
|
palette_editor_actions,
|
||||||
G_N_ELEMENTS (palette_editor_actions));
|
G_N_ELEMENTS (palette_editor_actions));
|
||||||
|
|
||||||
|
gimp_action_group_add_toggle_actions (group,
|
||||||
|
palette_editor_toggle_actions,
|
||||||
|
G_N_ELEMENTS (palette_editor_toggle_actions));
|
||||||
|
|
||||||
gimp_action_group_add_enum_actions (group,
|
gimp_action_group_add_enum_actions (group,
|
||||||
palette_editor_new_actions,
|
palette_editor_new_actions,
|
||||||
G_N_ELEMENTS (palette_editor_new_actions),
|
G_N_ELEMENTS (palette_editor_new_actions),
|
||||||
@ -122,6 +136,7 @@ palette_editor_actions_update (GimpActionGroup *group,
|
|||||||
gboolean editable = FALSE;
|
gboolean editable = FALSE;
|
||||||
GimpRGB fg;
|
GimpRGB fg;
|
||||||
GimpRGB bg;
|
GimpRGB bg;
|
||||||
|
gboolean edit_active = FALSE;
|
||||||
|
|
||||||
context = gimp_get_user_context (group->gimp);
|
context = gimp_get_user_context (group->gimp);
|
||||||
|
|
||||||
@ -139,8 +154,12 @@ palette_editor_actions_update (GimpActionGroup *group,
|
|||||||
gimp_context_get_background (context, &bg);
|
gimp_context_get_background (context, &bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
edit_active = gimp_data_editor_get_edit_active (data_editor);
|
||||||
|
|
||||||
#define SET_SENSITIVE(action,condition) \
|
#define SET_SENSITIVE(action,condition) \
|
||||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||||
|
#define SET_ACTIVE(action,condition) \
|
||||||
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
#define SET_COLOR(action,color) \
|
#define SET_COLOR(action,color) \
|
||||||
gimp_action_group_set_action_color (group, action, color, FALSE);
|
gimp_action_group_set_action_color (group, action, color, FALSE);
|
||||||
|
|
||||||
@ -157,6 +176,9 @@ palette_editor_actions_update (GimpActionGroup *group,
|
|||||||
SET_SENSITIVE ("palette-editor-zoom-in", data);
|
SET_SENSITIVE ("palette-editor-zoom-in", data);
|
||||||
SET_SENSITIVE ("palette-editor-zoom-all", data);
|
SET_SENSITIVE ("palette-editor-zoom-all", data);
|
||||||
|
|
||||||
|
SET_ACTIVE ("palette-editor-edit-active", edit_active);
|
||||||
|
|
||||||
#undef SET_SENSITIVE
|
#undef SET_SENSITIVE
|
||||||
|
#undef SET_ACTIVE
|
||||||
#undef SET_COLOR
|
#undef SET_COLOR
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,8 @@ dialogs_brush_editor_get (GimpDialogFactory *factory,
|
|||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
gint preview_size)
|
gint preview_size)
|
||||||
{
|
{
|
||||||
return gimp_brush_editor_new (context->gimp);
|
return gimp_brush_editor_new (context->gimp,
|
||||||
|
factory->menu_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
|
@ -255,6 +255,13 @@ menus_init (Gimp *gimp,
|
|||||||
"tools-menu.xml", NULL,
|
"tools-menu.xml", NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
gimp_menu_factory_manager_register (global_menu_factory, "<BrushEditor>",
|
||||||
|
"brush-editor",
|
||||||
|
NULL,
|
||||||
|
"/brush-editor-popup",
|
||||||
|
"brush-editor-menu.xml", NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
|
gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
|
||||||
"gradient-editor",
|
"gradient-editor",
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -286,7 +286,8 @@ gimp_brush_editor_set_data (GimpDataEditor *editor,
|
|||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
gimp_brush_editor_new (Gimp *gimp)
|
gimp_brush_editor_new (Gimp *gimp,
|
||||||
|
GimpMenuFactory *menu_factory)
|
||||||
{
|
{
|
||||||
GimpBrush *brush;
|
GimpBrush *brush;
|
||||||
|
|
||||||
@ -295,8 +296,11 @@ gimp_brush_editor_new (Gimp *gimp)
|
|||||||
brush = gimp_context_get_brush (gimp_get_user_context (gimp));
|
brush = gimp_context_get_brush (gimp_get_user_context (gimp));
|
||||||
|
|
||||||
return g_object_new (GIMP_TYPE_BRUSH_EDITOR,
|
return g_object_new (GIMP_TYPE_BRUSH_EDITOR,
|
||||||
"data-factory", gimp->brush_factory,
|
"menu-factory", menu_factory,
|
||||||
"data", brush,
|
"menu-identifier", "<BrushEditor>",
|
||||||
|
"ui-path", "/brush-editor-popup",
|
||||||
|
"data-factory", gimp->brush_factory,
|
||||||
|
"data", brush,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ struct _GimpBrushEditorClass
|
|||||||
|
|
||||||
GType gimp_brush_editor_get_type (void) G_GNUC_CONST;
|
GType gimp_brush_editor_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GtkWidget * gimp_brush_editor_new (Gimp *gimp);
|
GtkWidget * gimp_brush_editor_new (Gimp *gimp,
|
||||||
|
GimpMenuFactory *menu_factory);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_BRUSH_EDITOR_H__ */
|
#endif /* __GIMP_BRUSH_EDITOR_H__ */
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdata.h"
|
#include "core/gimpdata.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
|
||||||
@ -435,6 +436,52 @@ gimp_data_editor_get_data (GimpDataEditor *editor)
|
|||||||
return editor->data;
|
return editor->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_data_editor_set_edit_active (GimpDataEditor *editor,
|
||||||
|
gboolean edit_active)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DATA_EDITOR (editor));
|
||||||
|
|
||||||
|
if (editor->edit_active != edit_active)
|
||||||
|
{
|
||||||
|
GimpContext *user_context;
|
||||||
|
|
||||||
|
user_context = gimp_get_user_context (editor->data_factory->gimp);
|
||||||
|
|
||||||
|
editor->edit_active = edit_active;
|
||||||
|
|
||||||
|
if (editor->edit_active)
|
||||||
|
{
|
||||||
|
GType data_type;
|
||||||
|
GimpData *data;
|
||||||
|
|
||||||
|
data_type = editor->data_factory->container->children_type;
|
||||||
|
data = GIMP_DATA (gimp_context_get_by_type (user_context, data_type));
|
||||||
|
|
||||||
|
g_signal_connect_object (user_context,
|
||||||
|
gimp_context_type_to_signal_name (data_type),
|
||||||
|
G_CALLBACK (gimp_data_editor_set_data),
|
||||||
|
editor, G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
gimp_data_editor_set_data (editor, data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_signal_handlers_disconnect_by_func (user_context,
|
||||||
|
gimp_data_editor_set_data,
|
||||||
|
editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gimp_data_editor_get_edit_active (GimpDataEditor *editor)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GIMP_IS_DATA_EDITOR (editor), FALSE);
|
||||||
|
|
||||||
|
return editor->edit_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ struct _GimpDataEditor
|
|||||||
GimpEditor parent_instance;
|
GimpEditor parent_instance;
|
||||||
|
|
||||||
GimpDataFactory *data_factory;
|
GimpDataFactory *data_factory;
|
||||||
|
gboolean edit_active;
|
||||||
|
|
||||||
GimpData *data;
|
GimpData *data;
|
||||||
gboolean data_editable;
|
gboolean data_editable;
|
||||||
|
|
||||||
@ -62,11 +64,15 @@ struct _GimpDataEditorClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType gimp_data_editor_get_type (void) G_GNUC_CONST;
|
GType gimp_data_editor_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
void gimp_data_editor_set_data (GimpDataEditor *editor,
|
void gimp_data_editor_set_data (GimpDataEditor *editor,
|
||||||
GimpData *data);
|
GimpData *data);
|
||||||
GimpData * gimp_data_editor_get_data (GimpDataEditor *editor);
|
GimpData * gimp_data_editor_get_data (GimpDataEditor *editor);
|
||||||
|
|
||||||
|
void gimp_data_editor_set_edit_active (GimpDataEditor *editor,
|
||||||
|
gboolean edit_active);
|
||||||
|
gboolean gimp_data_editor_get_edit_active (GimpDataEditor *editor);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DATA_EDITOR_H__ */
|
#endif /* __GIMP_DATA_EDITOR_H__ */
|
||||||
|
@ -286,6 +286,7 @@
|
|||||||
#define GIMP_HELP_BRUSH_REFRESH "gimp-brush-refresh"
|
#define GIMP_HELP_BRUSH_REFRESH "gimp-brush-refresh"
|
||||||
|
|
||||||
#define GIMP_HELP_BRUSH_EDITOR_DIALOG "gimp-brush-editor-dialog"
|
#define GIMP_HELP_BRUSH_EDITOR_DIALOG "gimp-brush-editor-dialog"
|
||||||
|
#define GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE "gimp-brush-editor-edit-active"
|
||||||
|
|
||||||
#define GIMP_HELP_PATTERN_DIALOG "gimp-pattern-dialog"
|
#define GIMP_HELP_PATTERN_DIALOG "gimp-pattern-dialog"
|
||||||
#define GIMP_HELP_PATTERN_EDIT "gimp-pattern-edit"
|
#define GIMP_HELP_PATTERN_EDIT "gimp-pattern-edit"
|
||||||
@ -324,6 +325,7 @@
|
|||||||
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT "gimp-gradient-editor-zoom-out"
|
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT "gimp-gradient-editor-zoom-out"
|
||||||
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN "gimp-gradient-editor-zoom-in"
|
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN "gimp-gradient-editor-zoom-in"
|
||||||
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL "gimp-gradient-editor-zoom-all"
|
#define GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL "gimp-gradient-editor-zoom-all"
|
||||||
|
#define GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE "gimp-gradient-editor-edit-active"
|
||||||
|
|
||||||
#define GIMP_HELP_PALETTE_DIALOG "gimp-palette-dialog"
|
#define GIMP_HELP_PALETTE_DIALOG "gimp-palette-dialog"
|
||||||
#define GIMP_HELP_PALETTE_EDIT "gimp-palette-edit"
|
#define GIMP_HELP_PALETTE_EDIT "gimp-palette-edit"
|
||||||
@ -341,6 +343,7 @@
|
|||||||
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_OUT "gimp-palette-editor-zoom-out"
|
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_OUT "gimp-palette-editor-zoom-out"
|
||||||
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_IN "gimp-palette-editor-zoom-in"
|
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_IN "gimp-palette-editor-zoom-in"
|
||||||
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_ALL "gimp-palette-editor-zoom-all"
|
#define GIMP_HELP_PALETTE_EDITOR_ZOOM_ALL "gimp-palette-editor-zoom-all"
|
||||||
|
#define GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE "gimp-palette-editor-edit-active"
|
||||||
|
|
||||||
#define GIMP_HELP_FONT_DIALOG "gimp-font-dialog"
|
#define GIMP_HELP_FONT_DIALOG "gimp-font-dialog"
|
||||||
#define GIMP_HELP_FONT_REFRESH "gimp-font-refresh"
|
#define GIMP_HELP_FONT_REFRESH "gimp-font-refresh"
|
||||||
|
@ -11,6 +11,7 @@ menudata_built_files = $(menudata_in_files:.xml.in=.xml)
|
|||||||
|
|
||||||
menudata_DATA = \
|
menudata_DATA = \
|
||||||
$(menudata_built_files) \
|
$(menudata_built_files) \
|
||||||
|
brush-editor-menu.xml \
|
||||||
brushes-menu.xml \
|
brushes-menu.xml \
|
||||||
buffers-menu.xml \
|
buffers-menu.xml \
|
||||||
channels-menu.xml \
|
channels-menu.xml \
|
||||||
|
8
menus/brush-editor-menu.xml
Normal file
8
menus/brush-editor-menu.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
|
||||||
|
|
||||||
|
<ui>
|
||||||
|
<popup action="brush-editor-popup">
|
||||||
|
<menuitem action="brush-editor-edit-active" />
|
||||||
|
</popup>
|
||||||
|
</ui>
|
@ -90,5 +90,7 @@
|
|||||||
<separator />
|
<separator />
|
||||||
<menuitem action="gradient-editor-blend-color" />
|
<menuitem action="gradient-editor-blend-color" />
|
||||||
<menuitem action="gradient-editor-blend-opacity" />
|
<menuitem action="gradient-editor-blend-opacity" />
|
||||||
|
<separator />
|
||||||
|
<menuitem action="gradient-editor-edit-active" />
|
||||||
</popup>
|
</popup>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -11,5 +11,7 @@
|
|||||||
<menuitem action="palette-editor-zoom-out" />
|
<menuitem action="palette-editor-zoom-out" />
|
||||||
<menuitem action="palette-editor-zoom-in" />
|
<menuitem action="palette-editor-zoom-in" />
|
||||||
<menuitem action="palette-editor-zoom-all" />
|
<menuitem action="palette-editor-zoom-all" />
|
||||||
|
<separator />
|
||||||
|
<menuitem action="palette-editor-edit-active" />
|
||||||
</popup>
|
</popup>
|
||||||
</ui>
|
</ui>
|
||||||
|
Reference in New Issue
Block a user