GimpDialogFactory

GimpDialogFactory

Synopsis

                    GimpDialogFactory;
                    GimpDialogFactoryPrivate;
#define             GIMP_DIALOG_VISIBILITY_KEY
enum                GimpDialogVisibilityState;
GtkWidget *         (*GimpDialogNewFunc)                (GimpDialogFactory *factory,
                                                         GimpContext *context,
                                                         GimpUIManager *ui_manager,
                                                         gint view_size);
                    GimpDialogFactoryEntry;
GimpDialogFactory * gimp_dialog_factory_new             (const gchar *name,
                                                         GimpContext *context,
                                                         GimpMenuFactory *menu_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,
                                                         GimpDialogRestoreFunc restore_func,
                                                         gint view_size,
                                                         gboolean singleton,
                                                         gboolean session_managed,
                                                         gboolean remember_size,
                                                         gboolean remember_if_open,
                                                         gboolean hideable,
                                                         gboolean image_window,
                                                         gboolean dockable);
GimpDialogFactoryEntry * gimp_dialog_factory_find_entry (GimpDialogFactory *factory,
                                                         const gchar *identifier);
GimpSessionInfo *   gimp_dialog_factory_find_session_info
                                                        (GimpDialogFactory *factory,
                                                         const gchar *identifier);
GtkWidget *         gimp_dialog_factory_find_widget     (GimpDialogFactory *factory,
                                                         const gchar *identifiers);
GimpContext *       gimp_dialog_factory_get_context     (GimpDialogFactory *factory);
GimpMenuFactory *   gimp_dialog_factory_get_menu_factory
                                                        (GimpDialogFactory *factory);
GList *             gimp_dialog_factory_get_open_dialogs
                                                        (GimpDialogFactory *factory);
GList *             gimp_dialog_factory_get_session_infos
                                                        (GimpDialogFactory *factory);
void                gimp_dialog_factory_add_session_info
                                                        (GimpDialogFactory *factory,
                                                         GimpSessionInfo *info);
GtkWidget *         gimp_dialog_factory_dialog_new      (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         GimpUIManager *ui_manager,
                                                         const gchar *identifier,
                                                         gint view_size,
                                                         gboolean present);
GtkWidget *         gimp_dialog_factory_dialog_raise    (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         const gchar *identifiers,
                                                         gint view_size);
GtkWidget *         gimp_dialog_factory_dockable_new    (GimpDialogFactory *factory,
                                                         GimpDock *dock,
                                                         const gchar *identifier,
                                                         gint view_size);
void                gimp_dialog_factory_add_dialog      (GimpDialogFactory *factory,
                                                         GtkWidget *dialog);
void                gimp_dialog_factory_add_foreign     (GimpDialogFactory *factory,
                                                         const gchar *identifier,
                                                         GtkWidget *dialog);
void                gimp_dialog_factory_remove_dialog   (GimpDialogFactory *factory,
                                                         GtkWidget *dialog);
void                gimp_dialog_factory_hide_dialog     (GtkWidget *dialog);
void                gimp_dialog_factory_save            (GimpDialogFactory *factory,
                                                         GimpConfigWriter *writer);
void                gimp_dialog_factory_restore         (GimpDialogFactory *factory);
void                gimp_dialog_factory_set_state       (GimpDialogFactory *factory,
                                                         GimpDialogsState state);
GimpDialogsState    gimp_dialog_factory_get_state       (GimpDialogFactory *factory);
void                gimp_dialog_factory_show_with_display
                                                        (GimpDialogFactory *factory);
void                gimp_dialog_factory_hide_with_display
                                                        (GimpDialogFactory *factory);
void                gimp_dialog_factory_set_busy        (GimpDialogFactory *factory);
void                gimp_dialog_factory_unset_busy      (GimpDialogFactory *factory);
GimpDialogFactory * gimp_dialog_factory_from_widget     (GtkWidget *dialog,
                                                         GimpDialogFactoryEntry **entry);
void                gimp_dialog_factory_set_has_min_size
                                                        (GtkWindow *window,
                                                         gboolean has_min_size);
gboolean            gimp_dialog_factory_get_has_min_size
                                                        (GtkWindow *window);
GimpDialogFactory * gimp_dialog_factory_get_singleton   (void);
void                gimp_dialog_factory_set_singleton   (GimpDialogFactory *factory);

Object Hierarchy

  GObject
   +----GimpObject
         +----GimpDialogFactory

