916c7e2012-01-28Henrik Grubbström (Grubba) #pike __REAL_VERSION__
e1fb092014-02-14Martin Nilsson #require constant(GTK2.Widget)
916c7e2012-01-28Henrik Grubbström (Grubba)  #define INDEX(x) GTK2[x] //! @decl import GTK2 //! @decl constant Atom object Atom = class { mapping atoms = ([]); class fake_atom { object ra; string n; object get_atom() { if(ra) return ra; return ra = GTK2->Gdk_Atom( n, 0 ); } string get_name() { return get_atom()->get_name(); }
b526982019-04-16Henrik Grubbström (Grubba)  protected void create(string q)
916c7e2012-01-28Henrik Grubbström (Grubba)  { n = q; } }
b526982019-04-16Henrik Grubbström (Grubba)  protected object `[](string what)
916c7e2012-01-28Henrik Grubbström (Grubba)  { if(atoms[what]) return atoms[what]; return atoms[what] = fake_atom( what ); } }();
b526982019-04-16Henrik Grubbström (Grubba) protected mixed `[](string what)
916c7e2012-01-28Henrik Grubbström (Grubba) { if(what == "_module_value") return UNDEFINED; if(what == "Atom") return Atom;
65340d2014-08-15Martin Nilsson  if(has_index(GTK2, "Gdk"+what))
916c7e2012-01-28Henrik Grubbström (Grubba)  return INDEX("Gdk"+what);
65340d2014-08-15Martin Nilsson  if(has_index(GTK2, "GDK_"+what))
916c7e2012-01-28Henrik Grubbström (Grubba)  return INDEX("GDK_"+what);
65340d2014-08-15Martin Nilsson  if(has_index(GTK2, "GDK_"+upper_case(GTK2->unsillycaps(what))))
916c7e2012-01-28Henrik Grubbström (Grubba)  return INDEX("GDK_"+upper_case(GTK2->unsillycaps(what))); return UNDEFINED; // return GDKSupport[what]; }