Further changes to make dynamics editor and its menu.

actions/Makefile.am
   actions/actions.c
   dialogs/dialogs-constructors.c
   dialogs/dialogs-constructors.h: further change on menu work.

   actions/dynamics-editor-actions.c
   actions/dynamics-editor-actions.h (new files): add actions for dynamics.
This commit is contained in:
zhenfeng zhao 2009-07-30 11:55:17 -03:00
parent 03e91b64f4
commit 8480477f9d
6 changed files with 138 additions and 5 deletions

View File

@ -23,6 +23,8 @@ libappactions_a_SOURCES = \
brush-editor-actions.h \
brushes-actions.c \
brushes-actions.h \
dynamics-editor-actions.c \
dynamics-editor-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
@ -178,4 +180,6 @@ libappactions_a_SOURCES = \
windows-commands.c \
windows-commands.h
EXTRA_DIST = makefile.msc
EXTRA_DIST = makefile.msc \
dynamics-editor-actions.c\
dynamics-editor-actions.h

View File

@ -49,6 +49,7 @@
#include "actions.h"
#include "brush-editor-actions.h"
#include "dynamics-editor-actions.h"
#include "brushes-actions.h"
#include "buffers-actions.h"
#include "channels-actions.h"
@ -104,8 +105,8 @@ static const GimpActionFactoryEntry action_groups[] =
brush_editor_actions_setup,
brush_editor_actions_update },
{ "dynamics-editor", N_("Dynamics Editor"), GIMP_STOCK_BRUSH,
brush_editor_actions_setup,
brush_editor_actions_update },
dynamics_editor_actions_setup,
dynamics_editor_actions_update },
{ "brushes", N_("Brushes"), GIMP_STOCK_BRUSH,
brushes_actions_setup,
brushes_actions_update },

View File

@ -0,0 +1,97 @@
/* GIMP - The GNU 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#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 "dynamics-editor-actions.h"
#include "data-editor-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry dynamics_editor_actions[] =
{
{ "dynamics-editor-popup", GIMP_STOCK_BRUSH,
NC_("dynamics-editor-action", "Dynamics Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_EDITOR_DIALOG }
};
static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
{
{ "dynamics-editor-edit-active", GIMP_STOCK_LINKED,
NC_("dynamics-editor-action", "Edit Brush Dynamics"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
};
void
dynamics_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "dynamics-editor-action",
dynamics_editor_actions,
G_N_ELEMENTS (dynamics_editor_actions));
gimp_action_group_add_toggle_actions (group, "dynamics-editor-action",
dynamics_editor_toggle_actions,
G_N_ELEMENTS (dynamics_editor_toggle_actions));
}
void
dynamics_editor_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
GimpData *data;
gboolean editable = FALSE;
gboolean edit_active = FALSE;
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 ("dynamics-editor-edit-active", edit_active);
#undef SET_SENSITIVE
#undef SET_ACTIVE
}

View File

@ -0,0 +1,27 @@
/* GIMP - The GNU 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef __DYNAMICS_EDITOR_ACTIONS_H__
#define __DYNAMICS_EDITOR_ACTIONS_H__
void dynamics_editor_actions_setup (GimpActionGroup *group);
void dynamics_editor_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DYNAMICS_EDITOR_ACTIONS_H__ */

View File

@ -32,6 +32,7 @@
#include "config/gimpguiconfig.h"
#include "widgets/gimpbrusheditor.h"
//#include "widgets/gimpdynamicseditor.h"
#include "widgets/gimpbrushfactoryview.h"
#include "widgets/gimpbufferview.h"
#include "widgets/gimpchanneltreeview.h"
@ -674,8 +675,8 @@ dialogs_dynamics_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint view_size)
{
return gimp_brush_editor_new (context,
factory->menu_factory);
//return gimp_dynamics_editor_new (context,
// factory->menu_factory);
}
GtkWidget *

View File

@ -190,6 +190,9 @@ GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint view_size);
GtkWidget * dialogs_dynamics_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint view_size);
GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint view_size);