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 = GtkAboutDialog.html
27 * outFile = AboutDialog
28 * strct = GtkAboutDialog
49 * - GdkPixbuf* -> Pixbuf
50 * - GtkWindow* -> Window
54 module gtk
.AboutDialog
;
56 private import gtk
.gtktypes
;
58 private import lib
.gtk
;
60 private import glib
.Str
;
61 private import gdk
.Pixbuf
;
62 private import gtk
.Window
;
66 * The GtkAboutDialog offers a simple way to display information about
67 * a program like its logo, name, copyright, website and license. It is
68 * also possible to give credits to the authors, documenters, translators
69 * and artists who have worked on the program. An about dialog is typically
70 * opened when the user selects the About option from
71 * the Help menu. All parts of the dialog are optional.
72 * About dialog often contain links and email addresses. GtkAboutDialog
73 * supports this by offering global hooks, which are called when the user
74 * clicks on a link or email address, see gtk_about_dialog_set_email_hook()
75 * and gtk_about_dialog_set_url_hook(). Email addresses in the
76 * authors, documenters and artists properties are recognized by looking for
77 * <user@host>, URLs are
78 * recognized by looking for http://url, with
79 * url extending to the next space, tab or line break.
80 * To make constructing a GtkAboutDialog as convenient as possible, you can
81 * use the function gtk_show_about_dialog() which constructs and shows a dialog
82 * and keeps it around so that it can be shown again.
84 private import gtk
.Dialog
;
85 public class AboutDialog
: Dialog
88 /** the main Gtk struct */
89 protected GtkAboutDialog
* gtkAboutDialog
;
92 public GtkAboutDialog
* getAboutDialogStruct()
94 return gtkAboutDialog
;
98 /** the main Gtk struct as a void* */
99 protected void* getStruct()
101 return cast(void*)gtkAboutDialog
;
105 * Sets our main struct and passes it to the parent class
107 public this (GtkAboutDialog
* gtkAboutDialog
)
109 super(cast(GtkDialog
*)gtkAboutDialog
);
110 this.gtkAboutDialog
= gtkAboutDialog
;
118 * Creates a new GtkAboutDialog.
120 * a newly created GtkAboutDialog
125 // GtkWidget* gtk_about_dialog_new (void);
126 this(cast(GtkAboutDialog
*)gtk_about_dialog_new() );
130 * Returns the program name displayed in the about dialog.
134 * The program name. The string is owned by the about
135 * dialog and must not be modified.
138 public char[] getName()
140 // const gchar* gtk_about_dialog_get_name (GtkAboutDialog *about);
141 return Str
.toString(gtk_about_dialog_get_name(gtkAboutDialog
) );
145 * Sets the name to display in the about dialog.
146 * If this is not set, it defaults to g_get_application_name().
153 public void setName(char[] name
)
155 // void gtk_about_dialog_set_name (GtkAboutDialog *about, const gchar *name);
156 gtk_about_dialog_set_name(gtkAboutDialog
, Str
.toStringz(name
));
160 * Returns the version string.
164 * The version string. The string is owned by the about
165 * dialog and must not be modified.
168 public char[] getVersion()
170 // const gchar* gtk_about_dialog_get_version (GtkAboutDialog *about);
171 return Str
.toString(gtk_about_dialog_get_version(gtkAboutDialog
) );
175 * Sets the version string to display in the about dialog.
182 public void setVersion(char[] versio
)
184 // void gtk_about_dialog_set_version (GtkAboutDialog *about, const gchar *version);
185 gtk_about_dialog_set_version(gtkAboutDialog
, Str
.toStringz(versio
));
189 * Returns the copyright string.
193 * The copyright string. The string is owned by the about
194 * dialog and must not be modified.
197 public char[] getCopyright()
199 // const gchar* gtk_about_dialog_get_copyright (GtkAboutDialog *about);
200 return Str
.toString(gtk_about_dialog_get_copyright(gtkAboutDialog
) );
204 * Sets the copyright string to display in the about dialog.
205 * This should be a short string of one or two lines.
209 * the copyright string
212 public void setCopyright(char[] copyright
)
214 // void gtk_about_dialog_set_copyright (GtkAboutDialog *about, const gchar *copyright);
215 gtk_about_dialog_set_copyright(gtkAboutDialog
, Str
.toStringz(copyright
));
219 * Returns the comments string.
223 * The comments. The string is owned by the about
224 * dialog and must not be modified.
227 public char[] getComments()
229 // const gchar* gtk_about_dialog_get_comments (GtkAboutDialog *about);
230 return Str
.toString(gtk_about_dialog_get_comments(gtkAboutDialog
) );
234 * Sets the comments string to display in the about
235 * dialog. This should be a short string of one or
243 public void setComments(char[] comments
)
245 // void gtk_about_dialog_set_comments (GtkAboutDialog *about, const gchar *comments);
246 gtk_about_dialog_set_comments(gtkAboutDialog
, Str
.toStringz(comments
));
250 * Returns the license information.
254 * The license information. The string is owned by the about
255 * dialog and must not be modified.
258 public char[] getLicense()
260 // const gchar* gtk_about_dialog_get_license (GtkAboutDialog *about);
261 return Str
.toString(gtk_about_dialog_get_license(gtkAboutDialog
) );
265 * Sets the license information to be displayed in the secondary
266 * license dialog. If license is NULL, the license button is
271 * the license information or NULL
274 public void setLicense(char[] license
)
276 // void gtk_about_dialog_set_license (GtkAboutDialog *about, const gchar *license);
277 gtk_about_dialog_set_license(gtkAboutDialog
, Str
.toStringz(license
));
281 * Returns whether the license text in about is
282 * automatically wrapped.
286 * TRUE if the license text is wrapped
289 public int getWrapLicense()
291 // gboolean gtk_about_dialog_get_wrap_license (GtkAboutDialog *about);
292 return gtk_about_dialog_get_wrap_license(gtkAboutDialog
);
296 * Sets whether the license text in about is
297 * automatically wrapped.
301 * whether to wrap the license
304 public void setWrapLicense(int wrapLicense
)
306 // void gtk_about_dialog_set_wrap_license (GtkAboutDialog *about, gboolean wrap_license);
307 gtk_about_dialog_set_wrap_license(gtkAboutDialog
, wrapLicense
);
311 * Returns the website URL.
315 * The website URL. The string is owned by the about
316 * dialog and must not be modified.
319 public char[] getWebsite()
321 // const gchar* gtk_about_dialog_get_website (GtkAboutDialog *about);
322 return Str
.toString(gtk_about_dialog_get_website(gtkAboutDialog
) );
326 * Sets the URL to use for the website link.
330 * a URL string starting with "http://"
333 public void setWebsite(char[] website
)
335 // void gtk_about_dialog_set_website (GtkAboutDialog *about, const gchar *website);
336 gtk_about_dialog_set_website(gtkAboutDialog
, Str
.toStringz(website
));
340 * Returns the label used for the website link.
344 * The label used for the website link. The string is owned by the about
345 * dialog and must not be modified.
348 public char[] getWebsiteLabel()
350 // const gchar* gtk_about_dialog_get_website_label (GtkAboutDialog *about);
351 return Str
.toString(gtk_about_dialog_get_website_label(gtkAboutDialog
) );
355 * Sets the label to be used for the website link.
356 * It defaults to the website URL.
360 * the label used for the website link
363 public void setWebsiteLabel(char[] websiteLabel
)
365 // void gtk_about_dialog_set_website_label (GtkAboutDialog *about, const gchar *website_label);
366 gtk_about_dialog_set_website_label(gtkAboutDialog
, Str
.toStringz(websiteLabel
));
370 * Returns the string which are displayed in the authors tab
371 * of the secondary credits dialog.
375 * A NULL-terminated string array containing
376 * the authors. The array is owned by the about dialog
377 * and must not be modified.
380 public char** getAuthors()
382 // const gchar* const * gtk_about_dialog_get_authors (GtkAboutDialog *about);
383 return gtk_about_dialog_get_authors(gtkAboutDialog
);
387 * Sets the strings which are displayed in the authors tab
388 * of the secondary credits dialog.
392 * a NULL-terminated array of strings
395 public void setAuthors(char** authors
)
397 // void gtk_about_dialog_set_authors (GtkAboutDialog *about, const gchar **authors);
398 gtk_about_dialog_set_authors(gtkAboutDialog
, authors
);
402 * Returns the string which are displayed in the artists tab
403 * of the secondary credits dialog.
407 * A NULL-terminated string array containing
408 * the artists. The array is owned by the about dialog
409 * and must not be modified.
412 public char** getArtists()
414 // const gchar* const * gtk_about_dialog_get_artists (GtkAboutDialog *about);
415 return gtk_about_dialog_get_artists(gtkAboutDialog
);
419 * Sets the strings which are displayed in the artists tab
420 * of the secondary credits dialog.
424 * a NULL-terminated array of strings
427 public void setArtists(char** artists
)
429 // void gtk_about_dialog_set_artists (GtkAboutDialog *about, const gchar **artists);
430 gtk_about_dialog_set_artists(gtkAboutDialog
, artists
);
434 * Returns the string which are displayed in the documenters
435 * tab of the secondary credits dialog.
439 * A NULL-terminated string array containing
440 * the documenters. The array is owned by the about dialog
441 * and must not be modified.
444 public char** getDocumenters()
446 // const gchar* const * gtk_about_dialog_get_documenters (GtkAboutDialog *about);
447 return gtk_about_dialog_get_documenters(gtkAboutDialog
);
451 * Sets the strings which are displayed in the documenters tab
452 * of the secondary credits dialog.
456 * a NULL-terminated array of strings
459 public void setDocumenters(char** documenters
)
461 // void gtk_about_dialog_set_documenters (GtkAboutDialog *about, const gchar **documenters);
462 gtk_about_dialog_set_documenters(gtkAboutDialog
, documenters
);
466 * Returns the translator credits string which is displayed
467 * in the translators tab of the secondary credits dialog.
471 * The translator credits string. The string is
472 * owned by the about dialog and must not be modified.
475 public char[] getTranslatorCredits()
477 // const gchar* gtk_about_dialog_get_translator_credits (GtkAboutDialog *about);
478 return Str
.toString(gtk_about_dialog_get_translator_credits(gtkAboutDialog
) );
482 * Sets the translator credits string which is displayed in
483 * the translators tab of the secondary credits dialog.
484 * The intended use for this string is to display the translator
485 * of the language which is currently used in the user interface.
486 * Using gettext(), a simple way to achieve that is to mark the
487 * string for translation:
488 * gtk_about_dialog_set_translator_credits (about, _("translator-credits"));
489 * It is a good idea to use the customary msgid "translator-credits" for this
490 * purpose, since translators will already know the purpose of that msgid, and
491 * since GtkAboutDialog will detect if "translator-credits" is untranslated
495 * translator_credits:
496 * the translator credits
499 public void setTranslatorCredits(char[] translatorCredits
)
501 // void gtk_about_dialog_set_translator_credits (GtkAboutDialog *about, const gchar *translator_credits);
502 gtk_about_dialog_set_translator_credits(gtkAboutDialog
, Str
.toStringz(translatorCredits
));
506 * Returns the pixbuf displayed as logo in the about dialog.
510 * the pixbuf displayed as logo. The pixbuf is
511 * owned by the about dialog. If you want to keep a reference
512 * to it, you have to call g_object_ref() on it.
515 public Pixbuf
getLogo()
517 // GdkPixbuf* gtk_about_dialog_get_logo (GtkAboutDialog *about);
518 return new Pixbuf( gtk_about_dialog_get_logo(gtkAboutDialog
) );
522 * Sets the pixbuf to be displayed as logo in
523 * the about dialog. If it is NULL, the default
524 * window icon set with gtk_window_set_default_icon()
529 * a GdkPixbuf, or NULL
532 public void setLogo(Pixbuf logo
)
534 // void gtk_about_dialog_set_logo (GtkAboutDialog *about, GdkPixbuf *logo);
535 gtk_about_dialog_set_logo(gtkAboutDialog
, (logo
is null) ?
null : logo
.getPixbufStruct());
539 * Returns the icon name displayed as logo in the about dialog.
543 * the icon name displayed as logo. The string is
544 * owned by the dialog. If you want to keep a reference
545 * to it, you have to call g_strdup() on it.
548 public char[] getLogoIconName()
550 // const gchar* gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about);
551 return Str
.toString(gtk_about_dialog_get_logo_icon_name(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 * an icon name, or NULL
565 public void setLogoIconName(char[] iconName
)
567 // void gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about, const gchar *icon_name);
568 gtk_about_dialog_set_logo_icon_name(gtkAboutDialog
, Str
.toStringz(iconName
));
573 * Installs a global function to be called whenever the user activates an
574 * email link in an about dialog.
576 * a function to call when an email link is activated.
578 * data to pass to func
580 * GDestroyNotify for data
582 * the previous email hook.
585 public static GtkAboutDialogActivateLinkFunc
setEmailHook(GtkAboutDialogActivateLinkFunc func
, void* data
, GDestroyNotify destroy
)
587 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
588 return gtk_about_dialog_set_email_hook(func
, data
, destroy
);
592 * Installs a global function to be called whenever the user activates a
593 * URL link in an about dialog.
595 * a function to call when a URL link is activated.
597 * data to pass to func
599 * GDestroyNotify for data
601 * the previous URL hook.
604 public static GtkAboutDialogActivateLinkFunc
setUrlHook(GtkAboutDialogActivateLinkFunc func
, void* data
, GDestroyNotify destroy
)
606 // GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func, gpointer data, GDestroyNotify destroy);
607 return gtk_about_dialog_set_url_hook(func
, data
, destroy
);
611 * This is a convenience function for showing an application's about box.
612 * The constructed dialog is associated with the parent window and
613 * reused for future invocations of this function.
615 * transient parent, or NULL for none
616 * first_property_name:
617 * the name of the first property
619 * value of first property, followed by more properties, NULL-terminated
622 * The "artists" property
623 * "artists" GStrv : Read / Write
624 * The people who contributed artwork to the program, as a NULL-terminated array of strings.
625 * Each string may contain email addresses and URLs, which will be displayed
626 * as links, see the introduction for more details.
629 public static void showAboutDialog(Window parent
, char[] firstPropertyName
, ... )
631 // void gtk_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...);
632 gtk_show_about_dialog((parent
is null) ?
null : parent
.getWindowStruct(), Str
.toStringz(firstPropertyName
));