1 /* GIMP - The GNU Image Manipulation Program 2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis 3 * 4 * gimpdockable.h 5 * Copyright (C) 2001-2003 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_DOCKABLE_H__ 22 #define __GIMP_DOCKABLE_H__ 23 24 25 #define GIMP_DOCKABLE_DRAG_OFFSET (-6) 26 27 28 #define GIMP_TYPE_DOCKABLE (gimp_dockable_get_type ()) 29 #define GIMP_DOCKABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DOCKABLE, GimpDockable)) 30 #define GIMP_DOCKABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DOCKABLE, GimpDockableClass)) 31 #define GIMP_IS_DOCKABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DOCKABLE)) 32 #define GIMP_IS_DOCKABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DOCKABLE)) 33 #define GIMP_DOCKABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DOCKABLE, GimpDockableClass)) 34 35 36 typedef struct _GimpDockablePrivate GimpDockablePrivate; 37 typedef struct _GimpDockableClass GimpDockableClass; 38 39 /** 40 * GimpDockable: 41 * 42 * A kind of adapter to make other widgets dockable. The widget to 43 * dock is put inside the GimpDockable, which is put in a 44 * GimpDockbook. 45 */ 46 struct _GimpDockable 47 { 48 GtkBin parent_instance; 49 50 GimpDockablePrivate *p; 51 }; 52 53 struct _GimpDockableClass 54 { 55 GtkBinClass parent_class; 56 }; 57 58 59 GType gimp_dockable_get_type (void) G_GNUC_CONST; 60 61 GtkWidget * gimp_dockable_new (const gchar *name, 62 const gchar *blurb, 63 const gchar *icon_name, 64 const gchar *help_id); 65 void gimp_dockable_set_dockbook (GimpDockable *dockable, 66 GimpDockbook *dockbook); 67 GimpDockbook * gimp_dockable_get_dockbook (GimpDockable *dockable); 68 GimpTabStyle gimp_dockable_get_tab_style (GimpDockable *dockable); 69 const gchar * gimp_dockable_get_name (GimpDockable *dockable); 70 const gchar * gimp_dockable_get_blurb (GimpDockable *dockable); 71 const gchar * gimp_dockable_get_help_id (GimpDockable *dockable); 72 const gchar * gimp_dockable_get_icon_name (GimpDockable *dockable); 73 GtkWidget * gimp_dockable_get_icon (GimpDockable *dockable, 74 GtkIconSize size); 75 76 gboolean gimp_dockable_get_locked (GimpDockable *dockable); 77 void gimp_dockable_set_drag_pos (GimpDockable *dockable, 78 gint drag_x, 79 gint drag_y); 80 void gimp_dockable_get_drag_pos (GimpDockable *dockable, 81 gint *drag_x, 82 gint *drag_y); 83 GimpPanedBox * gimp_dockable_get_drag_handler (GimpDockable *dockable); 84 85 void gimp_dockable_set_locked (GimpDockable *dockable, 86 gboolean lock); 87 gboolean gimp_dockable_is_locked (GimpDockable *dockable); 88 89 void gimp_dockable_set_tab_style (GimpDockable *dockable, 90 GimpTabStyle tab_style); 91 gboolean gimp_dockable_set_actual_tab_style (GimpDockable *dockable, 92 GimpTabStyle tab_style); 93 GimpTabStyle gimp_dockable_get_actual_tab_style (GimpDockable *dockable); 94 GtkWidget * gimp_dockable_create_tab_widget (GimpDockable *dockable, 95 GimpContext *context, 96 GimpTabStyle tab_style, 97 GtkIconSize size); 98 GtkWidget * gimp_dockable_create_drag_widget (GimpDockable *dockable); 99 void gimp_dockable_set_context (GimpDockable *dockable, 100 GimpContext *context); 101 GimpUIManager * gimp_dockable_get_menu (GimpDockable *dockable, 102 const gchar **ui_path, 103 gpointer *popup_data); 104 void gimp_dockable_set_drag_handler (GimpDockable *dockable, 105 GimpPanedBox *drag_handler); 106 107 void gimp_dockable_detach (GimpDockable *dockable); 108 109 110 #endif /* __GIMP_DOCKABLE_H__ */ 111