eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.IconSize; //! Iconsize. string get_name(int size) //! Gets the canonical name of the given icon size. {
cac4202005-12-17Marcus Comstedt  INT_TYPE size;
1a05542005-07-28Martin Nilsson  const gchar *res;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%i",&size);
1a05542005-07-28Martin Nilsson  res=gtk_icon_size_get_name(size);
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  PGTK_PUSH_GCHAR(res); } int from_name(string name) //! Looks up the icon size associated with name. { char *name; int res;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%s",&name);
1a05542005-07-28Martin Nilsson  res=gtk_icon_size_from_name(name);
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  PGTK_PUSH_INT(res); } void register_alias(string alias, int target) //! Registers alias as another name for target. So calling //! GTK2.IconSize->from_name() with alias will return target. { char *alias;
cac4202005-12-17Marcus Comstedt  INT_TYPE target;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%s%i",&alias,&target);
1a05542005-07-28Martin Nilsson  gtk_icon_size_register_alias(alias,target);
3d76632005-11-03Lance Dillon  RETURN_THIS();
1a05542005-07-28Martin Nilsson } int register(string name, int width, int height) //! Registers a new icon size, along the same lines as GTK2.ICON_SIZE_MENU, etc. //! Returns the integer value for the size. { char *name;
cac4202005-12-17Marcus Comstedt  INT_TYPE width,height;
3d76632005-11-03Lance Dillon  int res;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%s%i%i",&name,&width,&height);
3d76632005-11-03Lance Dillon  res=gtk_icon_size_register(name,width,height);
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
3d76632005-11-03Lance Dillon  PGTK_PUSH_INT(res);
1a05542005-07-28Martin Nilsson }