Signals

  "dock-window-added"                              : Run Last
  "dock-window-removed"                            : Run Last

Description

Details

GimpDialogFactory

typedef struct _GimpDialogFactory GimpDialogFactory;

A factory with the main purpose of creating toplevel windows and position them according to the session information kept within the factory. Over time it has accumulated more functionality than this.


GimpDialogFactoryPrivate

typedef struct _GimpDialogFactoryPrivate GimpDialogFactoryPrivate;


GIMP_DIALOG_VISIBILITY_KEY

#define GIMP_DIALOG_VISIBILITY_KEY "gimp-dialog-visibility"


enum GimpDialogVisibilityState

typedef enum {
  GIMP_DIALOG_VISIBILITY_UNKNOWN = 0,
  GIMP_DIALOG_VISIBILITY_INVISIBLE,
  GIMP_DIALOG_VISIBILITY_VISIBLE,
  GIMP_DIALOG_VISIBILITY_HIDDEN
} GimpDialogVisibilityState;

GIMP_DIALOG_VISIBILITY_UNKNOWN

GIMP_DIALOG_VISIBILITY_INVISIBLE

GIMP_DIALOG_VISIBILITY_VISIBLE

GIMP_DIALOG_VISIBILITY_HIDDEN


GimpDialogNewFunc ()

GtkWidget *         (*GimpDialogNewFunc)                (GimpDialogFactory *factory,
                                                         GimpContext *context,
                                                         GimpUIManager *ui_manager,
                                                         gint view_size);


GimpDialogFactoryEntry

typedef struct {
  gchar                *identifier;
  gchar                *name;
  gchar                *blurb;
  gchar                *stock_id;
  gchar                *help_id;

  GimpDialogNewFunc     new_func;
  GimpDialogRestoreFunc restore_func;
  gint                  view_size;

  gboolean              singleton;
  gboolean              session_managed;
  gboolean              remember_size;
  gboolean              remember_if_open;

  /* If TRUE the visibility of the dialog is toggleable */
  gboolean              hideable;

  /* If TRUE the entry is for a GimpImageWindow, FALSE otherwise */
  gboolean              image_window;

  /* If TRUE the entry is for a dockable, FALSE otherwise */
  gboolean              dockable;
} GimpDialogFactoryEntry;


gimp_dialog_factory_new ()

GimpDialogFactory * gimp_dialog_factory_new             (const gchar *name,
                                                         GimpContext *context,
                                                         GimpMenuFactory *menu_factory);


gimp_dialog_factory_register_entry ()

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,
                                                         GimpDialogRestoreFunc restore_func,
                                                         gint view_size,
                                                         gboolean singleton,
                                                         gboolean session_managed,
                                                         gboolean remember_size,
                                                         gboolean remember_if_open,
                                                         gboolean hideable,
                                                         gboolean image_window,
                                                         gboolean dockable);


gimp_dialog_factory_find_entry ()

GimpDialogFactoryEntry * gimp_dialog_factory_find_entry (GimpDialogFactory *factory,
                                                         const gchar *identifier);


gimp_dialog_factory_find_session_info ()

GimpSessionInfo *   gimp_dialog_factory_find_session_info
                                                        (GimpDialogFactory *factory,
                                                         const gchar *identifier);


gimp_dialog_factory_find_widget ()

GtkWidget *         gimp_dialog_factory_find_widget     (GimpDialogFactory *factory,
                                                         const gchar *identifiers);


gimp_dialog_factory_get_context ()

GimpContext *       gimp_dialog_factory_get_context     (GimpDialogFactory *factory);


gimp_dialog_factory_get_menu_factory ()

GimpMenuFactory *   gimp_dialog_factory_get_menu_factory
                                                        (GimpDialogFactory *factory);


gimp_dialog_factory_get_open_dialogs ()

GList *             gimp_dialog_factory_get_open_dialogs
                                                        (GimpDialogFactory *factory);


gimp_dialog_factory_get_session_infos ()

GList *             gimp_dialog_factory_get_session_infos
                                                        (GimpDialogFactory *factory);


gimp_dialog_factory_add_session_info ()

void                gimp_dialog_factory_add_session_info
                                                        (GimpDialogFactory *factory,
                                                         GimpSessionInfo *info);


gimp_dialog_factory_dialog_new ()

GtkWidget *         gimp_dialog_factory_dialog_new      (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         GimpUIManager *ui_manager,
                                                         const gchar *identifier,
                                                         gint view_size,
                                                         gboolean present);

