From: Hib Eris Date: Thu, 5 Feb 2009 09:08:31 +0000 (+0000) Subject: Make screensaver code compile for w32. These changes have been copied from X-Git-Tag: EVINCE_2_25_91~64 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=ee88daeea5519ca669244684877effbcea42fb56;p=evince.git Make screensaver code compile for w32. These changes have been copied from 2009-02-05 Hib Eris * cut-n-paste/totem-screensaver/totem-scrsaver.c: Make screensaver code compile for w32. These changes have been copied from upstream totem. See bug #339172. svn path=/trunk/; revision=3415 --- diff --git a/ChangeLog b/ChangeLog index 35bd25de..c6c21320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-05 Hib Eris + + * cut-n-paste/totem-screensaver/totem-scrsaver.c: + + Make screensaver code compile for w32. These changes have been + copied from upstream totem. See bug #339172. + 2009-02-05 Carlos Garcia Campos * configure.ac: diff --git a/cut-n-paste/totem-screensaver/totem-scrsaver.c b/cut-n-paste/totem-screensaver/totem-scrsaver.c index c7011cf1..0339171c 100644 --- a/cut-n-paste/totem-screensaver/totem-scrsaver.c +++ b/cut-n-paste/totem-screensaver/totem-scrsaver.c @@ -24,14 +24,20 @@ #include "config.h" #include + +#include + +#ifdef GDK_WINDOWING_X11 #include +#include #ifdef HAVE_XTEST #include #endif /* HAVE_XTEST */ -#include +#endif /* GDK_WINDOWING_X11 */ #ifdef ENABLE_DBUS +#include #include #define GS_SERVICE "org.gnome.ScreenSaver" @@ -68,7 +74,7 @@ struct TotemScrsaverPrivate { /* For use with XTest */ int keycode1, keycode2; int *keycode; - Bool have_xtest; + gboolean have_xtest; }; G_DEFINE_TYPE(TotemScrsaver, totem_scrsaver, G_TYPE_OBJECT) @@ -234,12 +240,13 @@ screensaver_finalize_dbus (TotemScrsaver *scr) #endif /* ENABLE_DBUS */ } +#ifdef GDK_WINDOWING_X11 static void screensaver_enable_x11 (TotemScrsaver *scr) { #ifdef HAVE_XTEST - if (scr->priv->have_xtest == True) + if (scr->priv->have_xtest != FALSE) { g_source_remove_by_user_data (scr); return; @@ -283,7 +290,7 @@ screensaver_disable_x11 (TotemScrsaver *scr) { #ifdef HAVE_XTEST - if (scr->priv->have_xtest == True) + if (scr->priv->have_xtest != FALSE) { XLockDisplay (GDK_DISPLAY()); XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout, @@ -322,8 +329,8 @@ screensaver_init_x11 (TotemScrsaver *scr) int a, b, c, d; XLockDisplay (GDK_DISPLAY()); - scr->priv->have_xtest = XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d); - if(scr->priv->have_xtest == True) + scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d) == True); + if (scr->priv->have_xtest != FALSE) { scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L); if (scr->priv->keycode1 == 0) { @@ -347,6 +354,7 @@ screensaver_finalize_x11 (TotemScrsaver *scr) { g_source_remove_by_user_data (scr); } +#endif static void totem_scrsaver_class_init (TotemScrsaverClass *klass) @@ -366,7 +374,11 @@ totem_scrsaver_new (DBusGConnection *connection) scr = TOTEM_SCRSAVER (g_object_new (TOTEM_TYPE_SCRSAVER, NULL)); screensaver_init_dbus (scr, connection); +#ifdef GDK_WINDOWING_X11 screensaver_init_x11 (scr); +#else +#warning Unimplemented +#endif return scr; } @@ -377,7 +389,11 @@ totem_scrsaver_new() TotemScrsaver * scr; scr = TOTEM_SCRSAVER (g_object_new (TOTEM_TYPE_SCRSAVER, NULL)); +#ifdef GDK_WINDOWING_X11 screensaver_init_x11 (scr); +#else +#warning Unimplemented +#endif return scr; } @@ -387,11 +403,15 @@ static void totem_scrsaver_init (TotemScrsaver *scr) { scr->priv = g_new0 (TotemScrsaverPrivate, 1); + + } void totem_scrsaver_disable (TotemScrsaver *scr) { + g_return_if_fail (TOTEM_SCRSAVER (scr)); + if (scr->priv->disabled != FALSE) return; @@ -400,12 +420,19 @@ totem_scrsaver_disable (TotemScrsaver *scr) if (screensaver_is_running_dbus (scr) != FALSE) screensaver_disable_dbus (scr); else +#ifdef GDK_WINDOWING_X11 screensaver_disable_x11 (scr); +#else +#warning Unimplemented + {} +#endif } void totem_scrsaver_enable (TotemScrsaver *scr) { + g_return_if_fail (TOTEM_SCRSAVER (scr)); + if (scr->priv->disabled == FALSE) return; @@ -414,7 +441,12 @@ totem_scrsaver_enable (TotemScrsaver *scr) if (screensaver_is_running_dbus (scr) != FALSE) screensaver_enable_dbus (scr); else +#ifdef GDK_WINDOWING_X11 screensaver_enable_x11 (scr); +#else +#warning Unimplemented + {} +#endif } static void @@ -423,7 +455,12 @@ totem_scrsaver_finalize (GObject *object) TotemScrsaver *scr = TOTEM_SCRSAVER (object); screensaver_finalize_dbus (scr); +#ifdef GDK_WINDOWING_X11 screensaver_finalize_x11 (scr); +#else +#warning Unimplemented + {} +#endif g_free (scr->priv);