a580e12000-09-27Fredrik Hübinette (Hubbe) #pike __REAL_VERSION__
a20af62000-09-26Fredrik Hübinette (Hubbe) 
379c0b2001-06-10Henrik Grubbström (Grubba) #if constant(GTK)
7f663a2000-03-10Per Hedbor #define INDEX(x) GTK[x]
3c8bb61999-11-07Per Hedbor 
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) { if(what == "_module_value") return ([])[0]; 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)));
bdf3c11999-12-08Per Hedbor  return ([])[0]; // return GDKSupport[what];
3c8bb61999-11-07Per Hedbor }
379c0b2001-06-10Henrik Grubbström (Grubba)  #else /* !constant(GTK) */ static void create() { /* Destroy ourselves. */ destruct(); } #endif /* constant(GTK) */