a580e12000-09-27Fredrik Hübinette (Hubbe) #pike __REAL_VERSION__
e1fb092014-02-14Martin Nilsson #require constant(GTK.Widget)
379c0b2001-06-10Henrik Grubbström (Grubba) 
7f663a2000-03-10Per Hedbor #define INDEX(x) GTK[x]
3c8bb61999-11-07Per Hedbor 
916c7e2012-01-28Henrik Grubbström (Grubba) //! GDK wrapper module. //! //! This is a convenience module that is identical to either //! either the @[GDK2] or the @[GDK1] module depending on //! which (if any) of them is available. //! //! @seealso //! @[GDK1], @[GDK2]
cbe40e2003-11-11Henrik Grubbström (Grubba) //! @decl import GTK
f3c20a2003-11-11Henrik Grubbström (Grubba) //! @decl constant Atom
7f663a2000-03-10Per Hedbor object Atom = class
3c8bb61999-11-07Per Hedbor { mapping atoms = ([]); class fake_atom { object ra; string n; object get_atom() { if(ra) return ra;
7f663a2000-03-10Per Hedbor  return ra = GTK->Gdk_Atom( n, 0 );
3c8bb61999-11-07Per Hedbor  } string get_name() { return get_atom()->get_name(); } void create(string q) { n = q; } } object `[](string what) { if(atoms[what]) return atoms[what]; return atoms[what] = fake_atom( what ); } }(); mixed `[](string what) {
f2d7a62002-02-14Martin Nilsson  if(what == "_module_value") return UNDEFINED;
3c8bb61999-11-07Per Hedbor  if(what == "Atom") return Atom; if(!zero_type(INDEX("Gdk"+what))) return INDEX("Gdk"+what); if(!zero_type(INDEX("GDK_"+what))) return INDEX("GDK_"+what);
7f663a2000-03-10Per Hedbor  if(!zero_type(INDEX("GDK_"+upper_case(GTK->unsillycaps(what))))) return INDEX("GDK_"+upper_case(GTK->unsillycaps(what)));
f2d7a62002-02-14Martin Nilsson  return UNDEFINED;
bdf3c11999-12-08Per Hedbor // return GDKSupport[what];
3c8bb61999-11-07Per Hedbor }