*** empty log message ***
authorroot <root>
Thu, 14 Dec 2006 17:22:04 +0000 (17:22 +0000)
committerroot <root>
Thu, 14 Dec 2006 17:22:04 +0000 (17:22 +0000)
src/iom_perl.xs
src/rxvtperl.xs
src/urxvt.pm

index 7522007ffc7c0382c4e581ba1d826571839ae7ff..34ddad7177f96bf09e7752b2bcf76bcbd889f746 100644 (file)
@@ -1,3 +1,35 @@
+#############################################################################
+# IOM_CLASS constants
+#############################################################################
+
+BOOT:
+{
+  HV *stash     = gv_stashpv ("IOM_CLASS", 1);
+  SV *baseclass = newSVpv ("IOM_CLASS::watcher", 0);
+
+  static const struct {
+    const char *name;
+    IV iv;
+  } *civ, const_iv[] = {
+#   define const_iv(name) { # name, (IV)name }
+    const_iv (EVENT_NONE),
+    const_iv (EVENT_READ),
+    const_iv (EVENT_WRITE),
+  };
+
+  for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
+    newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
+
+  /* slightly dirty to put the same scalar into all those arrays, but */
+  /* we do not expect users to modify them anyways */
+  av_push (get_av ("IOM_CLASS" "::timer::ISA", 1), SvREFCNT_inc (baseclass));
+  av_push (get_av ("IOM_CLASS"   "::iow::ISA", 1), SvREFCNT_inc (baseclass));
+  av_push (get_av ("IOM_CLASS"    "::pw::ISA", 1), SvREFCNT_inc (baseclass));
+  av_push (get_av ("IOM_CLASS"    "::iw::ISA", 1), SvREFCNT_inc (baseclass));
+
+  SvREFCNT_dec (baseclass);
+}
+
 #############################################################################
 # IOM_CLASS::watcher
 #############################################################################
index 0595ed54f46cb9941cf3898c9d648689b2af57ac..b8d330778d90d48539152f1260b2fafa2ec6eb95 100644 (file)
@@ -677,10 +677,6 @@ BOOT:
     const_iv (GrabModeSync),
     const_iv (GrabModeAsync),
 
-    const_iv (EVENT_NONE),
-    const_iv (EVENT_READ),
-    const_iv (EVENT_WRITE),
-
     const_iv (NoEventMask),
     const_iv (KeyPressMask),
     const_iv (KeyReleaseMask),
index 1aea52e8a91eca486fc92b316c770978dc4fd737..ace36aadec93426a3df6b8b1db27d7d30a23c913 100644 (file)
@@ -1956,11 +1956,6 @@ sub DESTROY {
 
 package urxvt::watcher;
 
-@urxvt::timer::ISA = __PACKAGE__;
-@urxvt::iow::ISA   = __PACKAGE__;
-@urxvt::pw::ISA    = __PACKAGE__;
-@urxvt::iw::ISA    = __PACKAGE__;
-
 =head2 The C<urxvt::timer> Class
 
 This class implements timer watchers/events. Time is represented as a