From http://www.jwz.org/xscreensaver/xscreensaver-5.16.tar.gz
[xscreensaver] / OSX / jwxyz-timers.m
index 0ad4630fb6a9eeb12d3409b829b3002f9c4a8d8b..6e478f61725b1104be9f66f54bf7761e8d3f0b8f 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2006-2012 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
 /* This is the OSX implementation of Xt timers, for libjwxyz.
  */
 
-#import <stdlib.h>
-#import <Cocoa/Cocoa.h>
-#import "jwxyz.h"
-#import "jwxyz-timers.h"
-
 //#define DEBUG_TIMERS
 //#define DEBUG_SOURCES
 
 #undef USE_COCOA_SOURCES
 
 
+#import <stdlib.h>
+
+#ifdef USE_COCOA_SOURCES
+# import <Cocoa/Cocoa.h>
+#endif
+
+#import "jwxyz.h"
+#import "jwxyz-timers.h"
+
+
+
 #ifdef DEBUG_TIMERS
 # define LOGT(str,arg1,arg2) NSLog(str,arg1,arg2)
 #else
@@ -381,3 +387,17 @@ jwxyz_XtRemoveInput_all (Display *dpy)
 
 # endif /* !USE_COCOA_SOURCES */
 }
+
+
+XtInputMask
+XtAppPending (XtAppContext app)
+{
+  return XtIMAlternateInput;  /* just always say yes */
+}
+
+void
+XtAppProcessEvent (XtAppContext app, XtInputMask mask)
+{
+  jwxyz_sources_data *td = display_sources_data (app_to_display (app));
+  jwxyz_sources_run (td);
+}