2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkAboutDialog.html
27 * outFile = AboutDialog
28 * strct = GtkAboutDialog
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWindow* -> Window
55 module gtk
.AboutDialog
;
61 import tango
.io
.Stdout
; // use the tango loging?
65 private import gtkc
.gtktypes
;
67 private import gtkc
.gtk
;
70 private import glib
.Str
;
71 private import gdk
.Pixbuf
;
72 private import gtk
.Window
;
79 * The GtkAboutDialog offers a simple way to display information about
80 * a program like its logo, name, copyright, website and license. It is
81 * also possible to give credits to the authors, documenters, translators
82 * and artists who have worked on the program. An about dialog is typically
83 * opened when the user selects the About option from
84 * the Help menu. All parts of the dialog are optional.
85 * About dialog often contain links and email addresses. GtkAboutDialog
86 * supports this by offering global hooks, which are called when the user
87 * clicks on a link or email address, see gtk_about_dialog_set_email_hook()
88 * and gtk_about_dialog_set_url_hook(). Email addresses in the
89 * authors, documenters and artists properties are recognized by looking for
90 * <user@host>, URLs are
91 * recognized by looking for http://url, with
92 * url extending to the next space, tab or line break.
93 * To make constructing a GtkAboutDialog as convenient as possible, you can
94 * use the function gtk_show_about_dialog() which constructs and shows a dialog
95 * and keeps it around so that it can be shown again.
97 private import gtk
.Dialog
;
98 public class AboutDialog
: Dialog
101 /** the main Gtk struct */
102 protected GtkAboutDialog
* gtkAboutDialog
;
105 public GtkAboutDialog
* getAboutDialogStruct()
107 return gtkAboutDialog
;
111 /** the main Gtk struct as a void* */
112 protected void* getStruct()
114 return cast(void*)gtkAboutDialog
;
118 * Sets our main struct and passes it to the parent class
120 public this (GtkAboutDialog
* gtkAboutDialog
)
124 if ( gtkAboutDialog
is null )
129 Stdout("struct gtkAboutDialog is null on constructor").newline
;
133 printf("struct gtkAboutDialog is null on constructor");
140 assert(gtkAboutDialog
!is null, "struct gtkAboutDialog is null on constructor");
142 super(cast(GtkDialog
*)gtkAboutDialog
);
143 this.gtkAboutDialog
= gtkAboutDialog
;
151 * Creates a new GtkAboutDialog.
153 * a newly created GtkAboutDialog
158 // GtkWidget* gtk_about_dialog_new (void);
159 this(cast(GtkAboutDialog
*)gtk_about_dialog_new() );
163 * Returns the program name displayed in the about dialog.
167 * The program name. The string is owned by the about
168 * dialog and must not be modified.
171 public char[] getName()
173 // const gchar* gtk_about_dialog_get_name (GtkAboutDialog *about);
174 return Str
.toString(gtk_about_dialog_get_name(gtkAboutDialog
) );
178 * Sets the name to display in the about dialog.
179 * If this is not set, it defaults to g_get_application_name().
186 public void setName(char[] name
)
188 // void gtk_about_dialog_set_name (GtkAboutDialog *about, const gchar *name);
189 gtk_about_dialog_set_name(gtkAboutDialog
, Str
.toStringz(name
));
193 * Returns the version string.
197 * The version string. The string is owned by the about
198 * dialog and must not be modified.
201 public char[] getVersion()
203 // const gchar* gtk_about_dialog_get_version (GtkAboutDialog *about);
204 return Str
.toString(gtk_about_dialog_get_version(gtkAboutDialog
) );
208 * Sets the version string to display in the about dialog.
215 public void setVersion(char[] versio
)
217 // void gtk_about_dialog_set_version (GtkAboutDialog *about, const gchar *version);
218 gtk_about_dialog_set_version(gtkAboutDialog
, Str
.toStringz(versio
));
222 * Returns the copyright string.
226 * The copyright string. The string is owned by the about
227 * dialog and must not be modified.
230 public char[] getCopyright()
232 // const gchar* gtk_about_dialog_get_copyright (GtkAboutDialog *about);
233 return Str
.toString(gtk_about_dialog_get_copyright(gtkAboutDialog
) );
237 * Sets the copyright string to display in the about dialog.
238 * This should be a short string of one or two lines.
242 * the copyright string
245 public void setCopyright(char[] copyright
)
247 // void gtk_about_dialog_set_copyright (GtkAboutDialog *about, const gchar *copyright);
248 gtk_about_dialog_set_copyright(gtkAboutDialog
, Str
.toStringz(copyright
));
252 * Returns the comments string.
256 * The comments. The string is owned by the about
257 * dialog and must not be modified.
260 public char[] getComments()
262 // const gchar* gtk_about_dialog_get_comments (GtkAboutDialog *about);
263 return Str
.toString(gtk_about_dialog_get_comments(gtkAboutDialog
) );
267 * Sets the comments string to display in the about
268 * dialog. This should be a short string of one or
276 public void setComments(char[] comments
)
278 // void gtk_about_dialog_set_comments (GtkAboutDialog *about, const gchar *comments);
279 gtk_about_dialog_set_comments(gtkAboutDialog
, Str
.toStringz(comments
));
283 * Returns the license information.
287 * The license information. The string is owned by the about
288 * dialog and must not be modified.
291 public char[] getLicense()
293 // const gchar* gtk_about_dialog_get_license (GtkAboutDialog *about);
294 return Str
.toString(gtk_about_dialog_get_license(gtkAboutDialog
) );
298 * Sets the license information to be displayed in the secondary
299 * license dialog. If license is NULL, the license button is
304 * the license information or NULL
307 public void setLicense(char[] license
)
309 // void gtk_about_dialog_set_license (GtkAboutDialog *about, const gchar *license);
310 gtk_about_dialog_set_license(gtkAboutDialog
, Str
.toStringz(license
));
314 * Returns whether the license text in about is
315 * automatically wrapped.
319 * TRUE if the license text is wrapped
322 public int getWrapLicense()
324 // gboolean gtk_about_dialog_get_wrap_license (GtkAboutDialog *about);
325 return gtk_about_dialog_get_wrap_license(gtkAboutDialog
);
329 * Sets whether the license text in about is
330 * automatically wrapped.
334 * whether to wrap the license
337 public void setWrapLicense(int wrapLicense
)
339 // void gtk_about_dialog_set_wrap_license (GtkAboutDialog *about, gboolean wrap_license);
340 gtk_about_dialog_set_wrap_license(gtkAboutDialog
, wrapLicense
);
344 * Returns the website URL.
348 * The website URL. The string is owned by the about
349 * dialog and must not be modified.
352 public char[] getWebsite()
354 // const gchar* gtk_about_dialog_get_website (GtkAboutDialog *about);
355 return Str
.toString(gtk_about_dialog_get_website(gtkAboutDialog
) );
359 * Sets the URL to use for the website link.
363 * a URL string starting with "http://"
366 public void setWebsite(char[] website
)
368 // void gtk_about_dialog_set_website (GtkAboutDialog *about, const gchar *website);
369 gtk_about_dialog_set_website(gtkAboutDialog
, Str
.toStringz(website
));
373 * Returns the label used for the website link.
377 * The label used for the website link. The string is owned by the about
378 * dialog and must not be modified.
381 public char[] getWebsiteLabel()
383 // const gchar* gtk_about_dialog_get_website_label (GtkAboutDialog *about);
384 return Str
.toString(gtk_about_dialog_get_website_label(gtkAboutDialog
) );
388 * Sets the label to be used for the website link.
389 * It defaults to the website URL.
393 * the label used for the website link
396 public void setWebsiteLabel(char[] websiteLabel
)
398 // void gtk_about_dialog_set_website_label (GtkAboutDialog *about, const gchar *website_label);
399 gtk_about_dialog_set_website_label(gtkAboutDialog
, Str
.toStringz(websiteLabel
));
403 * Returns the string which are displayed in the authors tab
404 * of the secondary credits dialog.
408 * A NULL-terminated string array containing
409 * the authors. The array is owned by the about dialog
410 * and must not be modified.
413 public char** getAuthors()
415 // const gchar* const * gtk_about_dialog_get_authors (GtkAboutDialog *about);
416 return gtk_about_dialog_get_authors(gtkAboutDialog
);
420 * Sets the strings which are displayed in the authors tab
421 * of the secondary credits dialog.
425 * a NULL-terminated array of strings
428 public void setAuthors(char** authors
)
430 // void gtk_about_dialog_set_authors (GtkAboutDialog *about, const gchar **authors);
431 gtk_about_dialog_set_authors(gtkAboutDialog
, authors
);
435 * Returns the string which are displayed in the artists tab
436 * of the secondary credits dialog.
440 * A NULL-terminated string array containing
441 * the artists. The array is owned by the about dialog
442 * and must not be modified.
445 public char** getArtists()
447 // const gchar* const * gtk_about_dialog_get_artists (GtkAboutDialog *about);
448 return gtk_about_dialog_get_artists(gtkAboutDialog
);
452 * Sets the strings which are displayed in the artists tab
453 * of the secondary credits dialog.
457 * a NULL-terminated array of strings
460 public void setArtists(char** artists
)
462 // void gtk_about_dialog_set_artists (GtkAboutDialog *about, const gchar **artists);
463 gtk_about_dialog_set_artists(gtkAboutDialog
, artists
);
467 * Returns the string which are displayed in the documenters
468 * tab of the secondary credits dialog.
472 * A NULL-terminated string array containing
473 * the documenters. The array is owned by the about dialog
474 * and must not be modified.
477 public char** getDocumenters()
479 // const gchar* const * gtk_about_dialog_get_documenters (GtkAboutDialog *about);
480 return gtk_about_dialog_get_documenters(gtkAboutDialog
);
484 * Sets the strings which are displayed in the documenters tab
485 * of the secondary credits dialog.
489 * a NULL-terminated array of strings
492 public void setDocumenters(char** documenters
)
494 // void gtk_about_dialog_set_documenters (GtkAboutDialog *about, const gchar **documenters);
495 gtk_about_dialog_set_documenters(gtkAboutDialog
, documenters
);
499 * Returns the translator credits string which is displayed
500 * in the translators tab of the secondary credits dialog.
504 * The translator credits string. The string is
505 * owned by the about dialog and must not be modified.
508 public char[] getTranslatorCredits()
510 // const gchar* gtk_about_dialog_get_translator_credits (GtkAboutDialog *about);
511 return Str
.toString(gtk_about_dialog_get_translator_credits(gtkAboutDialog
) );
515 * Sets the translator credits string which is displayed in
516 * the translators tab of the secondary credits dialog.
517 * The intended use for this string is to display the translator
518 * of the language which is currently used in the user interface.
519 * Using gettext(), a simple way to achieve that is to mark the
520 * string for translation:
521 * gtk_about_dialog_set_translator_credits (about, _("translator-credits"));
522 * It is a good idea to use the customary msgid "translator-credits" for this
523 * purpose, since translators will already know the purpose of that msgid, and
524 * since GtkAboutDialog will detect if "translator-credits" is untranslated
528 * translator_credits:
529 * the translator credits
532 public void setTranslatorCredits(char[] translatorCredits
)
534 // void gtk_about_dialog_set_translator_credits (GtkAboutDialog *about, const gchar *translator_credits);
535 gtk_about_dialog_set_translator_credits(gtkAboutDialog
, Str
.toStringz(translatorCredits
));
539 * Returns the pixbuf displayed as logo in the about dialog.
543 * the pixbuf displayed as logo. The pixbuf is
544 * owned by the about dialog. If you want to keep a reference
545 * to it, you have to call g_object_ref() on it.
548 public Pixbuf
getLogo()
550 // GdkPixbuf* gtk_about_dialog_get_logo (GtkAboutDialog *about);
551 return new Pixbuf( gtk_about_dialog_get_logo(gtkAboutDialog
) );
555 * Sets the pixbuf to be displayed as logo in
556 * the about dialog. If it is NULL, the default
557 * window icon set with gtk_window_set_default_icon()
562 * a GdkPixbuf, or NULL
565 public void setLogo(Pixbuf logo
)
567 // void gtk_about_dialog_set_logo (GtkAboutDialog *about, GdkPixbuf *logo);
568 gtk_about_dialog_set_logo(gtkAboutDialog
, (logo
is null) ?
null : logo
.getPixbufStruct());
572 * Returns the icon name displayed as logo in the about dialog.
576 * the icon name displayed as logo. The string is
577 * owned by the dialog. If you want to keep a reference
578 * to it, you have to call g_strdup() on it.
581 public char[] getLogoIconName()
583 // const gchar* gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about);
584 return Str
.toString(gtk_about_dialog_get_logo_icon_name(gtkAboutDialog
) );
588 * Sets the pixbuf to be displayed as logo in
589 * the about dialog. If it is NULL, the default
590 * window icon set with gtk_window_set_default_icon()
595 * an icon name, or NULL
598 public void setLogoIconName(char[] iconName
)
600 // void gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about, const gchar *icon_name);
601 gtk_about_dialog_set_logo_icon_name(gtkAboutDialog
, Str
.toStringz(iconName
));
606 * Installs a global function to be called whenever the user activates an
607 * email link in an about dialog.
609 * a function to call when an email link is activated.
611 * data to pass to func
613 * GDestroyNotify for data
615 * the previous email hook.
618 public static GtkAboutDialogActivateLinkFunc
setEmailHook(GtkAboutDialogActivateLinkFunc func
, void* data
, GDestroyNotify destroy
)
620 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
621 return gtk_about_dialog_set_email_hook(func
, data
, destroy
);
625 * Installs a global function to be called whenever the user activates a
626 * URL link in an about dialog.
628 * a function to call when a URL link is activated.
630 * data to pass to func
632 * GDestroyNotify for data
634 * the previous URL hook.
637 public static GtkAboutDialogActivateLinkFunc
setUrlHook(GtkAboutDialogActivateLinkFunc func
, void* data
, GDestroyNotify destroy
)
639 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
640 return gtk_about_dialog_set_url_hook(func
, data
, destroy
);
644 * This is a convenience function for showing an application's about box.
645 * The constructed dialog is associated with the parent window and
646 * reused for future invocations of this function.
648 * transient parent, or NULL for none
649 * first_property_name:
650 * the name of the first property
652 * value of first property, followed by more properties, NULL-terminated
655 * The "artists" property
656 * "artists" GStrv : Read / Write
657 * The people who contributed artwork to the program, as a NULL-terminated array of strings.
658 * Each string may contain email addresses and URLs, which will be displayed
659 * as links, see the introduction for more details.
662 public static void showAboutDialog(Window parent
, char[] firstPropertyName
, ... )
664 // void gtk_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...);
665 gtk_show_about_dialog((parent
is null) ?
null : parent
.getWindowStruct(), Str
.toStringz(firstPropertyName
));