gimp/app/widgets/gimpdialogfactory.c

1554 lines
50 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
cleanup. 2001-04-22 Michael Natterer <mitch@gimp.org> * app/Makefile.am: cleanup. * app/interface.c: #include "gimpui.h" * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c * app/gui/menus.c * app/gui/test-commands.[ch]: changes for the image menu below. * app/apptypes.h * app/widgets/Makefile.am * app/widgets/gimpcontainermenu.[ch] * app/widgets/gimpcontainermenuimpl.[ch]: new widgets. The actual implemtation lives in a separate file because gimpcontainermenu.c's code is identical to gimpcontainerview.c's except for the base class. This will become an interface with Gtk 2.0. * app/widgets/gimpimagedock.[ch]: a dock with an image menu. The pages still don't follow the context correctly. * app/widgets/gimpmenuitem.[ch]: a menu item with a preview. * app/widgets/gimpdialogfactory.[ch]: pass a dock constructor to the constructor and provide a method to create a new dock within this factory's context. * app/widgets/gimpdock.[ch]: removed the constructor because we create only image docks now. Put the vbox into a main_vbox (which also contains the image menu). * app/widgets/gimpdockbook.[ch]: create new docks with the dialog factory. * app/gimpcontainer.[ch] * app/gimpdata.[ch] * app/gimpdatafactory.[ch] * app/gimpdatalist.[ch] * app/gimplist.[ch] * app/gimpviewable.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerlistview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdockable.[ch] * app/widgets/gimpdrawablelistitem.[ch] * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimplayerlistitem.[ch] * app/widgets/gimplayerlistview.[ch] * app/widgets/gimplistitem.[ch] * app/widgets/gimppalettepreview.[ch] * app/widgets/gimppatternpreview.[ch] * app/widgets/gimppreview.[ch]: ass-sign some copyrights.
2001-04-22 08:38:56 +08:00
* gimpdialogfactory.c
Implement the presistent menu of recently closed docks, still somewhat 2008-05-16 Michael Natterer <mitch@gimp.org> Implement the presistent menu of recently closed docks, still somewhat hackish but fully functional. Fixes bug #132744. * app/actions/dialogs-actions.c * app/actions/dialogs-commands.[ch] * menus/image-menu.xml.in: remove the menu items that were creating the hardcoded preconfigured docks. * app/dialogs/dialogs.[ch]: add GimpContainer of recently closed docks and API to load and save it. * app/gui/session.c: call the recent dock load and save functions. * app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface and (de)serialize via proper interface methods. * app/gui/session.c * app/widgets/gimpdialogfactory.c: use the GimpConfig API to (de)serialize session infos and added the code that was formerly in the info's (de)serialize functions but didn't belong there. * app/widgets/gimpaction.[ch]: add "max-width-chars" property and set it on proxy menu item labels. * app/actions/windows-actions.[ch] * app/actions/windows-commands.[ch] * app/menus/windows-menu.c: add actions and menu of recently closed docks and code to restore the dock when the menu items are selected. Use above new action property to ensure a minimum width of the menu. * app/widgets/gimpmenudock.c: use '-' instead of '|' for separating notebooks in the window title. Menu items don't like '|'. * app/widgets/gimpdock.c: removed the confirmation dialog when closing docks and simply add them to the recent docks container. This code is totally misplaced and will move to another file soon. svn path=/trunk/; revision=25671
2008-05-17 00:06:42 +08:00
* Copyright (C) 2001-2008 Michael Natterer <mitch@gimp.org>
cleanup. 2001-04-22 Michael Natterer <mitch@gimp.org> * app/Makefile.am: cleanup. * app/interface.c: #include "gimpui.h" * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c * app/gui/menus.c * app/gui/test-commands.[ch]: changes for the image menu below. * app/apptypes.h * app/widgets/Makefile.am * app/widgets/gimpcontainermenu.[ch] * app/widgets/gimpcontainermenuimpl.[ch]: new widgets. The actual implemtation lives in a separate file because gimpcontainermenu.c's code is identical to gimpcontainerview.c's except for the base class. This will become an interface with Gtk 2.0. * app/widgets/gimpimagedock.[ch]: a dock with an image menu. The pages still don't follow the context correctly. * app/widgets/gimpmenuitem.[ch]: a menu item with a preview. * app/widgets/gimpdialogfactory.[ch]: pass a dock constructor to the constructor and provide a method to create a new dock within this factory's context. * app/widgets/gimpdock.[ch]: removed the constructor because we create only image docks now. Put the vbox into a main_vbox (which also contains the image menu). * app/widgets/gimpdockbook.[ch]: create new docks with the dialog factory. * app/gimpcontainer.[ch] * app/gimpdata.[ch] * app/gimpdatafactory.[ch] * app/gimpdatalist.[ch] * app/gimplist.[ch] * app/gimpviewable.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerlistview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdockable.[ch] * app/widgets/gimpdrawablelistitem.[ch] * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimplayerlistitem.[ch] * app/widgets/gimplayerlistview.[ch] * app/widgets/gimplistitem.[ch] * app/widgets/gimppalettepreview.[ch] * app/widgets/gimppatternpreview.[ch] * app/widgets/gimppreview.[ch]: ass-sign some copyrights.
2001-04-22 08:38:56 +08:00
*
* 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 <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
Implement the presistent menu of recently closed docks, still somewhat 2008-05-16 Michael Natterer <mitch@gimp.org> Implement the presistent menu of recently closed docks, still somewhat hackish but fully functional. Fixes bug #132744. * app/actions/dialogs-actions.c * app/actions/dialogs-commands.[ch] * menus/image-menu.xml.in: remove the menu items that were creating the hardcoded preconfigured docks. * app/dialogs/dialogs.[ch]: add GimpContainer of recently closed docks and API to load and save it. * app/gui/session.c: call the recent dock load and save functions. * app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface and (de)serialize via proper interface methods. * app/gui/session.c * app/widgets/gimpdialogfactory.c: use the GimpConfig API to (de)serialize session infos and added the code that was formerly in the info's (de)serialize functions but didn't belong there. * app/widgets/gimpaction.[ch]: add "max-width-chars" property and set it on proxy menu item labels. * app/actions/windows-actions.[ch] * app/actions/windows-commands.[ch] * app/menus/windows-menu.c: add actions and menu of recently closed docks and code to restore the dock when the menu items are selected. Use above new action property to ensure a minimum width of the menu. * app/widgets/gimpmenudock.c: use '-' instead of '|' for separating notebooks in the window title. Menu items don't like '|'. * app/widgets/gimpdock.c: removed the confirmation dialog when closing docks and simply add them to the recent docks container. This code is totally misplaced and will move to another file soon. svn path=/trunk/; revision=25671
2008-05-17 00:06:42 +08:00
#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpmarshal.h"
#include "gimpcursor.h"
#include "gimpdialogfactory.h"
#include "gimpdock.h"
#include "gimpdockbook.h"
#include "gimpdockable.h"
#include "gimpdockwindow.h"
Move away from creating all item_factories statically in menus_init() but 2003-01-10 Michael Natterer <mitch@gimp.org> Move away from creating all item_factories statically in menus_init() but create a new one for each place where one is needed: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpmenufactory.[ch]: new factory which creates and configures the GimpItemFactories it knows about on-the-fly. * app/widgets/gimpitemfactory.[ch]: added gimp_item_factory_update() which calls the "update_func". Added "gboolean update_on_popup" so item_factories can be configured to require manual updates (used for the <Image> factory). * app/gui/menus.[ch]: create a "global_menu_factory" and register all menus we have with it. Added various setup functions which do stuff like adding the "Open Recent" menu or reorder plug-in menu entries. Removed the debugging stuff... * app/gui/Makefile.am * app/gui/debug-commands.[ch]: ...and added it here. * app/gui/gui.c: create the <Toolbox>, the popup-<Image> and the <Paths> factories here because they are still global. * app/gui/plug-in-menus.[ch]: changed the "image_factory" parameters to "item_factory" and create/update the entries for the passed item_factory only. Makes the whole stuff much more straightforward. * app/plug-in/plug-ins.c: don't call plug_in_make_menu(). * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: added "menu_factory" and "popup_factory" parameters to gimp_display_new() and gimp_display_shell_new(). Create the menubar_factory and the qmask_factory dynamically. Pass the shell, not a Gimp to the QMask callbacks. Changed gimp_display_shell_set_menu_sensitivity() to gimp_display_shell_menu_update() and don't call it directly (it's a GimpItemFactory update_func now). Call gimp_item_factory_update() on the resp. factories instead. * app/gui/qmask-commands.c * app/display/gimpdisplayshell-callbacks.c * app/tools/gimpimagemaptool.c: changed accordingly. * app/widgets/gimpbrusheditor.c * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcolormapeditor.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdock.c * app/widgets/gimpdockbook.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemlistview.[ch] * app/widgets/gimppaletteeditor.[ch]: pass around lots of GimpMenuFactory pointers and menu_identifiers so all views can create their item_factories themselves. Unref the factories when they are no longer needed because they belong to the views now. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/brush-select.c * app/gui/gradient-select.c * app/gui/palette-select.c * app/gui/pattern-select.c: changed accordingly. * app/gui/file-dialog-utils.[ch] (file_dialog_new): require menu_factory and menu_identifier parameters. * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch]: removed file_*_dialog_menu_init() (they went to menus.c as setup_funcs). Added file_*_dialog_set_type() and moved the <Load> and <Save> factory callbacks to file-commands.c * app/gui/file-commands.[ch]: changed accordingly. * app/gui/view-commands.c: changed the statusbar, menubar, rulers and guides callbacks to do their job only if the setting has actually changed. Don't update whole item factories afterwards. Instead, just change the state of the items that actually need update. Unrelated: * app/core/gimpchannel.c (gimp_channel_init): set "bounds_known" and friends to FALSE since we don't know that the new channel will be empty (fixes QMask and probably other stuff). * app/gui/image-commands.c * app/gui/vectors-commands.c: cleanup.
2003-01-11 01:55:53 +08:00
#include "gimpmenufactory.h"
#include "gimpsessioninfo.h"
#include "gimpwidgets-utils.h"
#include "gimp-log.h"
enum
{
DOCK_WINDOW_ADDED,
DOCK_WINDOW_REMOVED,
LAST_SIGNAL
};
struct _GimpDialogFactoryPrivate
{
GimpContext *context;
GimpMenuFactory *menu_factory;
GList *open_dialogs;
GList *session_infos;
GList *registered_dialogs;
GimpDialogsState dialog_state;
};
static void gimp_dialog_factory_dispose (GObject *object);
static void gimp_dialog_factory_finalize (GObject *object);
static GtkWidget * gimp_dialog_factory_constructor (GimpDialogFactory *factory,
GimpDialogFactoryEntry *entry,
GimpContext *context,
GimpUIManager *ui_manager,
gint view_size);
static void gimp_dialog_factory_config_notify (GimpDialogFactory *factory,
GParamSpec *pspec,
GimpGuiConfig *config);
static void gimp_dialog_factory_set_widget_data (GtkWidget *dialog,
GimpDialogFactory *factory,
GimpDialogFactoryEntry *entry);
static void gimp_dialog_factory_unset_widget_data (GtkWidget *dialog);
static gboolean gimp_dialog_factory_set_user_pos (GtkWidget *dialog,
GdkEventConfigure *cevent,
gpointer data);
static gboolean gimp_dialog_factory_dialog_configure (GtkWidget *dialog,
GdkEventConfigure *cevent,
GimpDialogFactory *factory);
static void gimp_dialog_factory_hide (GimpDialogFactory *factory);
static void gimp_dialog_factory_show (GimpDialogFactory *factory);
G_DEFINE_TYPE (GimpDialogFactory, gimp_dialog_factory, GIMP_TYPE_OBJECT)
#define parent_class gimp_dialog_factory_parent_class
static guint factory_signals[LAST_SIGNAL] = { 0 };
/* Is set by dialogs.c to a dialog factory initialized there.
*
* FIXME: The layer above should not do this kind of initialization of
* layers below.
*/
static GimpDialogFactory *gimp_toplevel_factory = NULL;
static void
gimp_dialog_factory_class_init (GimpDialogFactoryClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gimp_dialog_factory_dispose;
2001-08-14 22:54:22 +08:00
object_class->finalize = gimp_dialog_factory_finalize;
factory_signals[DOCK_WINDOW_ADDED] =
g_signal_new ("dock-window-added",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpDialogFactoryClass, dock_window_added),
NULL, NULL,
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DOCK_WINDOW);
factory_signals[DOCK_WINDOW_REMOVED] =
g_signal_new ("dock-window-removed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpDialogFactoryClass, dock_window_removed),
NULL, NULL,
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DOCK_WINDOW);
g_type_class_add_private (klass, sizeof (GimpDialogFactoryPrivate));
}
static void
gimp_dialog_factory_init (GimpDialogFactory *factory)
{
factory->p = G_TYPE_INSTANCE_GET_PRIVATE (factory,
GIMP_TYPE_DIALOG_FACTORY,
GimpDialogFactoryPrivate);
factory->p->dialog_state = GIMP_DIALOGS_SHOWN;
}
static void
gimp_dialog_factory_dispose (GObject *object)
{
GimpDialogFactory *factory = GIMP_DIALOG_FACTORY (object);
GList *list;
/* start iterating from the beginning each time we destroyed a
* toplevel because destroying a dock may cause lots of items
* to be removed from factory->p->open_dialogs
*/
while (factory->p->open_dialogs)
{
for (list = factory->p->open_dialogs; list; list = g_list_next (list))
{
if (gtk_widget_is_toplevel (list->data))
{
gtk_widget_destroy (GTK_WIDGET (list->data));
break;
}
}
/* the list being non-empty without any toplevel is an error,
* so eek and chain up
*/
if (! list)
{
g_warning ("%s: %d stale non-toplevel entries in factory->p->open_dialogs",
G_STRFUNC, g_list_length (factory->p->open_dialogs));
break;
}
}
if (factory->p->open_dialogs)
{
g_list_free (factory->p->open_dialogs);
factory->p->open_dialogs = NULL;
}
if (factory->p->session_infos)
{
g_list_foreach (factory->p->session_infos, (GFunc) g_object_unref, NULL);
g_list_free (factory->p->session_infos);
factory->p->session_infos = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
2001-08-14 22:54:22 +08:00
gimp_dialog_factory_finalize (GObject *object)
{
GimpDialogFactory *factory = GIMP_DIALOG_FACTORY (object);
GList *list;
for (list = factory->p->registered_dialogs; list; list = g_list_next (list))
{
GimpDialogFactoryEntry *entry = list->data;
g_free (entry->identifier);
g_free (entry->name);
g_free (entry->blurb);
g_free (entry->stock_id);
g_free (entry->help_id);
g_slice_free (GimpDialogFactoryEntry, entry);
}
if (factory->p->registered_dialogs)
2001-08-14 22:54:22 +08:00
{
g_list_free (factory->p->registered_dialogs);
factory->p->registered_dialogs = NULL;
2001-08-14 22:54:22 +08:00
}
2001-08-14 22:54:22 +08:00
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GimpDialogFactory *
gimp_dialog_factory_new (const gchar *name,
GimpContext *context,
GimpMenuFactory *menu_factory)
{
GimpDialogFactory *factory;
GimpGuiConfig *config;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
Move away from creating all item_factories statically in menus_init() but 2003-01-10 Michael Natterer <mitch@gimp.org> Move away from creating all item_factories statically in menus_init() but create a new one for each place where one is needed: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpmenufactory.[ch]: new factory which creates and configures the GimpItemFactories it knows about on-the-fly. * app/widgets/gimpitemfactory.[ch]: added gimp_item_factory_update() which calls the "update_func". Added "gboolean update_on_popup" so item_factories can be configured to require manual updates (used for the <Image> factory). * app/gui/menus.[ch]: create a "global_menu_factory" and register all menus we have with it. Added various setup functions which do stuff like adding the "Open Recent" menu or reorder plug-in menu entries. Removed the debugging stuff... * app/gui/Makefile.am * app/gui/debug-commands.[ch]: ...and added it here. * app/gui/gui.c: create the <Toolbox>, the popup-<Image> and the <Paths> factories here because they are still global. * app/gui/plug-in-menus.[ch]: changed the "image_factory" parameters to "item_factory" and create/update the entries for the passed item_factory only. Makes the whole stuff much more straightforward. * app/plug-in/plug-ins.c: don't call plug_in_make_menu(). * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: added "menu_factory" and "popup_factory" parameters to gimp_display_new() and gimp_display_shell_new(). Create the menubar_factory and the qmask_factory dynamically. Pass the shell, not a Gimp to the QMask callbacks. Changed gimp_display_shell_set_menu_sensitivity() to gimp_display_shell_menu_update() and don't call it directly (it's a GimpItemFactory update_func now). Call gimp_item_factory_update() on the resp. factories instead. * app/gui/qmask-commands.c * app/display/gimpdisplayshell-callbacks.c * app/tools/gimpimagemaptool.c: changed accordingly. * app/widgets/gimpbrusheditor.c * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcolormapeditor.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdock.c * app/widgets/gimpdockbook.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemlistview.[ch] * app/widgets/gimppaletteeditor.[ch]: pass around lots of GimpMenuFactory pointers and menu_identifiers so all views can create their item_factories themselves. Unref the factories when they are no longer needed because they belong to the views now. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/brush-select.c * app/gui/gradient-select.c * app/gui/palette-select.c * app/gui/pattern-select.c: changed accordingly. * app/gui/file-dialog-utils.[ch] (file_dialog_new): require menu_factory and menu_identifier parameters. * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch]: removed file_*_dialog_menu_init() (they went to menus.c as setup_funcs). Added file_*_dialog_set_type() and moved the <Load> and <Save> factory callbacks to file-commands.c * app/gui/file-commands.[ch]: changed accordingly. * app/gui/view-commands.c: changed the statusbar, menubar, rulers and guides callbacks to do their job only if the setting has actually changed. Don't update whole item factories afterwards. Instead, just change the state of the items that actually need update. Unrelated: * app/core/gimpchannel.c (gimp_channel_init): set "bounds_known" and friends to FALSE since we don't know that the new channel will be empty (fixes QMask and probably other stuff). * app/gui/image-commands.c * app/gui/vectors-commands.c: cleanup.
2003-01-11 01:55:53 +08:00
g_return_val_if_fail (! menu_factory || GIMP_IS_MENU_FACTORY (menu_factory),
NULL);
factory = g_object_new (GIMP_TYPE_DIALOG_FACTORY, NULL);
gimp_object_set_name (GIMP_OBJECT (factory), name);
config = GIMP_GUI_CONFIG (context->gimp->config);
factory->p->context = context;
factory->p->menu_factory = menu_factory;
factory->p->dialog_state = (config->hide_docks ?
GIMP_DIALOGS_HIDDEN_EXPLICITLY :
GIMP_DIALOGS_SHOWN);
g_signal_connect_object (config, "notify::hide-docks",
G_CALLBACK (gimp_dialog_factory_config_notify),
factory, G_CONNECT_SWAPPED);
return factory;
}
void
gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
const gchar *identifier,
const gchar *name,
const gchar *blurb,
const gchar *stock_id,
const gchar *help_id,
GimpDialogNewFunc new_func,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
gint view_size,
gboolean singleton,
gboolean session_managed,
gboolean remember_size,
gboolean remember_if_open,
gboolean hideable,
gboolean dockable)
{
GimpDialogFactoryEntry *entry;
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
g_return_if_fail (identifier != NULL);
entry = g_slice_new0 (GimpDialogFactoryEntry);
entry->identifier = g_strdup (identifier);
entry->name = g_strdup (name);
entry->blurb = g_strdup (blurb);
entry->stock_id = g_strdup (stock_id);
entry->help_id = g_strdup (help_id);
entry->new_func = new_func;
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
entry->view_size = view_size;
entry->singleton = singleton ? TRUE : FALSE;
entry->session_managed = session_managed ? TRUE : FALSE;
entry->remember_size = remember_size ? TRUE : FALSE;
entry->remember_if_open = remember_if_open ? TRUE : FALSE;
entry->hideable = hideable ? TRUE : FALSE;
entry->dockable = dockable ? TRUE : FALSE;
factory->p->registered_dialogs = g_list_prepend (factory->p->registered_dialogs,
entry);
}
GimpDialogFactoryEntry *
gimp_dialog_factory_find_entry (GimpDialogFactory *factory,
const gchar *identifier)
{
GList *list;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
for (list = factory->p->registered_dialogs; list; list = g_list_next (list))
{
GimpDialogFactoryEntry *entry = list->data;
if (! strcmp (identifier, entry->identifier))
return entry;
}
return NULL;
}
GimpSessionInfo *
gimp_dialog_factory_find_session_info (GimpDialogFactory *factory,
const gchar *identifier)
{
GList *list;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
for (list = factory->p->session_infos; list; list = g_list_next (list))
{
GimpSessionInfo *info = list->data;
if (gimp_session_info_get_factory_entry (info) &&
g_str_equal (identifier,
gimp_session_info_get_factory_entry (info)->identifier))
{
return info;
}
}
return NULL;
}
/**
* gimp_dialog_factory_dialog_sane:
* @factory:
* @widget_factory:
* @widget_entry:
* @widget:
*
* Makes sure that the @widget with the given @widget_entry that was
* created by the given @widget_factory belongs to @efactory.
*
* Returns: %TRUE if that is the case, %FALSE otherwise.
**/
static gboolean
gimp_dialog_factory_dialog_sane (GimpDialogFactory *factory,
GimpDialogFactory *widget_factory,
GimpDialogFactoryEntry *widget_entry,
GtkWidget *widget)
{
if (! widget_factory || ! widget_entry)
{
g_warning ("%s: dialog was not created by a GimpDialogFactory",
G_STRFUNC);
return FALSE;
}
if (widget_factory != factory)
{
g_warning ("%s: dialog was created by a different GimpDialogFactory",
G_STRFUNC);
return FALSE;
}
return TRUE;
}
static GtkWidget *
gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
GdkScreen *screen,
GimpContext *context,
GimpUIManager *ui_manager,
const gchar *identifier,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
gint view_size,
gboolean return_existing,
gboolean present)
{
GimpDialogFactoryEntry *entry = NULL;
GtkWidget *dialog = NULL;
GtkWidget *toplevel = NULL;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
entry = gimp_dialog_factory_find_entry (factory, identifier);
if (! entry)
{
g_warning ("%s: no entry registered for \"%s\"",
G_STRFUNC, identifier);
return NULL;
}
if (! entry->new_func)
{
g_warning ("%s: entry for \"%s\" has no constructor",
G_STRFUNC, identifier);
return NULL;
}
/* a singleton dialog is always returned if it already exisits */
if (return_existing || entry->singleton)
{
GimpSessionInfo *info;
info = gimp_dialog_factory_find_session_info (factory, identifier);
if (info)
dialog = gimp_session_info_get_widget (info);
}
/* create the dialog if it was not found */
if (! dialog)
{
GtkWidget *dock = NULL;
GtkWidget *dock_window = NULL;
gboolean called_from_raise = FALSE;
called_from_raise = (context == NULL);
Move away from creating all item_factories statically in menus_init() but 2003-01-10 Michael Natterer <mitch@gimp.org> Move away from creating all item_factories statically in menus_init() but create a new one for each place where one is needed: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpmenufactory.[ch]: new factory which creates and configures the GimpItemFactories it knows about on-the-fly. * app/widgets/gimpitemfactory.[ch]: added gimp_item_factory_update() which calls the "update_func". Added "gboolean update_on_popup" so item_factories can be configured to require manual updates (used for the <Image> factory). * app/gui/menus.[ch]: create a "global_menu_factory" and register all menus we have with it. Added various setup functions which do stuff like adding the "Open Recent" menu or reorder plug-in menu entries. Removed the debugging stuff... * app/gui/Makefile.am * app/gui/debug-commands.[ch]: ...and added it here. * app/gui/gui.c: create the <Toolbox>, the popup-<Image> and the <Paths> factories here because they are still global. * app/gui/plug-in-menus.[ch]: changed the "image_factory" parameters to "item_factory" and create/update the entries for the passed item_factory only. Makes the whole stuff much more straightforward. * app/plug-in/plug-ins.c: don't call plug_in_make_menu(). * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: added "menu_factory" and "popup_factory" parameters to gimp_display_new() and gimp_display_shell_new(). Create the menubar_factory and the qmask_factory dynamically. Pass the shell, not a Gimp to the QMask callbacks. Changed gimp_display_shell_set_menu_sensitivity() to gimp_display_shell_menu_update() and don't call it directly (it's a GimpItemFactory update_func now). Call gimp_item_factory_update() on the resp. factories instead. * app/gui/qmask-commands.c * app/display/gimpdisplayshell-callbacks.c * app/tools/gimpimagemaptool.c: changed accordingly. * app/widgets/gimpbrusheditor.c * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcolormapeditor.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdock.c * app/widgets/gimpdockbook.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemlistview.[ch] * app/widgets/gimppaletteeditor.[ch]: pass around lots of GimpMenuFactory pointers and menu_identifiers so all views can create their item_factories themselves. Unref the factories when they are no longer needed because they belong to the views now. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/brush-select.c * app/gui/gradient-select.c * app/gui/palette-select.c * app/gui/pattern-select.c: changed accordingly. * app/gui/file-dialog-utils.[ch] (file_dialog_new): require menu_factory and menu_identifier parameters. * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch]: removed file_*_dialog_menu_init() (they went to menus.c as setup_funcs). Added file_*_dialog_set_type() and moved the <Load> and <Save> factory callbacks to file-commands.c * app/gui/file-commands.[ch]: changed accordingly. * app/gui/view-commands.c: changed the statusbar, menubar, rulers and guides callbacks to do their job only if the setting has actually changed. Don't update whole item factories afterwards. Instead, just change the state of the items that actually need update. Unrelated: * app/core/gimpchannel.c (gimp_channel_init): set "bounds_known" and friends to FALSE since we don't know that the new channel will be empty (fixes QMask and probably other stuff). * app/gui/image-commands.c * app/gui/vectors-commands.c: cleanup.
2003-01-11 01:55:53 +08:00
/* What follows is special-case code for some entires. At some
* point we might want to abstract this block of code away.
*/
if (called_from_raise)
{
if (entry->dockable)
{
GtkWidget *dockbook;
/* It doesn't make sense to have a dockable without a dock
* so create one. Create a new dock _before_ creating the
* dialog. We do this because the new dockable needs to be
* created in its dock's context.
*/
dock = gimp_dock_with_window_new (factory,
screen,
FALSE /*toolbox*/);
dockbook = gimp_dockbook_new (factory->p->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock),
GIMP_DOCKBOOK (dockbook),
0);
}
else if (strcmp ("gimp-toolbox", entry->identifier) == 0)
{
dock_window = gimp_dialog_factory_dialog_new (factory,
screen,
NULL /*ui_manager*/,
"gimp-toolbox-window",
-1 /*view_size*/,
FALSE /*present*/);
/* When we get a dock window, we also get a UI
* manager
*/
ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
}
}
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
/* Create the new dialog in the appropriate context which is
* - the passed context if not NULL
* - the newly created dock's context if we just created it
* - the factory's context, which happens when raising a toplevel
* dialog was the original request.
*/
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
if (view_size < GIMP_VIEW_SIZE_TINY)
view_size = entry->view_size;
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
if (context)
dialog = gimp_dialog_factory_constructor (factory, entry,
context,
ui_manager,
view_size);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
else if (dock)
dialog = gimp_dialog_factory_constructor (factory, entry,
gimp_dock_get_context (GIMP_DOCK (dock)),
gimp_dock_get_ui_manager (GIMP_DOCK (dock)),
view_size);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
else
dialog = gimp_dialog_factory_constructor (factory, entry,
factory->p->context,
ui_manager,
view_size);
if (dialog)
{
gimp_dialog_factory_set_widget_data (dialog, factory, entry);
/* If we created a dock before, the newly created dialog is
* supposed to be a GimpDockable.
*/
if (dock)
{
if (GIMP_IS_DOCKABLE (dialog))
{
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dialog),
0, 0);
gtk_widget_show (dock);
}
else
{
g_warning ("%s: GimpDialogFactory is a dockable factory "
"but constructor for \"%s\" did not return a "
"GimpDockable",
G_STRFUNC, identifier);
gtk_widget_destroy (dialog);
gtk_widget_destroy (dock);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
dialog = NULL;
dock = NULL;
}
}
else if (dock_window)
{
if (GIMP_IS_DOCK (dialog))
{
gimp_dock_window_add_dock (GIMP_DOCK_WINDOW (dock_window),
GIMP_DOCK (dialog),
-1 /*index*/);
gtk_widget_set_visible (dialog, present);
gtk_widget_set_visible (dock_window, present);
}
else
{
g_warning ("%s: GimpDialogFactory is a dock factory entry "
"but constructor for \"%s\" did not return a "
"GimpDock",
G_STRFUNC, identifier);
gtk_widget_destroy (dialog);
gtk_widget_destroy (dock_window);
dialog = NULL;
dock_window = NULL;
}
}
}
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
else if (dock)
{
g_warning ("%s: constructor for \"%s\" returned NULL",
G_STRFUNC, identifier);
gtk_widget_destroy (dock);
dock = NULL;
}
if (dialog)
gimp_dialog_factory_add_dialog (factory, dialog);
}
/* Finally, if we found an existing dialog or created a new one, raise it.
*/
if (! dialog)
return NULL;
if (gtk_widget_is_toplevel (dialog))
{
gtk_window_set_screen (GTK_WINDOW (dialog), screen);
toplevel = dialog;
}
else if (GIMP_IS_DOCK (dialog))
{
toplevel = gtk_widget_get_toplevel (dialog);
}
else if (GIMP_IS_DOCKABLE (dialog))
{
GimpDockable *dockable = GIMP_DOCKABLE (dialog);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
if (gimp_dockable_get_dockbook (dockable) &&
gimp_dockbook_get_dock (gimp_dockable_get_dockbook (dockable)))
{
GtkNotebook *notebook = GTK_NOTEBOOK (gimp_dockable_get_dockbook (dockable));
gint num = gtk_notebook_page_num (notebook, dialog);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
if (num != -1)
{
gtk_notebook_set_current_page (notebook, num);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
gimp_dockable_blink (dockable);
}
}
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
toplevel = gtk_widget_get_toplevel (dialog);
}
if (present && toplevel != NULL && GTK_IS_WINDOW (toplevel))
gtk_window_present (GTK_WINDOW (toplevel));
return dialog;
}
/**
* gimp_dialog_factory_dialog_new:
* @factory: a #GimpDialogFactory
* @screen: the #GdkScreen the dialog should appear on
* @ui_manager: A #GimpUIManager, if applicable.
* @identifier: the identifier of the dialog as registered with
* gimp_dialog_factory_register_entry()
2009-09-15 03:39:46 +08:00
* @view_size: the initial preview size
* @present: whether gtk_window_present() should be called
*
* Creates a new toplevel dialog or a #GimpDockable, depending on whether
* %factory is a toplevel of dockable factory.
*
* Return value: the newly created dialog or an already existing singleton
* dialog.
**/
GtkWidget *
gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
GdkScreen *screen,
GimpUIManager *ui_manager,
const gchar *identifier,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
gint view_size,
gboolean present)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
return gimp_dialog_factory_dialog_new_internal (factory,
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
screen,
factory->p->context,
ui_manager,
identifier,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
view_size,
FALSE,
present);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
}
GimpContext *
gimp_dialog_factory_get_context (GimpDialogFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
return factory->p->context;
}
GimpMenuFactory *
gimp_dialog_factory_get_menu_factory (GimpDialogFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
return factory->p->menu_factory;
}
GList *
gimp_dialog_factory_get_open_dialogs (GimpDialogFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
return factory->p->open_dialogs;
}
GList *
gimp_dialog_factory_get_session_infos (GimpDialogFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
return factory->p->session_infos;
}
void
gimp_dialog_factory_add_session_info (GimpDialogFactory *factory,
GimpSessionInfo *info)
{
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
/* We want to append rather than prepend so that the serialized
* order in sessionrc remains the same
*/
factory->p->session_infos = g_list_append (factory->p->session_infos, info);
}
/**
* gimp_dialog_factory_dialog_raise:
* @factory: a #GimpDialogFactory
* @screen: the #GdkScreen the dialog should appear on
* @identifiers: a '|' separated list of identifiers of dialogs as
* registered with gimp_dialog_factory_register_entry()
2009-09-15 03:39:46 +08:00
* @view_size: the initial preview size if a dialog needs to be created
*
* Raises any of a list of already existing toplevel dialog or
* #GimpDockable if it was already created by this %facory.
*
* Implicitly creates the first dialog in the list if none of the dialogs
* were found.
*
* Return value: the raised or newly created dialog.
**/
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
GtkWidget *
gimp_dialog_factory_dialog_raise (GimpDialogFactory *factory,
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
GdkScreen *screen,
const gchar *identifiers,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
gint view_size)
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
{
GtkWidget *dialog;
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
g_return_val_if_fail (identifiers != NULL, NULL);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
/* If the identifier is a list, try to find a matching dialog and
* raise it. If there's no match, use the first list item.
*/
if (strchr (identifiers, '|'))
{
gchar **ids = g_strsplit (identifiers, "|", 0);
gint i;
for (i = 0; ids[i]; i++)
{
GimpSessionInfo *info;
info = gimp_dialog_factory_find_session_info (factory, ids[i]);
if (info && gimp_session_info_get_widget (info))
break;
}
dialog = gimp_dialog_factory_dialog_new_internal (factory,
screen,
NULL,
NULL,
ids[i] ? ids[i] : ids[0],
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
view_size,
TRUE,
TRUE);
g_strfreev (ids);
}
else
{
dialog = gimp_dialog_factory_dialog_new_internal (factory,
screen,
NULL,
NULL,
identifiers,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
view_size,
TRUE,
TRUE);
}
return dialog;
}
/**
* gimp_dialog_factory_dockable_new:
* @factory: a #GimpDialogFactory
* @dock: a #GimpDock crated by this %factory.
* @identifier: the identifier of the dialog as registered with
* gimp_dialog_factory_register_entry()
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
* @view_size:
*
* Creates a new #GimpDockable in the context of the #GimpDock it will be
* added to.
*
* Implicitly raises & returns an already existing singleton dockable,
* so callers should check that gimp_dockable_get_dockbook (dockable)
* is NULL before trying to add it to it's #GimpDockbook.
*
* Return value: the newly created #GimpDockable or an already existing
* singleton dockable.
**/
GtkWidget *
gimp_dialog_factory_dockable_new (GimpDialogFactory *factory,
GimpDock *dock,
const gchar *identifier,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
gint view_size)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
return gimp_dialog_factory_dialog_new_internal (factory,
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
gtk_widget_get_screen (GTK_WIDGET (dock)),
gimp_dock_get_context (dock),
gimp_dock_get_ui_manager (dock),
identifier,
app/actions/dockable-actions.c app/actions/dockable-commands.[ch] 2006-01-17 Michael Natterer <mitch@gimp.org> * app/actions/dockable-actions.c * app/actions/dockable-commands.[ch] * app/dialogs/dialogs-constructors.[ch] * app/dialogs/dialogs.c * app/display/gimpdisplayshell-layer-select.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpbufferview.[ch] * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcomponenteditor.[ch] * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainerentry.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerpopup.[ch] * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpfontview.[ch] * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpimageview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimppatternfactoryview.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpsessioninfo.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.[ch] * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpviewablebox.c * app/widgets/gimpviewablebutton.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpviewrenderer.c: change the word "preview" to "view" whereever we talk about GimpView or GimpViewRenderer objects or their sizes. Ther were renamed from "Preview" a long time ago and we had a preview/view naming mess ever since.
2006-01-17 18:08:50 +08:00
view_size,
FALSE,
FALSE);
}
void
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
GtkWidget *dialog)
{
GimpDialogFactory *dialog_factory = NULL;
GimpDialogFactoryEntry *entry = NULL;
GimpSessionInfo *info = NULL;
GList *list = NULL;
gboolean toplevel = FALSE;
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
g_return_if_fail (GTK_IS_WIDGET (dialog));
if (g_list_find (factory->p->open_dialogs, dialog))
{
g_warning ("%s: dialog already registered", G_STRFUNC);
return;
}
dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry);
if (! gimp_dialog_factory_dialog_sane (factory,
dialog_factory,
entry,
dialog))
return;
toplevel = gtk_widget_is_toplevel (dialog);
if (entry) /* dialog is a toplevel (but not a GimpDockWindow) or a GimpDockable */
{
GIMP_LOG (DIALOG_FACTORY, "adding %s \"%s\"",
toplevel ? "toplevel" : "dockable",
entry->identifier);
for (list = factory->p->session_infos; list; list = g_list_next (list))
{
GimpSessionInfo *current_info = list->data;
if (gimp_session_info_get_factory_entry (current_info) == entry)
{
if (gimp_session_info_get_widget (current_info))
{
if (gimp_session_info_is_singleton (current_info))
{
g_warning ("%s: singleton dialog \"%s\" created twice",
G_STRFUNC, entry->identifier);
GIMP_LOG (DIALOG_FACTORY,
"corrupt session info: %p (widget %p)",
current_info,
gimp_session_info_get_widget (current_info));
return;
}
continue;
}
gimp_session_info_set_widget (current_info, dialog);
GIMP_LOG (DIALOG_FACTORY,
"updating session info %p (widget %p) for %s \"%s\"",
current_info, gimp_session_info_get_widget (current_info),
toplevel ? "toplevel" : "dockable",
entry->identifier);
if (toplevel &&
gimp_session_info_is_session_managed (current_info) &&
! gtk_widget_get_visible (dialog))
{
gimp_session_info_apply_geometry (current_info);
}
info = current_info;
break;
}
}
if (! info)
{
info = gimp_session_info_new ();
gimp_session_info_set_widget (info, dialog);
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
GIMP_LOG (DIALOG_FACTORY,
"creating session info %p (widget %p) for %s \"%s\"",
info, gimp_session_info_get_widget (info),
toplevel ? "toplevel" : "dockable",
entry->identifier);
gimp_session_info_set_factory_entry (info, entry);
if (gimp_session_info_is_session_managed (info))
{
/* Make the dialog show up at the user position the
* first time it is shown. After it has been shown the
* first time we don't want it to show at the mouse the
* next time. Think of the use cases "hide and show with
* tab" and "change virtual desktops"
*/
GIMP_LOG (WM, "setting GTK_WIN_POS_MOUSE for %p (\"%s\")\n",
dialog, entry->identifier);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
g_signal_connect (dialog, "configure-event",
G_CALLBACK (gimp_dialog_factory_set_user_pos),
NULL);
}
factory->p->session_infos = g_list_append (factory->p->session_infos, info);
}
}
/* Some special logic for dock windows */
if (GIMP_IS_DOCK_WINDOW (dialog))
{
g_signal_emit (factory, factory_signals[DOCK_WINDOW_ADDED], 0, dialog);
}
factory->p->open_dialogs = g_list_prepend (factory->p->open_dialogs, dialog);
g_signal_connect_object (dialog, "destroy",
G_CALLBACK (gimp_dialog_factory_remove_dialog),
factory,
G_CONNECT_SWAPPED);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
if (gimp_session_info_is_session_managed (info))
g_signal_connect_object (dialog, "configure-event",
G_CALLBACK (gimp_dialog_factory_dialog_configure),
factory,
0);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
}
void
gimp_dialog_factory_add_foreign (GimpDialogFactory *factory,
const gchar *identifier,
GtkWidget *dialog)
{
GimpDialogFactory *dialog_factory;
GimpDialogFactoryEntry *entry;
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
g_return_if_fail (identifier != NULL);
g_return_if_fail (GTK_IS_WIDGET (dialog));
g_return_if_fail (gtk_widget_is_toplevel (dialog));
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
if (dialog_factory || entry)
{
g_warning ("%s: dialog was created by a GimpDialogFactory",
G_STRFUNC);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
return;
}
entry = gimp_dialog_factory_find_entry (factory, identifier);
if (! entry)
{
g_warning ("%s: no entry registered for \"%s\"",
G_STRFUNC, identifier);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
return;
}
if (entry->new_func)
{
g_warning ("%s: entry for \"%s\" has a constructor (is not foreign)",
G_STRFUNC, identifier);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
return;
}
gimp_dialog_factory_set_widget_data (dialog, factory, entry);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
gimp_dialog_factory_add_dialog (factory, dialog);
}
void
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
GtkWidget *dialog)
{
GimpDialogFactory *dialog_factory;
GimpDialogFactoryEntry *entry;
GList *list;
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
g_return_if_fail (GTK_IS_WIDGET (dialog));
if (! g_list_find (factory->p->open_dialogs, dialog))
{
g_warning ("%s: dialog not registered", G_STRFUNC);
return;
}
factory->p->open_dialogs = g_list_remove (factory->p->open_dialogs, dialog);
dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry);
if (! gimp_dialog_factory_dialog_sane (factory,
dialog_factory,
entry,
dialog))
return;
GIMP_LOG (DIALOG_FACTORY, "removing \"%s\" (dialog = %p)",
entry->identifier,
dialog);
for (list = factory->p->session_infos; list; list = g_list_next (list))
{
GimpSessionInfo *session_info = list->data;
if (gimp_session_info_get_widget (session_info) == dialog)
{
GIMP_LOG (DIALOG_FACTORY,
"clearing session info %p (widget %p) for \"%s\"",
session_info, gimp_session_info_get_widget (session_info),
entry->identifier);
gimp_session_info_set_widget (session_info, NULL);
gimp_dialog_factory_unset_widget_data (dialog);
g_signal_handlers_disconnect_by_func (dialog,
gimp_dialog_factory_set_user_pos,
NULL);
g_signal_handlers_disconnect_by_func (dialog,
gimp_dialog_factory_remove_dialog,
factory);
if (gimp_session_info_is_session_managed (session_info))
g_signal_handlers_disconnect_by_func (dialog,
gimp_dialog_factory_dialog_configure,
factory);
if (GIMP_IS_DOCK_WINDOW (dialog))
{
/* don't save session info for empty docks */
factory->p->session_infos = g_list_remove (factory->p->session_infos,
session_info);
g_object_unref (session_info);
g_signal_emit (factory, factory_signals[DOCK_WINDOW_REMOVED], 0,
dialog);
}
removed GimpFillType. 2001-06-29 Michael Natterer <mitch@gimp.org> * app/appenums.h: removed GimpFillType. * app/gimprc.c: parse the session-info's new "aux-info" field. * app/global_edit.[ch]: removed the old "Paste Named" dialog and prefixed all functions with "gimp_". * app/core/core-types.h: added GimpFillType. * app/core/gimpbrush.[ch]: new signal "spacing_changed". * app/gui/Makefile.am * app/gui/tools-commands.[ch]: one more file cut out of commands.[ch]. * app/gui/commands.[ch]: removed the tools stuff here. * app/gui/brush-select.[ch] * app/gui/dialogs-constructors.c: use the new GimpBrushFactoryView (see below). * app/gui/dialogs-commands.[ch] * app/gui/menus.[ch]: - Made it 64bit safe again by passing the dialog factory's identifiers as GQuarks, not as guints created by GPOINTER_TO_UINT(). - Added a "gchar *quark_string" field to GimpItemFactoryEntry which gets transformed into a GQuark by menus_create_item(). - Added SEPARATOR() and BRANCH() macros which make the *_entries[] arrays more readable. - Added a menu item to show/hide GimpImageDock's image menu. - Removed file_last_opened_cmd_callback(). * app/gui/edit-commands.c: the global_edit functions are "gimp_" prefixed now. * app/gui/file-commands.[ch]: added file_last_opened_cmd_callback() here. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpbrushfactoryview.[ch]: new widget: a GimpDataFactory subclass with a "spacing" scale. * app/widgets/gimpcontainereditor.[ch]: - Connect to the GimpContainerView's "select_item", "activate_item" and "context_item" signals here once instead of in each subclass and dispatch them via new virtual functions. - Added a convenience function which makes DND to the buttons much less painful for subclasses. * app/widgets/gimpbufferview.c * app/widgets/gimpdatafactoryview.[ch]: changed accordingly. * app/widgets/gimpdialogfactory.[ch]: - Added gimp_dialog_factory_dialog_raise() which can raise toplevel dialogs _and_ dockables (and creates them if they are not open yet). - Keep track of all created dialogs (not only toplevels). - Added an "aux_info" field to GimpSessionInfo which is a GList of gchar* and is saved in sessionrc. - Remember if GimpImageDock's image menu is visible by using an aux_info string. - The code did not become nicer with all those new constraints. I have to add comments before I forget how it works. * app/widgets/gimpdockbook.c: set the state of the "Show Image Menu" menu item before popping up the item factory. * app/widgets/gimpimagedock.[ch]: added gimp_image_dock_set_show_image_meu(). * plug-ins/gdyntext/gdyntext.c * plug-ins/perl/examples/fit-text * plug-ins/perl/examples/terral_text * plug-ins/perl/examples/tex-to-float: register all text rendering plug-ins under <Image>/Filters/Text * app/pdb/brush_select_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/enums.pl * po/POTFILES.in: changed according to all the stuff above.
2001-06-30 03:25:03 +08:00
break;
}
}
}
void
gimp_dialog_factory_hide_dialog (GtkWidget *dialog)
{
GimpDialogFactory *factory = NULL;
g_return_if_fail (GTK_IS_WIDGET (dialog));
g_return_if_fail (gtk_widget_is_toplevel (dialog));
if (! (factory = gimp_dialog_factory_from_widget (dialog, NULL)))
{
g_warning ("%s: dialog was not created by a GimpDialogFactory",
G_STRFUNC);
return;
}
gtk_widget_hide (dialog);
if (factory->p->dialog_state != GIMP_DIALOGS_SHOWN)
g_object_set_data (G_OBJECT (dialog), GIMP_DIALOG_VISIBILITY_KEY,
GINT_TO_POINTER (GIMP_DIALOG_VISIBILITY_INVISIBLE));
}
void
gimp_dialog_factory_set_state (GimpDialogFactory *factory,
GimpDialogsState state)
{
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
factory->p->dialog_state = state;
if (state == GIMP_DIALOGS_SHOWN)
{
gimp_dialog_factory_show (factory);
}
else
{
gimp_dialog_factory_hide (factory);
}
}
GimpDialogsState
gimp_dialog_factory_get_state (GimpDialogFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), 0);
return factory->p->dialog_state;
}
void
gimp_dialog_factory_show_with_display (GimpDialogFactory *factory)
{
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
if (factory->p->dialog_state == GIMP_DIALOGS_HIDDEN_WITH_DISPLAY)
{
gimp_dialog_factory_set_state (factory, GIMP_DIALOGS_SHOWN);
}
}
void
gimp_dialog_factory_hide_with_display (GimpDialogFactory *factory)
{
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
if (factory->p->dialog_state == GIMP_DIALOGS_SHOWN)
{
gimp_dialog_factory_set_state (factory, GIMP_DIALOGS_HIDDEN_WITH_DISPLAY);
}
}
static GQuark gimp_dialog_factory_key = 0;
static GQuark gimp_dialog_factory_entry_key = 0;
GimpDialogFactory *
gimp_dialog_factory_from_widget (GtkWidget *dialog,
GimpDialogFactoryEntry **entry)
{
g_return_val_if_fail (GTK_IS_WIDGET (dialog), NULL);
if (! gimp_dialog_factory_key)
{
gimp_dialog_factory_key =
g_quark_from_static_string ("gimp-dialog-factory");
gimp_dialog_factory_entry_key =
g_quark_from_static_string ("gimp-dialog-factory-entry");
}
if (entry)
*entry = g_object_get_qdata (G_OBJECT (dialog),
gimp_dialog_factory_entry_key);
return g_object_get_qdata (G_OBJECT (dialog), gimp_dialog_factory_key);
}
#define GIMP_DIALOG_FACTORY_MIN_SIZE_KEY "gimp-dialog-factory-min-size"
void
gimp_dialog_factory_set_has_min_size (GtkWindow *window,
gboolean has_min_size)
{
g_return_if_fail (GTK_IS_WINDOW (window));
g_object_set_data (G_OBJECT (window), GIMP_DIALOG_FACTORY_MIN_SIZE_KEY,
GINT_TO_POINTER (has_min_size ? TRUE : FALSE));
}
gboolean
gimp_dialog_factory_get_has_min_size (GtkWindow *window)
{
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window),
GIMP_DIALOG_FACTORY_MIN_SIZE_KEY));
}
/* private functions */
static GtkWidget *
gimp_dialog_factory_constructor (GimpDialogFactory *factory,
GimpDialogFactoryEntry *entry,
GimpContext *context,
GimpUIManager *ui_manager,
gint view_size)
{
GtkWidget *widget;
widget = entry->new_func (factory, context, ui_manager, view_size);
/* The entry is for a dockable, so we simply need to put the created
* widget in a dockable
*/
if (widget && entry->dockable)
{
GtkWidget *dockable = NULL;
dockable = gimp_dockable_new (entry->name, entry->blurb,
entry->stock_id, entry->help_id);
gtk_container_add (GTK_CONTAINER (dockable), widget);
gtk_widget_show (widget);
/* EEK */
g_object_set_data (G_OBJECT (dockable), "gimp-dialog-identifier",
entry->identifier);
/* Return the dockable instead */
widget = dockable;
}
return widget;
}
static void
gimp_dialog_factory_config_notify (GimpDialogFactory *factory,
GParamSpec *pspec,
GimpGuiConfig *config)
{
GimpDialogsState state = gimp_dialog_factory_get_state (factory);
GimpDialogsState new_state = state;
/* Make sure the state and config are in sync */
if (config->hide_docks && state == GIMP_DIALOGS_SHOWN)
new_state = GIMP_DIALOGS_HIDDEN_EXPLICITLY;
else if (! config->hide_docks)
new_state = GIMP_DIALOGS_SHOWN;
if (state != new_state)
gimp_dialog_factory_set_state (factory, new_state);
}
static void
gimp_dialog_factory_set_widget_data (GtkWidget *dialog,
GimpDialogFactory *factory,
GimpDialogFactoryEntry *entry)
{
g_return_if_fail (GTK_IS_WIDGET (dialog));
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
if (! gimp_dialog_factory_key)
{
gimp_dialog_factory_key =
g_quark_from_static_string ("gimp-dialog-factory");
gimp_dialog_factory_entry_key =
g_quark_from_static_string ("gimp-dialog-factory-entry");
}
g_object_set_qdata (G_OBJECT (dialog), gimp_dialog_factory_key, factory);
if (entry)
g_object_set_qdata (G_OBJECT (dialog), gimp_dialog_factory_entry_key,
entry);
}
static void
gimp_dialog_factory_unset_widget_data (GtkWidget *dialog)
{
g_return_if_fail (GTK_IS_WIDGET (dialog));
if (! gimp_dialog_factory_key)
return;
g_object_set_qdata (G_OBJECT (dialog), gimp_dialog_factory_key, NULL);
g_object_set_qdata (G_OBJECT (dialog), gimp_dialog_factory_entry_key, NULL);
}
static gboolean
gimp_dialog_factory_set_user_pos (GtkWidget *dialog,
GdkEventConfigure *cevent,
gpointer data)
{
GdkWindowHints geometry_mask;
/* Not only set geometry hints, also reset window position */
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_NONE);
g_signal_handlers_disconnect_by_func (dialog,
gimp_dialog_factory_set_user_pos,
data);
GIMP_LOG (WM, "setting GDK_HINT_USER_POS for %p\n", dialog);
geometry_mask = GDK_HINT_USER_POS;
if (gimp_dialog_factory_get_has_min_size (GTK_WINDOW (dialog)))
geometry_mask |= GDK_HINT_MIN_SIZE;
gtk_window_set_geometry_hints (GTK_WINDOW (dialog), NULL, NULL,
geometry_mask);
return FALSE;
}
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
static gboolean
gimp_dialog_factory_dialog_configure (GtkWidget *dialog,
GdkEventConfigure *cevent,
GimpDialogFactory *factory)
{
GimpDialogFactory *dialog_factory;
GimpDialogFactoryEntry *entry;
GList *list;
if (! g_list_find (factory->p->open_dialogs, dialog))
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
{
g_warning ("%s: dialog not registered", G_STRFUNC);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
return FALSE;
}
dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
if (! gimp_dialog_factory_dialog_sane (factory,
dialog_factory,
entry,
dialog))
return FALSE;
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
for (list = factory->p->session_infos; list; list = g_list_next (list))
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
{
GimpSessionInfo *session_info = list->data;
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
if (gimp_session_info_get_widget (session_info) == dialog)
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
{
gimp_session_info_read_geometry (session_info);
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
GIMP_LOG (DIALOG_FACTORY,
"updated session info for \"%s\" from window geometry "
"(x=%d y=%d %dx%d)",
entry->identifier,
gimp_session_info_get_x (session_info),
gimp_session_info_get_y (session_info),
gimp_session_info_get_width (session_info),
gimp_session_info_get_height (session_info));
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
break;
}
added new function gimp_dialog_factory_add_foreign() which adds a dialog 2003-05-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new function gimp_dialog_factory_add_foreign() which adds a dialog that was not created by the factory itself. Its identifier however must be registered with the factory. Connect to all toplevel dialogs' "configure_event" and remember the resulting window geometry so we get session management for *all* dialogs, not only for those which were open on exit. * app/gui/dialogs.c: added the "File New" dialog. Added foreign entries (without constructor) for all dialogs opened by tools. * app/gui/dialogs-constructors.[ch]: added a constructor for the file_new dialog. * app/gui/file-new-dialog.[ch]: renamed file_new_dialog_create() to file_new_dialog_new() and removed the gimage and template paramaters. Adder new function file_new_dialog_set() to set gimage and template after creation. * app/gui/file-commands.c * app/gui/templates-commands.c: changed accordingly. * app/tools/gimpimagemaptool.[ch] * app/tools/gimptransformtool.[ch]: added "const gchar *shell_identifier" to the tool structs. Register the tool dialogs using gimp_dialog_factory_add_foreign(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpthresholdtool.c: set "shell_identifier" so the dialogs become session managed. Fixes bug #61091. * app/tools/gimpcroptool.c: register the crop dialog with the dialog factory. Fixes bug #52849. * app/tools/gimpcolorpickertool.c: ditto. Unrelated: * app/tools/gimptool.c: no need to cast the return value of g_object_new().
2003-05-03 02:43:15 +08:00
}
return FALSE;
}
void
gimp_dialog_factory_save (GimpDialogFactory *factory,
GimpConfigWriter *writer)
{
GList *infos;
Added configurable styles for dockable tabs (fixes bug #87376): 2003-07-08 Michael Natterer <mitch@gimp.org> Added configurable styles for dockable tabs (fixes bug #87376): * app/widgets/widgets-enums.[ch]: added new enum GimpTabStyle which can be one on { ICON, NAME, ICON_NAME, ICON_BLURB }. * app/widgets/gimpdockable.[ch]: added a GimpTabStyle member to the GimpDockable struct which defaults to GIMP_TAB_STYLE_ICON. Renamed "short_name" to "name" and "name" to "blurb". Renamed GimpDockableGetTabFunc to GimpDockableGetIconFunc. Implemented all tab styles in gimp_dockable_real_get_tab_widget() and use the "get_icon_func" only for creating the tab's icon, not the entire tab widget. * app/widgets/gimpdockbook.[ch]: changed accordingly. Create the menu widgets and the DND icon using gimp_dockable_get_tab_widget() with tab_style == GIMP_TAB_STYLE_ICON_BLURB instead of duplicating tons of code. Made gimp_dockbook_get_tab_widget() public because it's needed for exchanging tabs on-the-fly. * app/widgets/gimpimagedock.c: changed accordingly. * app/widgets/gimpdialogfactory.c: remember the dockables' tab style in sessionrc. * app/gui/dialogs-menu.c: added a submenu to select the tab style for each dockable. * app/gui/dialogs-commands.[ch]: new callback dialogs_tab_style_cmd_callback(). * app/gui/dialogs-constructors.[ch]: added stock_ids to all dockables, swapped the "name" and "blurb" parameters, reordered functions, cleanup. * app/gui/dialogs-menu.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: use GIMP_STOCK_DEFAULT_COLORS for the color editor dockable and renamed it to "FG/BG Color".
2003-07-08 23:07:56 +08:00
for (infos = factory->p->session_infos; infos; infos = g_list_next (infos))
{
GimpSessionInfo *info = infos->data;
/* we keep session info entries for all toplevel dialogs created
* by the factory but don't save them if they don't want to be
* managed
*/
if (! gimp_session_info_is_session_managed (info) ||
gimp_session_info_get_factory_entry (info) == NULL)
continue;
if (gimp_session_info_get_widget (info))
gimp_session_info_get_info (info);
Implement the presistent menu of recently closed docks, still somewhat 2008-05-16 Michael Natterer <mitch@gimp.org> Implement the presistent menu of recently closed docks, still somewhat hackish but fully functional. Fixes bug #132744. * app/actions/dialogs-actions.c * app/actions/dialogs-commands.[ch] * menus/image-menu.xml.in: remove the menu items that were creating the hardcoded preconfigured docks. * app/dialogs/dialogs.[ch]: add GimpContainer of recently closed docks and API to load and save it. * app/gui/session.c: call the recent dock load and save functions. * app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface and (de)serialize via proper interface methods. * app/gui/session.c * app/widgets/gimpdialogfactory.c: use the GimpConfig API to (de)serialize session infos and added the code that was formerly in the info's (de)serialize functions but didn't belong there. * app/widgets/gimpaction.[ch]: add "max-width-chars" property and set it on proxy menu item labels. * app/actions/windows-actions.[ch] * app/actions/windows-commands.[ch] * app/menus/windows-menu.c: add actions and menu of recently closed docks and code to restore the dock when the menu items are selected. Use above new action property to ensure a minimum width of the menu. * app/widgets/gimpmenudock.c: use '-' instead of '|' for separating notebooks in the window title. Menu items don't like '|'. * app/widgets/gimpdock.c: removed the confirmation dialog when closing docks and simply add them to the recent docks container. This code is totally misplaced and will move to another file soon. svn path=/trunk/; revision=25671
2008-05-17 00:06:42 +08:00
gimp_config_writer_open (writer, "session-info");
gimp_config_writer_string (writer,
gimp_object_get_name (factory));
Implement the presistent menu of recently closed docks, still somewhat 2008-05-16 Michael Natterer <mitch@gimp.org> Implement the presistent menu of recently closed docks, still somewhat hackish but fully functional. Fixes bug #132744. * app/actions/dialogs-actions.c * app/actions/dialogs-commands.[ch] * menus/image-menu.xml.in: remove the menu items that were creating the hardcoded preconfigured docks. * app/dialogs/dialogs.[ch]: add GimpContainer of recently closed docks and API to load and save it. * app/gui/session.c: call the recent dock load and save functions. * app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface and (de)serialize via proper interface methods. * app/gui/session.c * app/widgets/gimpdialogfactory.c: use the GimpConfig API to (de)serialize session infos and added the code that was formerly in the info's (de)serialize functions but didn't belong there. * app/widgets/gimpaction.[ch]: add "max-width-chars" property and set it on proxy menu item labels. * app/actions/windows-actions.[ch] * app/actions/windows-commands.[ch] * app/menus/windows-menu.c: add actions and menu of recently closed docks and code to restore the dock when the menu items are selected. Use above new action property to ensure a minimum width of the menu. * app/widgets/gimpmenudock.c: use '-' instead of '|' for separating notebooks in the window title. Menu items don't like '|'. * app/widgets/gimpdock.c: removed the confirmation dialog when closing docks and simply add them to the recent docks container. This code is totally misplaced and will move to another file soon. svn path=/trunk/; revision=25671
2008-05-17 00:06:42 +08:00
GIMP_CONFIG_GET_INTERFACE (info)->serialize (GIMP_CONFIG (info),
writer,
NULL);
gimp_config_writer_close (writer);
if (gimp_session_info_get_widget (info))
gimp_session_info_clear_info (info);
}
}
void
gimp_dialog_factory_restore (GimpDialogFactory *factory)
{
GList *infos;
for (infos = factory->p->session_infos; infos; infos = g_list_next (infos))
{
GimpSessionInfo *info = infos->data;
if (gimp_session_info_get_open (info))
{
gimp_session_info_restore (info, factory);
gimp_session_info_clear_info (info);
}
else
{
GIMP_LOG (DIALOG_FACTORY,
"skipping to restore session info %p, not open",
info);
}
}
}
static void
gimp_dialog_factory_hide (GimpDialogFactory *factory)
{
GList *list;
for (list = factory->p->open_dialogs; list; list = g_list_next (list))
{
GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{
GimpDialogFactoryEntry *entry = NULL;
GimpDialogVisibilityState visibility = GIMP_DIALOG_VISIBILITY_UNKNOWN;
gimp_dialog_factory_from_widget (widget, &entry);
if (! entry->hideable)
continue;
if (gtk_widget_get_visible (widget))
{
gtk_widget_hide (widget);
visibility = GIMP_DIALOG_VISIBILITY_HIDDEN;
2009-07-20 17:01:56 +08:00
GIMP_LOG (WM, "Hiding '%s' [%p]",
gtk_window_get_title (GTK_WINDOW (widget)),
widget);
}
else
{
visibility = GIMP_DIALOG_VISIBILITY_INVISIBLE;
}
g_object_set_data (G_OBJECT (widget),
GIMP_DIALOG_VISIBILITY_KEY,
GINT_TO_POINTER (visibility));
}
}
}
static void
gimp_dialog_factory_show (GimpDialogFactory *factory)
{
GList *list;
for (list = factory->p->open_dialogs; list; list = g_list_next (list))
{
GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{
GimpDialogVisibilityState visibility;
visibility =
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
GIMP_DIALOG_VISIBILITY_KEY));
if (! gtk_widget_get_visible (widget) &&
visibility == GIMP_DIALOG_VISIBILITY_HIDDEN)
{
2009-07-20 17:01:56 +08:00
GIMP_LOG (WM, "Showing '%s' [%p]",
gtk_window_get_title (GTK_WINDOW (widget)),
widget);
/* Don't use gtk_window_present() here, we don't want the
* keyboard focus to move.
*/
gtk_widget_show (widget);
g_object_set_data (G_OBJECT (widget),
GIMP_DIALOG_VISIBILITY_KEY,
GINT_TO_POINTER (GIMP_DIALOG_VISIBILITY_VISIBLE));
if (gtk_widget_get_visible (widget))
app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c 2009-03-22 Michael Natterer <mitch@gimp.org> * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcolordialog.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcursor.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpdockable.c * app/widgets/gimperrordialog.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpgradientselect.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpmessagedialog.c * app/widgets/gimpnavigationview.c * app/widgets/gimppaletteselect.c * app/widgets/gimppaletteview.c * app/widgets/gimppatternselect.c * app/widgets/gimpprogressbox.c * app/widgets/gimpprogressdialog.c * app/widgets/gimpscalebutton.c * app/widgets/gimpselectiondata.c * app/widgets/gimpsessioninfo.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpuimanager.c * app/widgets/gimpview-popup.c * app/widgets/gimpview.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpwidgets-utils.c: use accessors for various members of GTK+ structures that don't exist any longer when GSEAL_ENABLE is defined. svn path=/trunk/; revision=28193
2009-03-23 00:35:53 +08:00
gdk_window_raise (gtk_widget_get_window (widget));
}
}
}
}
void
gimp_dialog_factory_set_busy (GimpDialogFactory *factory)
{
GdkDisplay *display = NULL;
GdkCursor *cursor = NULL;
GList *list;
if (! factory)
return;
for (list = factory->p->open_dialogs; list; list = g_list_next (list))
{
GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{
if (!display || display != gtk_widget_get_display (widget))
{
display = gtk_widget_get_display (widget);
if (cursor)
gdk_cursor_unref (cursor);
cursor = gimp_cursor_new (display,
GIMP_CURSOR_FORMAT_BITMAP,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c 2009-03-22 Michael Natterer <mitch@gimp.org> * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcolordialog.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcursor.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpdockable.c * app/widgets/gimperrordialog.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpgradientselect.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpmessagedialog.c * app/widgets/gimpnavigationview.c * app/widgets/gimppaletteselect.c * app/widgets/gimppaletteview.c * app/widgets/gimppatternselect.c * app/widgets/gimpprogressbox.c * app/widgets/gimpprogressdialog.c * app/widgets/gimpscalebutton.c * app/widgets/gimpselectiondata.c * app/widgets/gimpsessioninfo.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpuimanager.c * app/widgets/gimpview-popup.c * app/widgets/gimpview.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpwidgets-utils.c: use accessors for various members of GTK+ structures that don't exist any longer when GSEAL_ENABLE is defined. svn path=/trunk/; revision=28193
2009-03-23 00:35:53 +08:00
if (gtk_widget_get_window (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
}
}
if (cursor)
gdk_cursor_unref (cursor);
}
void
gimp_dialog_factory_unset_busy (GimpDialogFactory *factory)
{
GList *list;
if (! factory)
return;
for (list = factory->p->open_dialogs; list; list = g_list_next (list))
{
GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{
app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c 2009-03-22 Michael Natterer <mitch@gimp.org> * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcolordialog.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcursor.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpdockable.c * app/widgets/gimperrordialog.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpgradientselect.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpmessagedialog.c * app/widgets/gimpnavigationview.c * app/widgets/gimppaletteselect.c * app/widgets/gimppaletteview.c * app/widgets/gimppatternselect.c * app/widgets/gimpprogressbox.c * app/widgets/gimpprogressdialog.c * app/widgets/gimpscalebutton.c * app/widgets/gimpselectiondata.c * app/widgets/gimpsessioninfo.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpuimanager.c * app/widgets/gimpview-popup.c * app/widgets/gimpview.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpwidgets-utils.c: use accessors for various members of GTK+ structures that don't exist any longer when GSEAL_ENABLE is defined. svn path=/trunk/; revision=28193
2009-03-23 00:35:53 +08:00
if (gtk_widget_get_window (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
}
}
}
/**
* gimp_dialog_factory_get_singleton:
*
* Returns: The toplevel GimpDialogFactory instance.
**/
GimpDialogFactory *
gimp_dialog_factory_get_singleton (void)
{
g_return_val_if_fail (gimp_toplevel_factory != NULL, NULL);
return gimp_toplevel_factory;
}
/**
* gimp_dialog_factory_set_singleton:
* @:
*
* Set the toplevel GimpDialogFactory instance. Must only be called by
* dialogs_init()!.
**/
void
gimp_dialog_factory_set_singleton (GimpDialogFactory *factory)
{
g_return_if_fail (gimp_toplevel_factory == NULL ||
factory == NULL);
gimp_toplevel_factory = factory;
}