eb0536 | 2005-11-05 | Henrik Grubbström (Grubba) | | /* -*- C -*- */
|
1a0554 | 2005-07-28 | Martin Nilsson | | require gtk26;
class GTK2.AboutDialog;
inherit GTK2.Dialog;
//! Properties:
|
3d7663 | 2005-11-03 | Lance Dillon | | //! array(string) artists
//! array(string) authors
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! string comments
//! string copyright
|
3d7663 | 2005-11-03 | Lance Dillon | | //! array(string) documenters
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! string license
//! GDK2.Pixbuf logo
//! string logo-icon-name
//! string name
//! string translator-credits
//! string version
//! string website
//! string website-label
//! <p>
//! Style properties:
//! GDK2.Color link-color
|
3d7663 | 2005-11-03 | Lance Dillon | | void create(?mapping(string:mixed) props)
|
f28449 | 2006-08-03 | Lance Dillon | | //! Create a new GTK2.AboutDialog.
|
3d7663 | 2005-11-03 | Lance Dillon | | {
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_not_inited();
pgtk2_verify_setup();
|
3d7663 | 2005-11-03 | Lance Dillon | | if (args) {
INIT_WITH_PROPS(GTK_TYPE_ABOUT_DIALOG);
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_pop_n_elems(args);
|
3d7663 | 2005-11-03 | Lance Dillon | | } else {
GtkWidget *ga;
ga=gtk_about_dialog_new();
THIS->obj=G_OBJECT(ga);
}
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2__init_this_object();
|
3d7663 | 2005-11-03 | Lance Dillon | | }
|
1a0554 | 2005-07-28 | Martin Nilsson | |
|
c37a15 | 2007-10-14 | Lance Dillon | | not gtk212;
|
1a0554 | 2005-07-28 | Martin Nilsson | | string get_name();
//! Returns the program name.
void set_name(string name);
//! Sets the name to display.
|
c37a15 | 2007-10-14 | Lance Dillon | | endnot;
require gtk212;
string get_program_name();
//! Returns the program name.
void set_program_name(string name);
//! Sets the name to display in the dialog.
endrequire;
|
1a0554 | 2005-07-28 | Martin Nilsson | |
string get_version();
//! Returns the version string.
void set_version(string version);
//! Sets the version string.
string get_copyright();
//! Returns the copyright string.
void set_copyright(string copyright);
//! Sets the copyright string.
string get_comments();
//! Returns the comments string.
void set_comments(string comments);
//! Sets the comment string.
string get_license();
//! Returns the license information.
void set_license(string license);
//! Sets the license information.
|
3d7663 | 2005-11-03 | Lance Dillon | | require gtk28;
int get_wrap_license();
//! Returns whether the license text is automatically wrapped.
void set_wrap_license(int setting);
//! Sets whether the license text is automatically wrapped.
endrequire;
|
1a0554 | 2005-07-28 | Martin Nilsson | | string get_website();
//! Returns the website URL.
void set_website(string website);
//! Sets the URL to use for the website link.
string get_website_label();
//! Returns the label used for the website link.
void set_website_label(string label);
//! Sets the label used for the website link. Defaults to the website URL.
|
3d7663 | 2005-11-03 | Lance Dillon | | array(string) get_authors()
//! Returns the strings which are displayed in the authors tab of the
//! secondary credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
pgtk2_pop_n_elems(args);
|
3d7663 | 2005-11-03 | Lance Dillon | | {
const gchar * const *auth;
int i=0;
auth=gtk_about_dialog_get_authors(GTK_ABOUT_DIALOG(THIS->obj));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | while (auth[i]) {
|
74a5dd | 2010-09-19 | Marcus Comstedt | | PGTK_PUSH_GCHAR(auth[i++]);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | f_utf8_to_string(1);
}
|
3d7663 | 2005-11-03 | Lance Dillon | | f_aggregate(i);
}
}
void set_authors(array(string) auth)
//! Sets the strings which are displayed in the authors tab of the secondary
//! credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
3d7663 | 2005-11-03 | Lance Dillon | | {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | ONERROR err;
|
3d7663 | 2005-11-03 | Lance Dillon | | struct array *a;
int i,j;
const gchar **auth;
get_all_args("set_authors",args,"%A",&a);
if (a==NULL)
Pike_error("Invalid array.\n");
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
/* Make sure we have space for the strings on the stack. */
check_stack(a->size+2);
auth=xalloc(sizeof(gchar *)*(a->size+1));
SET_ONERROR(err, free, auth);
|
3d7663 | 2005-11-03 | Lance Dillon | | for (i=j=0; i<a->size; i++) {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | if (ITEM(a)[i].type == PIKE_T_STRING) {
ref_push_string(ITEM(a)[i].u.string);
f_string_to_utf8(1);
#ifdef PIKE_DEBUG
if ((Pike_sp[-1].type != PIKE_T_STRING) ||
(Pike_sp[-1].u.string->size_shift)) {
Pike_fatal("Unexpected result from string_to_utf8: %s\n",
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | get_name_of_type(Pike_sp[-1].type));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | }
#endif /* PIKE_DEBUG */
auth[j++] = Pike_sp[-1].u.string->str;
|
3d7663 | 2005-11-03 | Lance Dillon | | }
}
auth[j]=NULL;
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
|
3d7663 | 2005-11-03 | Lance Dillon | | gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(THIS->obj),auth);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
pop_n_elems(j);
CALL_AND_UNSET_ONERROR(err);
|
3d7663 | 2005-11-03 | Lance Dillon | | }
RETURN_THIS();
}
array(string) get_artists()
//! Returns the strings which are displayed in the artists tab of the
//! secondary credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
pgtk2_pop_n_elems(args);
|
3d7663 | 2005-11-03 | Lance Dillon | | {
const gchar * const *art;
int i=0;
art=gtk_about_dialog_get_artists(GTK_ABOUT_DIALOG(THIS->obj));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | while (art[i]) {
|
74a5dd | 2010-09-19 | Marcus Comstedt | | PGTK_PUSH_GCHAR(art[i++]);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | f_utf8_to_string(1);
}
|
3d7663 | 2005-11-03 | Lance Dillon | | f_aggregate(i);
}
}
void set_artists(array(string) art)
//! Sets the strings which are displayed in the artists tab of the secondary
//! credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
3d7663 | 2005-11-03 | Lance Dillon | | {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | ONERROR err;
|
3d7663 | 2005-11-03 | Lance Dillon | | struct array *a;
int i,j;
const gchar **art;
get_all_args("set_artists",args,"%A",&a);
if (a==NULL)
Pike_error("Invalid array.\n");
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
/* Make sure we have space for the strings on the stack. */
check_stack(a->size+2);
art=xalloc(sizeof(gchar *)*(a->size+1));
SET_ONERROR(err, free, art);
|
3d7663 | 2005-11-03 | Lance Dillon | | for (i=j=0; i<a->size; i++) {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | if (ITEM(a)[i].type == PIKE_T_STRING) {
ref_push_string(ITEM(a)[i].u.string);
f_string_to_utf8(1);
#ifdef PIKE_DEBUG
if ((Pike_sp[-1].type != PIKE_T_STRING) ||
(Pike_sp[-1].u.string->size_shift)) {
Pike_fatal("Unexpected result from string_to_utf8: %s\n",
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | get_name_of_type(Pike_sp[-1].type));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | }
#endif /* PIKE_DEBUG */
art[j++] = Pike_sp[-1].u.string->str;
|
3d7663 | 2005-11-03 | Lance Dillon | | }
}
art[j]=NULL;
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
|
3d7663 | 2005-11-03 | Lance Dillon | | gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(THIS->obj),art);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
pop_n_elems(j);
CALL_AND_UNSET_ONERROR(err);
|
3d7663 | 2005-11-03 | Lance Dillon | | }
RETURN_THIS();
}
array(string) get_documenters()
//! Returns the strings which are displayed in the documenters tab of the
//! secondary credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
pgtk2_pop_n_elems(args);
|
3d7663 | 2005-11-03 | Lance Dillon | | {
const gchar * const *doc;
int i=0;
doc=gtk_about_dialog_get_documenters(GTK_ABOUT_DIALOG(THIS->obj));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | while (doc[i]) {
|
74a5dd | 2010-09-19 | Marcus Comstedt | | PGTK_PUSH_GCHAR(doc[i++]);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | f_utf8_to_string(1);
}
|
3d7663 | 2005-11-03 | Lance Dillon | | f_aggregate(i);
}
}
void set_documenters(array(string) doc)
//! Sets the strings which are displayed in the documenters tab of the
//! secondary credits dialog.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
3d7663 | 2005-11-03 | Lance Dillon | | {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | ONERROR err;
|
3d7663 | 2005-11-03 | Lance Dillon | | struct array *a;
int i,j;
const gchar **doc;
get_all_args("set_documenters",args,"%A",&a);
if (a==NULL)
Pike_error("Invalid array.\n");
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
/* Make sure we have space for the strings on the stack. */
check_stack(a->size+2);
doc=xalloc(sizeof(gchar *)*(a->size+1));
SET_ONERROR(err, free, doc);
|
3d7663 | 2005-11-03 | Lance Dillon | | for (i=j=0; i<a->size; i++) {
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | if (ITEM(a)[i].type == PIKE_T_STRING) {
ref_push_string(ITEM(a)[i].u.string);
f_string_to_utf8(1);
#ifdef PIKE_DEBUG
if ((Pike_sp[-1].type != PIKE_T_STRING) ||
(Pike_sp[-1].u.string->size_shift)) {
Pike_fatal("Unexpected result from string_to_utf8: %s\n",
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | get_name_of_type(Pike_sp[-1].type));
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | | }
#endif /* PIKE_DEBUG */
doc[j++] = Pike_sp[-1].u.string->str;
|
3d7663 | 2005-11-03 | Lance Dillon | | }
}
doc[j]=NULL;
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
|
3d7663 | 2005-11-03 | Lance Dillon | | gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(THIS->obj),doc);
|
c27f8a | 2005-11-12 | Henrik Grubbström (Grubba) | |
pop_n_elems(j);
CALL_AND_UNSET_ONERROR(err);
|
3d7663 | 2005-11-03 | Lance Dillon | | }
RETURN_THIS();
}
|
1a0554 | 2005-07-28 | Martin Nilsson | | string get_translator_credits();
//! Returns the translator credis.
void set_translator_credits(string credits);
//! Sets the translator credits.
|
f28449 | 2006-08-03 | Lance Dillon | | +GDK2.Pixbuf get_logo();
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! Returns the pixbuf displayed as logo.
void set_logo(GDK2.Pixbuf logo);
//! Sets the pixbuf to be displayed as the logo.
string get_logo_icon_name();
//! Returns the icon name.
void set_logo_icon_name(string name);
//! Sets the icon name.
|
3d7663 | 2005-11-03 | Lance Dillon | | mixed get_property(string property)
//! Get property.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
3d7663 | 2005-11-03 | Lance Dillon | | {
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | struct pike_string *prop;
get_all_args("get_property",args,"%n",&prop);
if (is_same_string(prop,_STR("artists")) ||
is_same_string(prop,_STR("authors")) ||
is_same_string(prop,_STR("documenters"))) {
|
3d7663 | 2005-11-03 | Lance Dillon | | gchar **a;
int i=0;
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | g_object_get(G_OBJECT(THIS->obj),prop->str,&a,NULL);
|
3d7663 | 2005-11-03 | Lance Dillon | | while (a[i])
|
74a5dd | 2010-09-19 | Marcus Comstedt | | PGTK_PUSH_GCHAR(a[i]);
|
3d7663 | 2005-11-03 | Lance Dillon | | f_aggregate(i);
g_strfreev(a);
} else {
|
8ae5a4 | 2006-01-07 | Martin Nilsson | | char *s=g_strdup(prop->str);
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_pop_n_elems(args);
pgtk2_get_property(G_OBJECT(THIS->obj),s);
|
3d7663 | 2005-11-03 | Lance Dillon | | g_free(s);
}
}
}
|
1a0554 | 2005-07-28 | Martin Nilsson | | endrequire;
|