2001-04-14 23:21:45 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpdialogfactory.h
|
2001-04-22 08:38:56 +08:00
|
|
|
* Copyright (C) 2001 Michael Natterer
|
2001-04-14 23:21:45 +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 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_DIALOG_FACTORY_H__
|
|
|
|
#define __GIMP_DIALOG_FACTORY_H__
|
|
|
|
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpobject.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
typedef GtkWidget * (* GimpDialogNewFunc) (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context);
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpDialogFactoryEntry GimpDialogFactoryEntry;
|
2001-06-30 03:25:03 +08:00
|
|
|
typedef struct _GimpSessionInfo GimpSessionInfo;
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
struct _GimpDialogFactoryEntry
|
|
|
|
{
|
|
|
|
gchar *identifier;
|
|
|
|
GimpDialogNewFunc new_func;
|
2001-04-18 00:00:27 +08:00
|
|
|
gboolean singleton;
|
|
|
|
gboolean session_managed;
|
2001-04-25 02:17:17 +08:00
|
|
|
gboolean remember_size;
|
2001-04-17 02:49:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpSessionInfo
|
|
|
|
{
|
|
|
|
gint x;
|
|
|
|
gint y;
|
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
/* only valid while restoring and saving the session */
|
|
|
|
gboolean open;
|
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
/* GList of gchar* of optional additional dialog specific info */
|
|
|
|
GList *aux_info;
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
/* only one of these is valid */
|
|
|
|
GimpDialogFactoryEntry *toplevel_entry;
|
2001-06-30 03:25:03 +08:00
|
|
|
GimpDialogFactoryEntry *dockable_entry;
|
2001-04-17 02:49:29 +08:00
|
|
|
GList *sub_dialogs; /* GList of GLists of entries */
|
|
|
|
};
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
#define GIMP_TYPE_DIALOG_FACTORY (gimp_dialog_factory_get_type ())
|
|
|
|
#define GIMP_DIALOG_FACTORY(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DIALOG_FACTORY, GimpDialogFactory))
|
|
|
|
#define GIMP_DIALOG_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DIALOG_FACTORY, GimpDialogFactoryClass))
|
|
|
|
#define GIMP_IS_DIALOG_FACTORY(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DIALOG_FACTORY))
|
|
|
|
#define GIMP_IS_DIALOG_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DIALOG_FACTORY))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpDialogFactoryClass GimpDialogFactoryClass;
|
|
|
|
|
|
|
|
struct _GimpDialogFactory
|
|
|
|
{
|
2001-04-22 08:38:56 +08:00
|
|
|
GimpObject parent_instance;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
GimpContext *context;
|
|
|
|
GtkItemFactory *item_factory;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-16 00:16:13 +08:00
|
|
|
/*< private >*/
|
2001-04-22 08:38:56 +08:00
|
|
|
GimpDialogNewFunc new_dock_func;
|
2001-04-16 00:16:13 +08:00
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
GList *registered_dialogs;
|
|
|
|
GList *session_infos;
|
|
|
|
|
|
|
|
GList *open_dialogs;
|
2001-04-14 23:21:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpDialogFactoryClass
|
|
|
|
{
|
|
|
|
GimpObjectClass parent_class;
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
GHashTable *factories;
|
2001-04-14 23:21:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkType gimp_dialog_factory_get_type (void);
|
|
|
|
GimpDialogFactory * gimp_dialog_factory_new (const gchar *name,
|
|
|
|
GimpContext *context,
|
2001-04-22 08:38:56 +08:00
|
|
|
GtkItemFactory *item_factory,
|
|
|
|
GimpDialogNewFunc new_dock_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
GimpDialogFactory * gimp_dialog_factory_from_name (const gchar *name);
|
|
|
|
|
|
|
|
GimpDialogFactoryEntry * gimp_dialog_factory_find_entry (GimpDialogFactory *factory,
|
|
|
|
const gchar *identifier);
|
|
|
|
GimpSessionInfo * gimp_dialog_factory_find_session_info (GimpDialogFactory *factory,
|
|
|
|
const gchar *identifier);
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
void gimp_dialog_factory_register (GimpDialogFactory *factory,
|
2001-04-16 00:16:13 +08:00
|
|
|
const gchar *identifier,
|
2001-04-18 00:00:27 +08:00
|
|
|
GimpDialogNewFunc new_func,
|
|
|
|
gboolean singleton,
|
2001-04-25 02:17:17 +08:00
|
|
|
gboolean session_managed,
|
|
|
|
gboolean remember_size);
|
2001-04-22 08:38:56 +08:00
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget * gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
|
2001-04-16 00:16:13 +08:00
|
|
|
const gchar *identifier);
|
2001-06-30 03:25:03 +08:00
|
|
|
GtkWidget * gimp_dialog_factory_dialog_raise (GimpDialogFactory *factory,
|
|
|
|
const gchar *identifier);
|
2001-04-24 00:58:18 +08:00
|
|
|
GtkWidget * gimp_dialog_factory_dockable_new (GimpDialogFactory *factory,
|
|
|
|
GimpDock *dock,
|
|
|
|
const gchar *identifier);
|
2001-04-22 08:38:56 +08:00
|
|
|
GtkWidget * gimp_dialog_factory_dock_new (GimpDialogFactory *factory);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
void gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
|
|
|
|
GtkWidget *dialog);
|
|
|
|
void gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
|
|
|
|
GtkWidget *dialog);
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
void gimp_dialog_factories_session_save (FILE *file);
|
|
|
|
void gimp_dialog_factories_session_restore (void);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_DIALOG_FACTORY_H__ */
|