gtktoolpalette.h 7.82 KB
Newer Older
Johannes Schmid's avatar
Johannes Schmid committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* GtkToolPalette -- A tool palette with categories and DnD support
 * Copyright (C) 2008  Openismus GmbH
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Johannes Schmid's avatar
Johannes Schmid committed
16
17
18
19
20
 *
 * Authors:
 *      Mathias Hasselmann
 */

21
22
23
#ifndef __GTK_TOOL_PALETTE_H__
#define __GTK_TOOL_PALETTE_H__

24
25
26
27
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

Johannes Schmid's avatar
Johannes Schmid committed
28
29
30
31
32
33
#include <gtk/gtkcontainer.h>
#include <gtk/gtkdnd.h>
#include <gtk/gtktoolitem.h>

G_BEGIN_DECLS

34
35
36
37
38
39
#define GTK_TYPE_TOOL_PALETTE           (gtk_tool_palette_get_type ())
#define GTK_TOOL_PALETTE(obj)           (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette))
#define GTK_TOOL_PALETTE_CLASS(cls)     (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
#define GTK_IS_TOOL_PALETTE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
#define GTK_IS_TOOL_PALETTE_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
#define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
Johannes Schmid's avatar
Johannes Schmid committed
40
41
42
43
44
45
46
47
48
49

typedef struct _GtkToolPalette           GtkToolPalette;
typedef struct _GtkToolPaletteClass      GtkToolPaletteClass;
typedef struct _GtkToolPalettePrivate    GtkToolPalettePrivate;

/**
 * GtkToolPaletteDragTargets:
 * @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
 * @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
 *
50
 * Flags used to specify the supported drag targets.
Johannes Schmid's avatar
Johannes Schmid committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 */
typedef enum /*< flags >*/
{
  GTK_TOOL_PALETTE_DRAG_ITEMS = (1 << 0),
  GTK_TOOL_PALETTE_DRAG_GROUPS = (1 << 1)
}
GtkToolPaletteDragTargets;

/**
 * GtkToolPalette:
 *
 * This should not be accessed directly. Use the accessor functions below.
 */
struct _GtkToolPalette
{
  GtkContainer parent_instance;
  GtkToolPalettePrivate *priv;
};

William Jon McCann's avatar
William Jon McCann committed
70
71
72
73
/**
 * GtkToolPaletteClass:
 * @parent_class: The parent class.
 */
Johannes Schmid's avatar
Johannes Schmid committed
74
75
76
77
struct _GtkToolPaletteClass
{
  GtkContainerClass parent_class;

William Jon McCann's avatar
William Jon McCann committed
78
79
  /*< private >*/

80
81
82
83
84
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
Johannes Schmid's avatar
Johannes Schmid committed
85
86
};

87
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
88
GType                          gtk_tool_palette_get_type              (void) G_GNUC_CONST;
89
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
90
91
GtkWidget*                     gtk_tool_palette_new                   (void);

92
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
93
void                           gtk_tool_palette_set_group_position    (GtkToolPalette            *palette,
94
                                                                       GtkToolItemGroup          *group,
Johannes Schmid's avatar
Johannes Schmid committed
95
                                                                       gint                       position);
96
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
97
void                           gtk_tool_palette_set_exclusive         (GtkToolPalette            *palette,
98
                                                                       GtkToolItemGroup          *group,
Johannes Schmid's avatar
Johannes Schmid committed
99
                                                                       gboolean                   exclusive);
100
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
101
void                           gtk_tool_palette_set_expand            (GtkToolPalette            *palette,
102
                                                                       GtkToolItemGroup          *group,
Johannes Schmid's avatar
Johannes Schmid committed
103
104
                                                                       gboolean                   expand);

105
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
106
gint                           gtk_tool_palette_get_group_position    (GtkToolPalette            *palette,
107
                                                                       GtkToolItemGroup          *group);
108
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
109
gboolean                       gtk_tool_palette_get_exclusive         (GtkToolPalette            *palette,
110
                                                                       GtkToolItemGroup          *group);
111
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
112
gboolean                       gtk_tool_palette_get_expand            (GtkToolPalette            *palette,
113
                                                                       GtkToolItemGroup          *group);
Johannes Schmid's avatar
Johannes Schmid committed
114

115
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
116
117
void                           gtk_tool_palette_set_icon_size         (GtkToolPalette            *palette,
                                                                       GtkIconSize                icon_size);
118
GDK_AVAILABLE_IN_ALL
119
void                           gtk_tool_palette_unset_icon_size       (GtkToolPalette            *palette);
120
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
121
122
void                           gtk_tool_palette_set_style             (GtkToolPalette            *palette,
                                                                       GtkToolbarStyle            style);
123
GDK_AVAILABLE_IN_ALL
124
void                           gtk_tool_palette_unset_style           (GtkToolPalette            *palette);
Johannes Schmid's avatar
Johannes Schmid committed
125

126
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
127
GtkIconSize                    gtk_tool_palette_get_icon_size         (GtkToolPalette            *palette);
128
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
129
130
GtkToolbarStyle                gtk_tool_palette_get_style             (GtkToolPalette            *palette);

131
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
132
133
134
GtkToolItem*                   gtk_tool_palette_get_drop_item         (GtkToolPalette            *palette,
                                                                       gint                       x,
                                                                       gint                       y);
135
GDK_AVAILABLE_IN_ALL
136
GtkToolItemGroup*              gtk_tool_palette_get_drop_group        (GtkToolPalette            *palette,
Johannes Schmid's avatar
Johannes Schmid committed
137
138
                                                                       gint                       x,
                                                                       gint                       y);
139
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
140
141
142
GtkWidget*                     gtk_tool_palette_get_drag_item         (GtkToolPalette            *palette,
                                                                       const GtkSelectionData    *selection);

143
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
144
145
void                           gtk_tool_palette_set_drag_source       (GtkToolPalette            *palette,
                                                                       GtkToolPaletteDragTargets  targets);
146
GDK_AVAILABLE_IN_ALL
Johannes Schmid's avatar
Johannes Schmid committed
147
148
149
150
151
152
void                           gtk_tool_palette_add_drag_dest         (GtkToolPalette            *palette,
                                                                       GtkWidget                 *widget,
                                                                       GtkDestDefaults            flags,
                                                                       GtkToolPaletteDragTargets  targets,
                                                                       GdkDragAction              actions);

Tadej Borovšak's avatar
Tadej Borovšak committed
153

154
GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_hadjustment)
Johannes Schmid's avatar
Johannes Schmid committed
155
GtkAdjustment*                 gtk_tool_palette_get_hadjustment       (GtkToolPalette            *palette);
156
GDK_DEPRECATED_IN_3_0_FOR(gtk_scrollable_get_vadjustment)
Johannes Schmid's avatar
Johannes Schmid committed
157
158
GtkAdjustment*                 gtk_tool_palette_get_vadjustment       (GtkToolPalette            *palette);

159
GDK_AVAILABLE_IN_ALL
160
const GtkTargetEntry*          gtk_tool_palette_get_drag_target_item  (void) G_GNUC_CONST;
161
GDK_AVAILABLE_IN_ALL
162
const GtkTargetEntry*          gtk_tool_palette_get_drag_target_group (void) G_GNUC_CONST;
Johannes Schmid's avatar
Johannes Schmid committed
163
164
165
166


G_END_DECLS

167
#endif /* __GTK_TOOL_PALETTE_H__ */