From 03e91b64f4311c8959d9a8fc75d123ba232c9ba9 Mon Sep 17 00:00:00 2001 From: zhenfeng zhao Date: Tue, 28 Jul 2009 16:52:53 -0300 Subject: [PATCH] Add menu item for dynamics dockable (menu bits) actions/actions.c actions/dialogs-actions.c dialogs/dialogs-constructors.c menus/menus.c menus/plug-in-menus.c pdb/makefile.msc ../etc/ps-menurc ../menus/Makefile.am ../menus/dialogs-menuitems.xml: add dynamics editor. ../menus/dynamics-editor-menu.xml: (new file) --- app/actions/actions.c | 3 +++ app/actions/dialogs-actions.c | 6 ++++++ app/dialogs/dialogs-constructors.c | 9 +++++++++ app/menus/menus.c | 14 +++++++++++++- app/menus/plug-in-menus.c | 7 +++++++ app/pdb/makefile.msc | 1 + etc/ps-menurc | 1 + menus/Makefile.am | 1 + menus/dialogs-menuitems.xml | 1 + menus/dynamics-editor-menu.xml | 8 ++++++++ 10 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 menus/dynamics-editor-menu.xml diff --git a/app/actions/actions.c b/app/actions/actions.c index f84b27c96d..4a3a4b2aba 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -103,6 +103,9 @@ static const GimpActionFactoryEntry action_groups[] = { "brush-editor", N_("Brush Editor"), GIMP_STOCK_BRUSH, brush_editor_actions_setup, brush_editor_actions_update }, + { "dynamics-editor", N_("Dynamics Editor"), GIMP_STOCK_BRUSH, + brush_editor_actions_setup, + brush_editor_actions_update }, { "brushes", N_("Brushes"), GIMP_STOCK_BRUSH, brushes_actions_setup, brushes_actions_update }, diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c index 30ad3b61e8..ab073408d5 100644 --- a/app/actions/dialogs-actions.c +++ b/app/actions/dialogs-actions.c @@ -123,6 +123,12 @@ const GimpStringActionEntry dialogs_dockable_actions[] = NC_("dialogs-action", "Open the brush editor"), "gimp-brush-editor", GIMP_HELP_BRUSH_EDIT }, + + { "dialogs-dynamics-editor", GIMP_STOCK_BRUSH, + NC_("dialogs-action", "Dynamics Editor"), NULL, + NC_("dialogs-action", "Open the dynamics editor"), + "gimp-dynamics-editor", + GIMP_HELP_BRUSH_EDIT }, { "dialogs-patterns", GIMP_STOCK_PATTERN, NC_("dialogs-action", "P_atterns"), "P", diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index e71493cafc..81df9a7068 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -669,6 +669,15 @@ dialogs_brush_editor_get (GimpDialogFactory *factory, factory->menu_factory); } +GtkWidget * +dialogs_dynamics_editor_get (GimpDialogFactory *factory, + GimpContext *context, + gint view_size) +{ + return gimp_brush_editor_new (context, + factory->menu_factory); +} + GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory, GimpContext *context, diff --git a/app/menus/menus.c b/app/menus/menus.c index 2fe93bf229..be284aae11 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -274,7 +274,19 @@ menus_init (Gimp *gimp, "/brush-editor-popup", "brush-editor-menu.xml", NULL, NULL); - + + gimp_menu_factory_manager_register (global_menu_factory, "", + "dynamics-editor", + NULL, + "/dynamics-editor-popup", + "dynamics-editor-menu.xml", NULL, + NULL); +/* + gimp_menu_factory_manager_register (global_menu_factory, "", + "dynamics", + NULL, + NULL); +*/ gimp_menu_factory_manager_register (global_menu_factory, "", "gradient-editor", NULL, diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index 1f0ff1ff4c..3e9ede88c8 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -317,10 +317,17 @@ plug_in_menus_menu_path_added (GimpPlugInProcedure *plug_in_proc, plug_in_menus_add_proc (manager, "/colormap-popup", plug_in_proc, menu_path); } + else if (! strcmp (manager->name, "")) { plug_in_menus_add_proc (manager, "/brushes-popup", plug_in_proc, menu_path); + } + + else if (! strcmp (manager->name, "")) + { + plug_in_menus_add_proc (manager, "/dynamics-popup", + plug_in_proc, menu_path); } else if (! strcmp (manager->name, "")) { diff --git a/app/pdb/makefile.msc b/app/pdb/makefile.msc index a877479d21..28f9f65f65 100644 --- a/app/pdb/makefile.msc +++ b/app/pdb/makefile.msc @@ -38,6 +38,7 @@ OBJECTS = \ internal-procs.obj \ brush-cmds.obj \ brushes-cmds.obj \ + dynamics-cmds.obj \ buffer-cmds.obj \ channel-cmds.obj \ color-cmds.obj \ diff --git a/etc/ps-menurc b/etc/ps-menurc index 458682d0fc..bb889d134e 100644 --- a/etc/ps-menurc +++ b/etc/ps-menurc @@ -18,6 +18,7 @@ (gtk_accel_path "/layers/layers-alpha-selection-replace" "a") (gtk_accel_path "/dialogs/dialogs-layers" "F7") (gtk_accel_path "/dialogs/dialogs-brushes" "") +(gtk_accel_path "/dialogs/dialogs-dynamics" "") (gtk_accel_path "/view/view-info-window" "F8") (gtk_accel_path "/layers/layers-duplicate" "j") (gtk_accel_path "/dialogs/dialogs-channels" "F7") diff --git a/menus/Makefile.am b/menus/Makefile.am index ee1717d408..18f536d004 100644 --- a/menus/Makefile.am +++ b/menus/Makefile.am @@ -11,6 +11,7 @@ menudata_built_files = $(menudata_in_files:.xml.in=.xml) menudata_DATA = \ $(menudata_built_files) \ brush-editor-menu.xml \ + dynamics-editor-menu.xml \ brushes-menu.xml \ buffers-menu.xml \ channels-menu.xml \ diff --git a/menus/dialogs-menuitems.xml b/menus/dialogs-menuitems.xml index fd7a0ed701..c9f8b1a916 100644 --- a/menus/dialogs-menuitems.xml +++ b/menus/dialogs-menuitems.xml @@ -17,6 +17,7 @@ + diff --git a/menus/dynamics-editor-menu.xml b/menus/dynamics-editor-menu.xml new file mode 100644 index 0000000000..2f7ccf87b7 --- /dev/null +++ b/menus/dynamics-editor-menu.xml @@ -0,0 +1,8 @@ + + + + + + + +