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, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __GTK_TOOL_PALETTE_H__
23 #define __GTK_TOOL_PALETTE_H__
25 #include <gtk/gtkcontainer.h>
26 #include <gtk/gtkdnd.h>
27 #include <gtk/gtktoolitem.h>
31 #define GTK_TYPE_TOOL_PALETTE (gtk_tool_palette_get_type())
32 #define GTK_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette))
33 #define GTK_TOOL_PALETTE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
34 #define GTK_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TOOL_PALETTE))
35 #define GTK_IS_TOOL_PALETTE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, GTK_TYPE_TOOL_PALETTE))
36 #define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
38 typedef struct _GtkToolPalette GtkToolPalette;
39 typedef struct _GtkToolPaletteClass GtkToolPaletteClass;
40 typedef struct _GtkToolPalettePrivate GtkToolPalettePrivate;
43 * GtkToolPaletteDragTargets:
44 * @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
45 * @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
47 * Flags used to specify the supported drag targets.
49 typedef enum /*< flags >*/
51 GTK_TOOL_PALETTE_DRAG_ITEMS = (1 << 0),
52 GTK_TOOL_PALETTE_DRAG_GROUPS = (1 << 1)
54 GtkToolPaletteDragTargets;
59 * This should not be accessed directly. Use the accessor functions below.
61 struct _GtkToolPalette
63 GtkContainer parent_instance;
64 GtkToolPalettePrivate *priv;
67 struct _GtkToolPaletteClass
69 GtkContainerClass parent_class;
71 void (*set_scroll_adjustments) (GtkWidget *widget,
72 GtkAdjustment *hadjustment,
73 GtkAdjustment *vadjustment);
75 /* Padding for future expansion */
76 void (*_gtk_reserved1) (void);
77 void (*_gtk_reserved2) (void);
78 void (*_gtk_reserved3) (void);
79 void (*_gtk_reserved4) (void);
80 void (*_gtk_reserved5) (void);
81 void (*_gtk_reserved6) (void);
84 GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
85 GtkWidget* gtk_tool_palette_new (void);
87 void gtk_tool_palette_set_group_position (GtkToolPalette *palette,
90 void gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
93 void gtk_tool_palette_set_expand (GtkToolPalette *palette,
97 gint gtk_tool_palette_get_group_position (GtkToolPalette *palette,
99 gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
101 gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette,
104 void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
105 GtkIconSize icon_size);
106 void gtk_tool_palette_unset_icon_size (GtkToolPalette *palette);
107 void gtk_tool_palette_set_style (GtkToolPalette *palette,
108 GtkToolbarStyle style);
109 void gtk_tool_palette_unset_style (GtkToolPalette *palette);
111 GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
112 GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
114 GtkToolItem* gtk_tool_palette_get_drop_item (GtkToolPalette *palette,
117 GtkWidget* gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
120 GtkWidget* gtk_tool_palette_get_drag_item (GtkToolPalette *palette,
121 const GtkSelectionData *selection);
123 void gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
124 GtkToolPaletteDragTargets targets);
125 void gtk_tool_palette_add_drag_dest (GtkToolPalette *palette,
127 GtkDestDefaults flags,
128 GtkToolPaletteDragTargets targets,
129 GdkDragAction actions);
131 GtkAdjustment* gtk_tool_palette_get_hadjustment (GtkToolPalette *palette);
132 GtkAdjustment* gtk_tool_palette_get_vadjustment (GtkToolPalette *palette);
134 G_CONST_RETURN GtkTargetEntry* gtk_tool_palette_get_drag_target_item (void) G_GNUC_CONST;
135 G_CONST_RETURN GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void) G_GNUC_CONST;
140 #endif /* __GTK_TOOL_PALETTE_H__ */