? = ? Makefile ? Makefile.in ? aclocal.m4 ? autom4te-2.53.cache ? config.guess ? config.h ? config.h.in ? config.log ? config.status ? config.sub ? configure ? gsmclient-1.0.pc ? libtool ? ltmain.sh ? stamp-h1 ? gsmclient/Makefile ? gsmclient/Makefile.in ? gsmclient/gsmclient-test ? gsmclient/xsmp-control ? src/Makefile ? src/Makefile.in ? src/core.1276 ? src/core.1281 ? src/inlinepixbufs.h ? src/logout-dialog.glade ? src/msm ? src/test-logout ? src/test-logout.c ? src/test-startup Index: configure.in =================================================================== RCS file: /cvs/gnome/msm/configure.in,v retrieving revision 1.10 diff -u -p -r1.10 configure.in --- configure.in 9 May 2002 20:52:23 -0000 1.10 +++ configure.in 20 Feb 2003 03:06:13 -0000 @@ -66,7 +66,7 @@ if test x$no_x = xyes ; then fi ## here we get the flags we'll actually use -PKG_CHECK_MODULES(MSM, gtk+-2.0 >= 2.0.0) +PKG_CHECK_MODULES(MSM, gtk+-2.0 >= 2.0.0 libglade-2.0 >= 2.0.0) AC_PATH_XTRA Index: src/Makefile.am =================================================================== RCS file: /cvs/gnome/msm/src/Makefile.am,v retrieving revision 1.12 diff -u -p -r1.12 Makefile.am --- src/Makefile.am 22 Feb 2002 01:51:08 -0000 1.12 +++ src/Makefile.am 20 Feb 2003 03:06:13 -0000 @@ -2,7 +2,7 @@ INCLUDES=@MSM_CFLAGS@ -DMSM_PKGDATADIR=\"$(datadir)/msm\" -DMSM_MODULEDIR=\"$(msmstartupdir)\" -DMSM_DATADIR=\"$(datadir)\" noinst_LTLIBRARIES=libgsmprops.la -noinst_PROGRAMS=test-startup +noinst_PROGRAMS=test-startup test-logout bin_PROGRAMS=msm msmstartupdir=$(pkglibdir)/startup-modules @@ -49,6 +49,15 @@ test_startup_SOURCES= \ util.h test_startup_LDADD=@MSM_LIBS@ + +test_logout_SOURCES= \ + test-logout.c \ + msm-multiscreen.c \ + msm-multiscreen.h \ + util.c \ + util.h + +test_logout_LDADD=@MSM_LIBS@ ## default startup module libmsm_startup_default_la_SOURCES=startup-default.c Index: src/logout.c =================================================================== RCS file: /cvs/gnome/msm/src/logout.c,v retrieving revision 1.4 diff -u -p -r1.4 logout.c --- src/logout.c 27 Nov 2001 03:26:24 -0000 1.4 +++ src/logout.c 20 Feb 2003 03:06:13 -0000 @@ -478,6 +478,11 @@ show_shutdown_buttons (void) } void +msm_debug_logout_dialog (void) +{ +} + +void msm_run_logout_dialog (GtkWidget **dialog_location, /* these are inout parameters indicating the default */ MsmLogoutAction *action, @@ -489,8 +494,8 @@ msm_run_logout_dialog (GtkWidget GtkWidget *button; static gboolean stock_icons_registered = FALSE; GMainLoop *loop; - - if (!stock_icons_registered) + + if (!stock_icons_registered) { register_stock_icons (); stock_icons_registered = TRUE; Index: src/logout.h =================================================================== RCS file: /cvs/gnome/msm/src/logout.h,v retrieving revision 1.1 diff -u -p -r1.1 logout.h --- src/logout.h 26 Nov 2001 02:34:05 -0000 1.1 +++ src/logout.h 20 Feb 2003 03:06:13 -0000 @@ -34,9 +34,10 @@ typedef enum MSM_LOGOUT_CANCEL } MsmLogoutAction; -void msm_run_logout_dialog (GtkWidget **dialog_location, - /* these are inout parameters indicating the default */ - MsmLogoutAction *action, - gboolean *save_session); +void msm_debug_logout_dialog (void); +void msm_run_logout_dialog (GtkWidget **dialog_location, + /* these are inout parameters indicating the default */ + MsmLogoutAction *action, + gboolean *save_session); #endif Index: src/main.c =================================================================== RCS file: /cvs/gnome/msm/src/main.c,v retrieving revision 1.7 diff -u -p -r1.7 main.c --- src/main.c 26 Nov 2001 02:34:05 -0000 1.7 +++ src/main.c 20 Feb 2003 03:06:13 -0000 @@ -30,6 +30,7 @@ #include "server.h" #include "util.h" #include "startup.h" +#include "logout.h" static GMainLoop *main_loop = NULL; Index: src/msm-multiscreen.c =================================================================== RCS file: src/msm-multiscreen.c diff -N src/msm-multiscreen.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/msm-multiscreen.c 20 Feb 2003 03:06:13 -0000 @@ -0,0 +1,176 @@ +/* msm-multiscreen.h + * + * Copyright (C) 2003 Jonathan Blandford + * + * Renamed from msm-multiscreen.c Original copyright below + */ +/* msm-multiscreen.c + * + * Copyright (C) 2002 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Mark McLoughlin + * Authors: Jonathan Blandford + */ + +#include + +#include +#include + +#include "msm-multiscreen.h" + +void +msm_screen_foreach (MsmScreenForeachFunc callback) +{ + GdkDisplay *display; + int n_screens, i; + + display = gdk_display_get_default (); + + n_screens = gdk_display_get_n_screens (display); + for (i = 0; i < n_screens; i++) + { + GdkScreen *screen; + int n_monitors, j; + + screen = gdk_display_get_screen (display, i); + + n_monitors = gdk_screen_get_n_monitors (screen); + for (j = 0; j < n_monitors; j++) + callback (screen, j); + } +} + +static gboolean +msm_screen_contains_pointer (GdkScreen *screen, + int *x, + int *y) +{ + GdkWindow *root_window; + Window root, child; + Bool retval; + int rootx, rooty; + int winx, winy; + unsigned int xmask; + + root_window = gdk_screen_get_root_window (screen); + + retval = XQueryPointer (gdk_display, + gdk_x11_drawable_get_xid (GDK_DRAWABLE (root_window)), + &root, &child, &rootx, &rooty, &winx, &winy, &xmask); + + if (x) + *x = retval ? rootx : -1; + if (y) + *y = retval ? rooty : -1; + + return retval; +} + +GdkScreen * +msm_locate_screen_with_pointer (int *monitor_ret) +{ + GdkDisplay *display; + int n_screens, i; + + display = gdk_display_get_default (); + + n_screens = gdk_display_get_n_screens (display); + for (i = 0; i < n_screens; i++) + { + GdkScreen *screen; + int x, y; + + screen = gdk_display_get_screen (display, i); + + if (msm_screen_contains_pointer (screen, &x, &y)) + { + if (monitor_ret) + *monitor_ret = gdk_screen_get_monitor_at_point (screen, x, y); + + return screen; + } + } + + if (monitor_ret) + *monitor_ret = 0; + + return NULL; +} + +int +msm_screen_get_width (GdkScreen *screen, + int monitor) +{ + GdkRectangle geometry; + + gdk_screen_get_monitor_geometry (screen, monitor, &geometry); + + return geometry.width; +} + +int +msm_screen_get_height (GdkScreen *screen, + int monitor) +{ + GdkRectangle geometry; + + gdk_screen_get_monitor_geometry (screen, monitor, &geometry); + + return geometry.height; +} + +int +msm_screen_get_x (GdkScreen *screen, + int monitor) +{ + GdkRectangle geometry; + + gdk_screen_get_monitor_geometry (screen, monitor, &geometry); + + return geometry.x; +} + +int +msm_screen_get_y (GdkScreen *screen, + int monitor) +{ + GdkRectangle geometry; + + gdk_screen_get_monitor_geometry (screen, monitor, &geometry); + + return geometry.y; +} + +void +msm_center_window_on_screen (GtkWindow *window, + GdkScreen *screen, + int monitor) +{ + GtkRequisition requisition; + GdkRectangle geometry; + int x, y; + + gdk_screen_get_monitor_geometry (screen, monitor, &geometry); + gtk_widget_size_request (GTK_WIDGET (window), &requisition); + + x = geometry.x + (geometry.width - requisition.width) / 2; + y = geometry.y + (geometry.height - requisition.height) / 2; + + gtk_window_move (window, x, y); +} Index: src/msm-multiscreen.h =================================================================== RCS file: src/msm-multiscreen.h diff -N src/msm-multiscreen.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/msm-multiscreen.h 20 Feb 2003 03:06:13 -0000 @@ -0,0 +1,57 @@ +/* msm-multiscreen.h + * + * Copyright (C) 2003 Jonathan Blandford + * + * Renamed from gsm-multiscreen.h Original copyright below + */ +/* + * Copyright (C) 2002 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Mark McLoughlin + * Authors: Jonathan Blandford + */ + +#ifndef __MSM_MULTISCREEN_H__ +#define __MSM_MULTISCREEN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +typedef void (*MsmScreenForeachFunc) (GdkScreen *screen, + int monitor); + +void msm_screen_foreach (MsmScreenForeachFunc callback); +GdkScreen *msm_screen_locate_with_pointer (int *monitor_ret); +int msm_screen_get_width (GdkScreen *screen, + int monitor); +int msm_screen_get_height (GdkScreen *screen, + int monitor); +int msm_screen_get_x (GdkScreen *screen, + int monitor); +int msm_screen_get_y (GdkScreen *screen, + int monitor); +void msm_screen_center_window (GtkWindow *window, + GdkScreen *screen, + int monitor); + +G_END_DECLS + +#endif /* __MSM_MULTISCREEN_H__ */