1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * gimpdockbook.h
5  * Copyright (C) 2001-2007 Michael Natterer <mitch@gimp.org>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GIMP_DOCKBOOK_H__
22 #define __GIMP_DOCKBOOK_H__
23 
24 
25 #define GIMP_TYPE_DOCKBOOK            (gimp_dockbook_get_type ())
26 #define GIMP_DOCKBOOK(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DOCKBOOK, GimpDockbook))
27 #define GIMP_DOCKBOOK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DOCKBOOK, GimpDockbookClass))
28 #define GIMP_IS_DOCKBOOK(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DOCKBOOK))
29 #define GIMP_IS_DOCKBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DOCKBOOK))
30 #define GIMP_DOCKBOOK_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DOCKBOOK, GimpDockbookClass))
31 
32 
33 typedef void (* GimpDockbookDragCallback) (GdkDragContext *context,
34                                            gboolean        begin,
35                                            gpointer        data);
36 
37 
38 typedef struct _GimpDockbookClass    GimpDockbookClass;
39 typedef struct _GimpDockbookPrivate  GimpDockbookPrivate;
40 
41 /**
42  * GimpDockbook:
43  *
44  * Holds GimpDockables which are presented on different tabs using
45  * GtkNotebook.
46  */
47 struct _GimpDockbook
48 {
49   GtkNotebook parent_instance;
50 
51   GimpDockbookPrivate *p;
52 };
53 
54 struct _GimpDockbookClass
55 {
56   GtkNotebookClass parent_class;
57 
58   void (* dockable_added)     (GimpDockbook *dockbook,
59                                GimpDockable *dockable);
60   void (* dockable_removed)   (GimpDockbook *dockbook,
61                                GimpDockable *dockable);
62   void (* dockable_reordered) (GimpDockbook *dockbook,
63                                GimpDockable *dockable);
64 };
65 
66 
67 GType           gimp_dockbook_get_type                (void) G_GNUC_CONST;
68 GtkWidget     * gimp_dockbook_new                     (GimpMenuFactory          *menu_factory);
69 GimpDock      * gimp_dockbook_get_dock                (GimpDockbook             *dockbook);
70 void            gimp_dockbook_set_dock                (GimpDockbook             *dockbook,
71                                                        GimpDock                 *dock);
72 GimpUIManager * gimp_dockbook_get_ui_manager          (GimpDockbook             *dockbook);
73 void            gimp_dockbook_add                     (GimpDockbook             *dockbook,
74                                                        GimpDockable             *dockable,
75                                                        gint                      position);
76 GtkWidget     * gimp_dockbook_add_from_dialog_factory (GimpDockbook             *dockbook,
77                                                        const gchar              *identifiers,
78                                                        gint                      position);
79 void            gimp_dockbook_remove                  (GimpDockbook             *dockbook,
80                                                        GimpDockable             *dockable);
81 void            gimp_dockbook_update_with_context     (GimpDockbook             *dockbook,
82                                                        GimpContext              *context);
83 GtkWidget    *  gimp_dockbook_create_tab_widget       (GimpDockbook             *dockbook,
84                                                        GimpDockable             *dockable);
85 void            gimp_dockbook_update_auto_tab_style   (GimpDockbook             *dockbook);
86 gboolean        gimp_dockbook_drop_dockable           (GimpDockbook             *dockbook,
87                                                        GtkWidget                *drag_source);
88 void            gimp_dockbook_set_drag_handler        (GimpDockbook             *dockbook,
89                                                        GimpPanedBox             *drag_handler);
90 GimpDockable *  gimp_dockbook_drag_source_to_dockable (GtkWidget                *drag_source);
91 
92 void            gimp_dockbook_add_drag_callback       (GimpDockbookDragCallback  callback,
93                                                        gpointer                  data);
94 void            gimp_dockbook_remove_drag_callback    (GimpDockbookDragCallback  callback,
95                                                        gpointer                  data);
96 
97 
98 #endif /* __GIMP_DOCKBOOK_H__ */
99