1/* GtkToolPalette -- A tool palette with categories and DnD support
2 * Copyright (C) 2008 Openismus GmbH
3 *
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.
8 *
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.
13 *
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/>.
16 *
17 * Authors:
18 * Mathias Hasselmann
19 */
20
21#ifndef __GTK_TOOL_PALETTE_H__
22#define __GTK_TOOL_PALETTE_H__
23
24#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25#error "Only <gtk/gtk.h> can be included directly."
26#endif
27
28#include <gtk/gtkcontainer.h>
29#include <gtk/gtkdnd.h>
30#include <gtk/gtktoolitem.h>
31
32G_BEGIN_DECLS
33
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))
40
41typedef struct _GtkToolPalette GtkToolPalette;
42typedef struct _GtkToolPaletteClass GtkToolPaletteClass;
43typedef struct _GtkToolPalettePrivate GtkToolPalettePrivate;
44
45/**
46 * GtkToolPaletteDragTargets:
47 * @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
48 * @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
49 *
50 * Flags used to specify the supported drag targets.
51 */
52typedef enum /*< flags >*/
53{
54 GTK_TOOL_PALETTE_DRAG_ITEMS = (1 << 0),
55 GTK_TOOL_PALETTE_DRAG_GROUPS = (1 << 1)
56}
57GtkToolPaletteDragTargets;
58
59/**
60 * GtkToolPalette:
61 *
62 * This should not be accessed directly. Use the accessor functions below.
63 */
64struct _GtkToolPalette
65{
66 GtkContainer parent_instance;
67 GtkToolPalettePrivate *priv;
68};
69
70/**
71 * GtkToolPaletteClass:
72 * @parent_class: The parent class.
73 */
74struct _GtkToolPaletteClass
75{
76 GtkContainerClass parent_class;
77
78 /*< private >*/
79
80 /* Padding for future expansion */
81 void (*_gtk_reserved1) (void);
82 void (*_gtk_reserved2) (void);
83 void (*_gtk_reserved3) (void);
84 void (*_gtk_reserved4) (void);
85};
86
87GDK_AVAILABLE_IN_ALL
88GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
89GDK_AVAILABLE_IN_ALL
90GtkWidget* gtk_tool_palette_new (void);
91
92GDK_AVAILABLE_IN_ALL
93void gtk_tool_palette_set_group_position (GtkToolPalette *palette,
94 GtkToolItemGroup *group,
95 gint position);
96GDK_AVAILABLE_IN_ALL
97void gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
98 GtkToolItemGroup *group,
99 gboolean exclusive);
100GDK_AVAILABLE_IN_ALL
101void gtk_tool_palette_set_expand (GtkToolPalette *palette,
102 GtkToolItemGroup *group,
103 gboolean expand);
104
105GDK_AVAILABLE_IN_ALL
106gint gtk_tool_palette_get_group_position (GtkToolPalette *palette,
107 GtkToolItemGroup *group);
108GDK_AVAILABLE_IN_ALL
109gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
110 GtkToolItemGroup *group);
111GDK_AVAILABLE_IN_ALL
112gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette,
113 GtkToolItemGroup *group);
114
115GDK_AVAILABLE_IN_ALL
116void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
117 GtkIconSize icon_size);
118GDK_AVAILABLE_IN_ALL
119void gtk_tool_palette_unset_icon_size (GtkToolPalette *palette);
120GDK_AVAILABLE_IN_ALL
121void gtk_tool_palette_set_style (GtkToolPalette *palette,
122 GtkToolbarStyle style);
123GDK_AVAILABLE_IN_ALL
124void gtk_tool_palette_unset_style (GtkToolPalette *palette);
125
126GDK_AVAILABLE_IN_ALL
127GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
128GDK_AVAILABLE_IN_ALL
129GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
130
131GDK_AVAILABLE_IN_ALL
132GtkToolItem* gtk_tool_palette_get_drop_item (GtkToolPalette *palette,
133 gint x,
134 gint y);
135GDK_AVAILABLE_IN_ALL
136GtkToolItemGroup* gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
137 gint x,
138 gint y);
139GDK_AVAILABLE_IN_ALL
140GtkWidget* gtk_tool_palette_get_drag_item (GtkToolPalette *palette,
141 const GtkSelectionData *selection);
142
143GDK_AVAILABLE_IN_ALL
144void gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
145 GtkToolPaletteDragTargets targets);
146GDK_AVAILABLE_IN_ALL
147void gtk_tool_palette_add_drag_dest (GtkToolPalette *palette,
148 GtkWidget *widget,
149 GtkDestDefaults flags,
150 GtkToolPaletteDragTargets targets,
151 GdkDragAction actions);
152
153
154GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_hadjustment)
155GtkAdjustment* gtk_tool_palette_get_hadjustment (GtkToolPalette *palette);
156GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_vadjustment)
157GtkAdjustment* gtk_tool_palette_get_vadjustment (GtkToolPalette *palette);
158
159GDK_AVAILABLE_IN_ALL
160const GtkTargetEntry* gtk_tool_palette_get_drag_target_item (void) G_GNUC_CONST;
161GDK_AVAILABLE_IN_ALL
162const GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void) G_GNUC_CONST;
163
164
165G_END_DECLS
166
167#endif /* __GTK_TOOL_PALETTE_H__ */
168

source code of include/gtk-3.0/gtk/gtktoolpalette.h