pike.git / src / post_modules / GTK2 / source / gtkrecentchooserdialog.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtkrecentchooserdialog.pre:1: + require gtk210; + /* -*- C -*- */ + class GTK2.RecentChooserDialog; + inherit GTK2.Dialog; + inherit GTK2.RecentChooser;    -  + void create(mapping(string:mixed)|string title, GTK2.Window|int|void parent, +  array(mapping(string:int)) buttons, +  GTK2.RecentManager|void manager) + //! Creates a new RecentChooserDialog. Analogous to + //! GTK2.Dialog->create(). + { +  pgtk2_verify_not_inited(); +  pgtk2_verify_setup(); +  if (args) { +  if (Pike_sp[-args].type==PIKE_T_MAPPING) { +  INIT_WITH_PROPS(GTK_TYPE_RECENT_CHOOSER_DIALOG); +  } else { +  struct pike_string *title; +  struct object *o1,*o2=NULL; +  struct array *a; +  GtkWidget *gr; +  int i; +  +  get_all_args("create",args,"%t%O%A.%O",&title,&o1,&a,&o2); +  ref_push_string(title); +  f_string_to_utf8(1); +  if (o2) +  gr=gtk_recent_chooser_dialog_new_for_manager(CGSTR0(Pike_sp[-1].u.string), +  GTK_WINDOW(get_gobject(o1)), +  GTK_RECENT_MANAGER(get_gobject(o2)),NULL) +  else +  gr=gtk_recent_chooser_dialog_new(CGSTR0(Pike_sp[-1].u.string), +  GTK_WINDOW(get_gobject(o1)),NULL); +  pop_stack(); +  THIS->obj=G_OBJECT(gf); +  if (a) { +  for (i=0; i<a->size; i++) { +  struct pike_string *text; +  int response_id; +  struct svalue *sv; +  struct mapping *m; +  +  if (ITEM(a)[i]->type!=PIKE_T_MAPPING) +  continue; +  m=ITEM(a)[i]->u.mapping; +  sv=low_mapping_string_lookup(m,_STR("text")); +  if (sv==NULL) +  continue; +  ref_push_string(CGSTR0(sv->u.string)); +  f_string_to_utf8(1); +  sv=low_mapping_string_lookup(m,_STR("id")); +  response_id=PGTK_GETINT(sv); +  gtk_dialog_add_button(GTK_DIALOG(THIS->obj),CGSTR0(Pike_sp[-1].u.string),response_id); +  pop_stack(); +  } +  } +  } +  pgtk2_pop_n_elems(args); +  } else { +  GtkWidget *gw; +  +  gw=gtk_recent_chooser_dialog_new(NULL,NULL,NULL,NULL); +  THIS->obj=G_OBJECT(gw); +  } +  pgtk2__init_this_object(); + } +  + endrequire;   Newline at end of file added.