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

- Main Page
- Classes
- Files

- File List

CGTKAssistant.m
1 /*
2 * CGTKAssistant.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/CGTKAssistant.h"
33
34 @implementation CGTKAssistant
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_assistant_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkAssistant*)ASSISTANT
49 {
50 return GTK_ASSISTANT([self GOBJECT]);
51 }
52
53 -(void)addActionWidget:(CGTKWidget*) child
54 {
55 gtk_assistant_add_action_widget(GTK_ASSISTANT([self GOBJECT]), [child WIDGET]);
56 }
57
58 -(gint)appendPage:(CGTKWidget*) page
59 {
60 return gtk_assistant_append_page(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]);
61 }
62
63 -(void)commit
64 {
65 gtk_assistant_commit(GTK_ASSISTANT([self GOBJECT]));
66 }
67
68 -(gint)getCurrentPage
69 {
70 return gtk_assistant_get_current_page(GTK_ASSISTANT([self GOBJECT]));
71 }
72
73 -(gint)getNpages
74 {
75 return gtk_assistant_get_n_pages(GTK_ASSISTANT([self GOBJECT]));
76 }
77
78 -(CGTKWidget*)getNthPage:(gint) pageNum
79 {
80 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_assistant_get_nth_page(GTK_ASSISTANT([self GOBJECT]), pageNum)];
81 }
82
83 -(BOOL)getPageComplete:(CGTKWidget*) page
84 {
85 return (gtk_assistant_get_page_complete(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]) ? YES : NO);
86 }
87
88 -(BOOL)getPageHasPadding:(CGTKWidget*) page
89 {
90 return (gtk_assistant_get_page_has_padding(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]) ? YES : NO);
91 }
92
93 -(GdkPixbuf*)getPageHeaderImage:(CGTKWidget*) page
94 {
95 return gtk_assistant_get_page_header_image(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]);
96 }
97
98 -(GdkPixbuf*)getPageSideImage:(CGTKWidget*) page
99 {
100 return gtk_assistant_get_page_side_image(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]);
101 }
102
103 -(NSString*)getPageTitle:(CGTKWidget*) page
104 {
105 return [NSString stringWithUTF8String:gtk_assistant_get_page_title(GTK_ASSISTANT([self GOBJECT]), [page WIDGET])];
106 }
107
108 -(GtkAssistantPageType)getPageType:(CGTKWidget*) page
109 {
110 return gtk_assistant_get_page_type(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]);
111 }
112
113 -(gint)insertPageWithPage:(CGTKWidget*) page andPosition:(gint) position
114 {
115 return gtk_assistant_insert_page(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], position);
116 }
117
118 -(void)nextPage
119 {
120 gtk_assistant_next_page(GTK_ASSISTANT([self GOBJECT]));
121 }
122
123 -(gint)prependPage:(CGTKWidget*) page
124 {
125 return gtk_assistant_prepend_page(GTK_ASSISTANT([self GOBJECT]), [page WIDGET]);
126 }
127
128 -(void)previousPage
129 {
130 gtk_assistant_previous_page(GTK_ASSISTANT([self GOBJECT]));
131 }
132
133 -(void)removeActionWidget:(CGTKWidget*) child
134 {
135 gtk_assistant_remove_action_widget(GTK_ASSISTANT([self GOBJECT]), [child WIDGET]);
136 }
137
138 -(void)removePage:(gint) pageNum
139 {
140 gtk_assistant_remove_page(GTK_ASSISTANT([self GOBJECT]), pageNum);
141 }
142
143 -(void)setCurrentPage:(gint) pageNum
144 {
145 gtk_assistant_set_current_page(GTK_ASSISTANT([self GOBJECT]), pageNum);
146 }
147
148 -(void)setForwardPageFuncWithPageFunc:(GtkAssistantPageFunc) pageFunc andData:(gpointer) data andDestroy:(GDestroyNotify) destroy
149 {
150 gtk_assistant_set_forward_page_func(GTK_ASSISTANT([self GOBJECT]), pageFunc, data, destroy);
151 }
152
153 -(void)setPageCompleteWithPage:(CGTKWidget*) page andComplete:(BOOL) complete
154 {
155 gtk_assistant_set_page_complete(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], (complete ? TRUE : FALSE));
156 }
157
158 -(void)setPageHasPaddingWithPage:(CGTKWidget*) page andHasPadding:(BOOL) hasPadding
159 {
160 gtk_assistant_set_page_has_padding(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], (hasPadding ? TRUE : FALSE));
161 }
162
163 -(void)setPageHeaderImageWithPage:(CGTKWidget*) page andPixbuf:(GdkPixbuf*) pixbuf
164 {
165 gtk_assistant_set_page_header_image(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], pixbuf);
166 }
167
168 -(void)setPageSideImageWithPage:(CGTKWidget*) page andPixbuf:(GdkPixbuf*) pixbuf
169 {
170 gtk_assistant_set_page_side_image(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], pixbuf);
171 }
172
173 -(void)setPageTitleWithPage:(CGTKWidget*) page andTitle:(NSString*) title
174 {
175 gtk_assistant_set_page_title(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], [title UTF8String]);
176 }
177
178 -(void)setPageTypeWithPage:(CGTKWidget*) page andType:(GtkAssistantPageType) type
179 {
180 gtk_assistant_set_page_type(GTK_ASSISTANT([self GOBJECT]), [page WIDGET], type);
181 }
182
183 -(void)updateButtonsState
184 {
185 gtk_assistant_update_buttons_state(GTK_ASSISTANT([self GOBJECT]));
186 }
187
188
189 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKAssistant init]
id init()
Definition: CGTKAssistant.m:36
-[CGTKWidget destroy]
void destroy()
Definition: CGTKWidget.m:131
CGTKAssistant
Definition: CGTKAssistant.h:34
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKAssistant nextPage]
void nextPage()
Definition: CGTKAssistant.m:118
-[CGTKAssistant getNpages]
gint getNpages()
Definition: CGTKAssistant.m:73
-[CGTKAssistant ASSISTANT]
GtkAssistant * ASSISTANT()
Definition: CGTKAssistant.m:48
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKAssistant updateButtonsState]
void updateButtonsState()
Definition: CGTKAssistant.m:183
-[CGTKAssistant commit]
void commit()
Definition: CGTKAssistant.m:63
-[CGTKAssistant getCurrentPage]
gint getCurrentPage()
Definition: CGTKAssistant.m:68
-[CGTKAssistant previousPage]
void previousPage()
Definition: CGTKAssistant.m:128