1 /* GtkToolPalette -- A tool palette with categories and DnD support
2 * Copyright (C) 2008 Openismus GmbH
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __GTK_TOOL_PALETTE_H__
22 #define __GTK_TOOL_PALETTE_H__
24 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25 #error "Only <gtk/gtk.h> can be included directly."
28 #include <gtk/gtkcontainer.h>
29 #include <gtk/gtkdnd.h>
30 #include <gtk/gtktoolitem.h>
34 #define GTK_TYPE_TOOL_PALETTE (gtk_tool_palette_get_type ())
35 #define GTK_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette))
36 #define GTK_TOOL_PALETTE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
37 #define GTK_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
38 #define GTK_IS_TOOL_PALETTE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
39 #define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
41 typedef struct _GtkToolPalette GtkToolPalette;
42 typedef struct _GtkToolPaletteClass GtkToolPaletteClass;
43 typedef struct _GtkToolPalettePrivate GtkToolPalettePrivate;
46 * GtkToolPaletteDragTargets:
47 * @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
48 * @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
50 * Flags used to specify the supported drag targets.
52 typedef enum /*< flags >*/
54 GTK_TOOL_PALETTE_DRAG_ITEMS = (1 << 0),
55 GTK_TOOL_PALETTE_DRAG_GROUPS = (1 << 1)
57 GtkToolPaletteDragTargets;
62 * This should not be accessed directly. Use the accessor functions below.
64 struct _GtkToolPalette
66 GtkContainer parent_instance;
67 GtkToolPalettePrivate *priv;
70 struct _GtkToolPaletteClass
72 GtkContainerClass parent_class;
74 /* Padding for future expansion */
75 void (*_gtk_reserved1) (void);
76 void (*_gtk_reserved2) (void);
77 void (*_gtk_reserved3) (void);
78 void (*_gtk_reserved4) (void);
81 GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
82 GtkWidget* gtk_tool_palette_new (void);
84 void gtk_tool_palette_set_group_position (GtkToolPalette *palette,
85 GtkToolItemGroup *group,
87 void gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
88 GtkToolItemGroup *group,
90 void gtk_tool_palette_set_expand (GtkToolPalette *palette,
91 GtkToolItemGroup *group,
94 gint gtk_tool_palette_get_group_position (GtkToolPalette *palette,
95 GtkToolItemGroup *group);
96 gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
97 GtkToolItemGroup *group);
98 gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette,
99 GtkToolItemGroup *group);
101 void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
102 GtkIconSize icon_size);
103 void gtk_tool_palette_unset_icon_size (GtkToolPalette *palette);
104 void gtk_tool_palette_set_style (GtkToolPalette *palette,
105 GtkToolbarStyle style);
106 void gtk_tool_palette_unset_style (GtkToolPalette *palette);
108 GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
109 GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
111 GtkToolItem* gtk_tool_palette_get_drop_item (GtkToolPalette *palette,
114 GtkToolItemGroup* gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
117 GtkWidget* gtk_tool_palette_get_drag_item (GtkToolPalette *palette,
118 const GtkSelectionData *selection);
120 void gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
121 GtkToolPaletteDragTargets targets);
122 void gtk_tool_palette_add_drag_dest (GtkToolPalette *palette,
124 GtkDestDefaults flags,
125 GtkToolPaletteDragTargets targets,
126 GdkDragAction actions);
129 GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_hadjustment)
130 GtkAdjustment* gtk_tool_palette_get_hadjustment (GtkToolPalette *palette);
131 GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_vadjustment)
132 GtkAdjustment* gtk_tool_palette_get_vadjustment (GtkToolPalette *palette);
134 const GtkTargetEntry* gtk_tool_palette_get_drag_target_item (void) G_GNUC_CONST;
135 const GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void) G_GNUC_CONST;
140 #endif /* __GTK_TOOL_PALETTE_H__ */