2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkStatusbar.html
28 * strct = GtkStatusbar
52 private import gtk
.gtktypes
;
54 private import lib
.gtk
;
56 private import glib
.Str
;
60 * A GtkStatusbar is usually placed along the bottom of an application's main
61 * GtkWindow. It may provide a regular commentary of the application's status
62 * (as is usually the case in a web browser, for example), or may be used to
63 * simply output a message when the status changes, (when an upload is complete
64 * in an FTP client, for example).
65 * It may also have a resize grip (a triangular area in the lower right corner)
66 * which can be clicked on to resize the window containing the statusbar.
67 * Status bars in Gtk+ maintain a stack of messages. The message at
68 * the top of the each bar's stack is the one that will currently be displayed.
69 * Any messages added to a statusbar's stack must specify a context_id
70 * that is used to uniquely identify the source of a message. This context_id can be
71 * generated by gtk_statusbar_get_context_id(), given a message and the
72 * statusbar that it will be added to. Note that messages are stored in a
73 * stack, and when choosing which message to display, the stack structure is
74 * adhered to, regardless of the context identifier of a message.
75 * Status bars are created using gtk_statusbar_new().
76 * Messages are added to the bar's stack with gtk_statusbar_push().
77 * The message at the top of the stack can be removed using gtk_statusbar_pop(). A message can be removed from anywhere in the stack if its message_id was recorded at the time it was added. This is done using gtk_statusbar_remove().
79 private import gtk
.HBox
;
80 public class Statusbar
: HBox
83 /** the main Gtk struct */
84 protected GtkStatusbar
* gtkStatusbar
;
87 public GtkStatusbar
* getStatusbarStruct()
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)gtkStatusbar
;
100 * Sets our main struct and passes it to the parent class
102 public this (GtkStatusbar
* gtkStatusbar
)
104 super(cast(GtkHBox
*)gtkStatusbar
);
105 this.gtkStatusbar
= gtkStatusbar
;
111 // imports for the signal processing
112 private import gobject
.Signals
;
113 private import gdk
.gdktypes
;
114 int[char[]] connectedSignals
;
116 void delegate(guint
, char[], Statusbar
)[] onTextPoppedListeners
;
117 void addOnTextPopped(void delegate(guint
, char[], Statusbar
) dlg
)
119 if ( !("text-popped" in connectedSignals
) )
124 cast(GCallback
)&callBackTextPopped
,
127 cast(ConnectFlags
)0);
128 connectedSignals
["text-popped"] = 1;
130 onTextPoppedListeners
~= dlg
;
132 extern(C
) static void callBackTextPopped(GtkStatusbar
* statusbarStruct
, guint contextId
, gchar
* text
, Statusbar statusbar
)
134 bit consumed
= false;
136 foreach ( void delegate(guint
, char[], Statusbar
) dlg
; statusbar
.onTextPoppedListeners
)
138 dlg(contextId
, Str
.toString(text
), statusbar
);
144 void delegate(guint
, char[], Statusbar
)[] onTextPushedListeners
;
145 void addOnTextPushed(void delegate(guint
, char[], Statusbar
) dlg
)
147 if ( !("text-pushed" in connectedSignals
) )
152 cast(GCallback
)&callBackTextPushed
,
155 cast(ConnectFlags
)0);
156 connectedSignals
["text-pushed"] = 1;
158 onTextPushedListeners
~= dlg
;
160 extern(C
) static void callBackTextPushed(GtkStatusbar
* statusbarStruct
, guint contextId
, gchar
* text
, Statusbar statusbar
)
162 bit consumed
= false;
164 foreach ( void delegate(guint
, char[], Statusbar
) dlg
; statusbar
.onTextPushedListeners
)
166 dlg(contextId
, Str
.toString(text
), statusbar
);
175 * Creates a new GtkStatusbar ready for messages.
177 * the new GtkStatusbar.
181 // GtkWidget* gtk_statusbar_new (void);
182 this(cast(GtkStatusbar
*)gtk_statusbar_new() );
186 * Returns a new context identifier, given a description of the actual context.
189 * context_description:
190 * textual description of what context the new message is
195 public uint getContextId(char[] contextDescription
)
197 // guint gtk_statusbar_get_context_id (GtkStatusbar *statusbar, const gchar *context_description);
198 return gtk_statusbar_get_context_id(gtkStatusbar
, Str
.toStringz(contextDescription
));
202 * Pushes a new message onto a statusbar's stack.
206 * the message's context id, as returned by
207 * gtk_statusbar_get_context_id().
209 * the message to add to the statusbar.
211 * the message's new message id for use with gtk_statusbar_remove().
213 public uint push(uint contextId
, char[] text
)
215 // guint gtk_statusbar_push (GtkStatusbar *statusbar, guint context_id, const gchar *text);
216 return gtk_statusbar_push(gtkStatusbar
, contextId
, Str
.toStringz(text
));
220 * Removes the message at the top of a GtkStatusBar's stack.
224 * a context identifier.
226 public void pop(uint contextId
)
228 // void gtk_statusbar_pop (GtkStatusbar *statusbar, guint context_id);
229 gtk_statusbar_pop(gtkStatusbar
, contextId
);
233 * Forces the removal of a message from a statusbar's stack. The exact context_id and message_id must be specified.
237 * a context identifier.
239 * a message identifier, as returned by gtk_statusbar_push().
241 public void remove(uint contextId
, uint messageId
)
243 // void gtk_statusbar_remove (GtkStatusbar *statusbar, guint context_id, guint message_id);
244 gtk_statusbar_remove(gtkStatusbar
, contextId
, messageId
);
248 * Sets whether the statusbar has a resize grip. TRUE by default.
252 * TRUE to have a resize grip.
254 public void setHasResizeGrip(int setting
)
256 // void gtk_statusbar_set_has_resize_grip (GtkStatusbar *statusbar, gboolean setting);
257 gtk_statusbar_set_has_resize_grip(gtkStatusbar
, setting
);
261 * Returns whether the statusbar has a resize grip.
265 * TRUE if the statusbar has a resize grip.
267 * The "has-resize-grip" property
268 * "has-resize-grip" gboolean : Read / Write
269 * Whether the statusbar has a grip for resizing the toplevel window.
270 * Default value: TRUE
272 * Style Property Details
273 * The "shadow-type" style property
274 * "shadow-type" GtkShadowType : Read
275 * Style of bevel around the statusbar text.
276 * Default value: GTK_SHADOW_IN
278 * The "text-popped" signal
279 * void user_function (GtkStatusbar *statusbar,
282 * gpointer user_data) : Run last
283 * Is emitted whenever a new message is popped off a statusbar's stack.
285 * the object which received the signal.
287 * the context id of the relevant message/statusbar.
289 * the message that was just popped.
291 * user data set when the signal handler was connected.
293 public int getHasResizeGrip()
295 // gboolean gtk_statusbar_get_has_resize_grip (GtkStatusbar *statusbar);
296 return gtk_statusbar_get_has_resize_grip(gtkStatusbar
);