CoreGTK 3.18.0 CoreGTK is an Objective-C language binding for the GTK+ widget toolkit

- Main Page
- Classes
- Files

- File List

CGTKToolPalette.m
1 /*
2 * CGTKToolPalette.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2016 - Tyler Burton
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library 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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 * Modified by the CoreGTK Team, 2016. See the AUTHORS file for a
24 * list of people on the CoreGTK Team.
25 * See the ChangeLog files for a list of changes.
26 *
27 */
28
29 /*
30 * Objective-C imports
31 */
32 #import "CoreGTK/CGTKToolPalette.h"
33
34 @implementation CGTKToolPalette
35
36 +(const GtkTargetEntry*)getDragTargetGroup
37 {
38 return gtk_tool_palette_get_drag_target_group();
39 }
40
41 +(const GtkTargetEntry*)getDragTargetItem
42 {
43 return gtk_tool_palette_get_drag_target_item();
44 }
45
46 -(id)init
47 {
48 self = [super initWithGObject:(GObject *)gtk_tool_palette_new()];
49
50 if(self)
51 {
52 //Do nothing
53 }
54
55 return self;
56 }
57
58 -(GtkToolPalette*)TOOLPALETTE
59 {
60 return GTK_TOOL_PALETTE([self GOBJECT]);
61 }
62
63 -(void)addDragDestWithWidget:(CGTKWidget*) widget andFlags:(GtkDestDefaults) flags andTargets:(GtkToolPaletteDragTargets) targets andActions:(GdkDragAction) actions
64 {
65 gtk_tool_palette_add_drag_dest(GTK_TOOL_PALETTE([self GOBJECT]), [widget WIDGET], flags, targets, actions);
66 }
67
68 -(CGTKWidget*)getDragItem:(const GtkSelectionData*) selection
69 {
70 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_tool_palette_get_drag_item(GTK_TOOL_PALETTE([self GOBJECT]), selection)];
71 }
72
73 -(GtkToolItemGroup*)getDropGroupWithX:(gint) x andY:(gint) y
74 {
75 return gtk_tool_palette_get_drop_group(GTK_TOOL_PALETTE([self GOBJECT]), x, y);
76 }
77
78 -(GtkToolItem*)getDropItemWithX:(gint) x andY:(gint) y
79 {
80 return gtk_tool_palette_get_drop_item(GTK_TOOL_PALETTE([self GOBJECT]), x, y);
81 }
82
83 -(BOOL)getExclusive:(GtkToolItemGroup*) group
84 {
85 return (gtk_tool_palette_get_exclusive(GTK_TOOL_PALETTE([self GOBJECT]), group) ? YES : NO);
86 }
87
88 -(BOOL)getExpand:(GtkToolItemGroup*) group
89 {
90 return (gtk_tool_palette_get_expand(GTK_TOOL_PALETTE([self GOBJECT]), group) ? YES : NO);
91 }
92
93 -(gint)getGroupPosition:(GtkToolItemGroup*) group
94 {
95 return gtk_tool_palette_get_group_position(GTK_TOOL_PALETTE([self GOBJECT]), group);
96 }
97
98 -(GtkAdjustment*)getHadjustment
99 {
100 return gtk_tool_palette_get_hadjustment(GTK_TOOL_PALETTE([self GOBJECT]));
101 }
102
103 -(GtkIconSize)getIconSize
104 {
105 return gtk_tool_palette_get_icon_size(GTK_TOOL_PALETTE([self GOBJECT]));
106 }
107
108 -(GtkToolbarStyle)getStyle
109 {
110 return gtk_tool_palette_get_style(GTK_TOOL_PALETTE([self GOBJECT]));
111 }
112
113 -(GtkAdjustment*)getVadjustment
114 {
115 return gtk_tool_palette_get_vadjustment(GTK_TOOL_PALETTE([self GOBJECT]));
116 }
117
118 -(void)setDragSource:(GtkToolPaletteDragTargets) targets
119 {
120 gtk_tool_palette_set_drag_source(GTK_TOOL_PALETTE([self GOBJECT]), targets);
121 }
122
123 -(void)setExclusiveWithGroup:(GtkToolItemGroup*) group andExclusive:(BOOL) exclusive
124 {
125 gtk_tool_palette_set_exclusive(GTK_TOOL_PALETTE([self GOBJECT]), group, (exclusive ? TRUE : FALSE));
126 }
127
128 -(void)setExpandWithGroup:(GtkToolItemGroup*) group andExpand:(BOOL) expand
129 {
130 gtk_tool_palette_set_expand(GTK_TOOL_PALETTE([self GOBJECT]), group, (expand ? TRUE : FALSE));
131 }
132
133 -(void)setGroupPositionWithGroup:(GtkToolItemGroup*) group andPosition:(gint) position
134 {
135 gtk_tool_palette_set_group_position(GTK_TOOL_PALETTE([self GOBJECT]), group, position);
136 }
137
138 -(void)setIconSize:(GtkIconSize) iconSize
139 {
140 gtk_tool_palette_set_icon_size(GTK_TOOL_PALETTE([self GOBJECT]), iconSize);
141 }
142
143 -(void)setStyle:(GtkToolbarStyle) style
144 {
145 gtk_tool_palette_set_style(GTK_TOOL_PALETTE([self GOBJECT]), style);
146 }
147
148 -(void)unsetIconSize
149 {
150 gtk_tool_palette_unset_icon_size(GTK_TOOL_PALETTE([self GOBJECT]));
151 }
152
153 -(void)unsetStyle
154 {
155 gtk_tool_palette_unset_style(GTK_TOOL_PALETTE([self GOBJECT]));
156 }
157
158
159 @end
-[CGTKToolPalette unsetStyle]
void unsetStyle()
Definition: CGTKToolPalette.m:153
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKToolPalette getIconSize]
GtkIconSize getIconSize()
Definition: CGTKToolPalette.m:103
-[CGTKToolPalette unsetIconSize]
void unsetIconSize()
Definition: CGTKToolPalette.m:148
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
+[CGTKToolPalette getDragTargetGroup]
const GtkTargetEntry * getDragTargetGroup()
Definition: CGTKToolPalette.m:36
-[CGTKToolPalette TOOLPALETTE]
GtkToolPalette * TOOLPALETTE()
Definition: CGTKToolPalette.m:58
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKToolPalette getHadjustment]
GtkAdjustment * getHadjustment()
Definition: CGTKToolPalette.m:98
-[CGTKToolPalette init]
id init()
Definition: CGTKToolPalette.m:46
-[CGTKToolPalette getVadjustment]
GtkAdjustment * getVadjustment()
Definition: CGTKToolPalette.m:113
CGTKToolPalette
Definition: CGTKToolPalette.h:34
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKToolPalette getStyle]
GtkToolbarStyle getStyle()
Definition: CGTKToolPalette.m:108