Creates a new toplevel dialog or a GimpDockable, depending on whether factory is a toplevel of dockable factory.

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

view_size :

the initial preview size

present :

whether gtk_window_present() should be called

Returns :

the newly created dialog or an already existing singleton dialog.

gimp_dialog_factory_dialog_raise ()

GtkWidget *         gimp_dialog_factory_dialog_raise    (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         const gchar *identifiers,
                                                         gint view_size);

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.

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

view_size :

the initial preview size if a dialog needs to be created

Returns :

the raised or newly created dialog.

gimp_dialog_factory_dockable_new ()

GtkWidget *         gimp_dialog_factory_dockable_new    (GimpDialogFactory *factory,
                                                         GimpDock *dock,
                                                         const gchar *identifier,
                                                         gint 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.

factory :

a GimpDialogFactory

dock :

a GimpDock crated by this factory.

identifier :

the identifier of the dialog as registered with gimp_dialog_factory_register_entry()

Returns :

the newly created GimpDockable or an already existing singleton dockable.

gimp_dialog_factory_add_dialog ()

void                gimp_dialog_factory_add_dialog      (GimpDialogFactory *factory,
                                                         GtkWidget *dialog);


gimp_dialog_factory_add_foreign ()

void                gimp_dialog_factory_add_foreign     (GimpDialogFactory *factory,
                                                         const gchar *identifier,
                                                         GtkWidget *dialog);


gimp_dialog_factory_remove_dialog ()

void                gimp_dialog_factory_remove_dialog   (GimpDialogFactory *factory,
                                                         GtkWidget *dialog);


gimp_dialog_factory_hide_dialog ()

void                gimp_dialog_factory_hide_dialog     (GtkWidget *dialog);


gimp_dialog_factory_save ()

void                gimp_dialog_factory_save            (GimpDialogFactory *factory,
                                                         GimpConfigWriter *writer);


gimp_dialog_factory_restore ()

void                gimp_dialog_factory_restore         (GimpDialogFactory *factory);


gimp_dialog_factory_set_state ()

void                gimp_dialog_factory_set_state       (GimpDialogFactory *factory,
                                                         GimpDialogsState state);


gimp_dialog_factory_get_state ()

GimpDialogsState    gimp_dialog_factory_get_state       (GimpDialogFactory *factory);


gimp_dialog_factory_show_with_display ()

void                gimp_dialog_factory_show_with_display
                                                        (GimpDialogFactory *factory);


gimp_dialog_factory_hide_with_display ()

void                gimp_dialog_factory_hide_with_display
                                                        (GimpDialogFactory *factory);


gimp_dialog_factory_set_busy ()

void                gimp_dialog_factory_set_busy        (GimpDialogFactory *factory);


gimp_dialog_factory_unset_busy ()

void                gimp_dialog_factory_unset_busy      (GimpDialogFactory *factory);


gimp_dialog_factory_from_widget ()

GimpDialogFactory * gimp_dialog_factory_from_widget     (GtkWidget *dialog,
                                                         GimpDialogFactoryEntry **entry);


gimp_dialog_factory_set_has_min_size ()

void                gimp_dialog_factory_set_has_min_size
                                                        (GtkWindow *window,
                                                         gboolean has_min_size);


gimp_dialog_factory_get_has_min_size ()

gboolean            gimp_dialog_factory_get_has_min_size
                                                        (GtkWindow *window);


gimp_dialog_factory_get_singleton ()

GimpDialogFactory * gimp_dialog_factory_get_singleton   (void);

Returns :

The toplevel GimpDialogFactory instance.

gimp_dialog_factory_set_singleton ()

void                gimp_dialog_factory_set_singleton   (GimpDialogFactory *factory);

Set the toplevel GimpDialogFactory instance. Must only be called by dialogs_init()!.

Signal Details

The "dock-window-added" signal

void                user_function                      (GimpDialogFactory *gimpdialogfactory,
                                                        GimpDockWindow    *arg1,
                                                        gpointer           user_data)              : Run Last

gimpdialogfactory :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "dock-window-removed" signal

void                user_function                      (GimpDialogFactory *gimpdialogfactory,
                                                        GimpDockWindow    *arg1,
                                                        gpointer           user_data)              : Run Last

gimpdialogfactory :

the object which received the signal.

user_data :

user data set when the signal handler was connected.