├── src ├── xfcekbd-indicator-marshal.list ├── gs-marshal.list ├── xfce4-screensaver.desktop.in.in ├── setuid.h ├── gs-visual-gl.h ├── xfce4-screensaver.h ├── xfce-rr-private.h ├── subprocs.h ├── debug-screensaver.sh ├── xfce-desktop-utils.h ├── copy-theme-dialog.h ├── gs-monitor.h ├── gs-auth.h ├── xfce4-screensaver-gl-helper.c ├── xfcekbd-indicator.h ├── gs-job.h ├── gs-watcher.h ├── gs-debug.h ├── xfce-desktop-utils.c ├── xfcekbd-keyboard-config.h ├── gs-theme-manager.h ├── gs-fade.h ├── gs-auth-bsdauth.c ├── xfcekbd-indicator-config.h ├── test-watcher.c ├── gs-grab.h ├── gs-lock-plug.h ├── xfcekbd-desktop-config.h ├── test-fade.c ├── gs-listener-dbus.h ├── gs-visual-gl.c ├── xfce4-screensaver.c ├── xfcekbd-config-private.h ├── xfce-bg.h ├── gs-debug.c ├── subprocs.c ├── xfce-rr.h ├── gs-window.h ├── test-window.c ├── gs-manager.h ├── gs-auth-helper.c ├── test-passwd.c ├── gs-auth-pwent.c └── gs-prefs.h ├── savers ├── gs-theme-engine-marshal.list ├── popsquares.desktop.in.in ├── personal-slideshow.desktop.in.in ├── xfce-floaters.desktop.in.in ├── xdg-user-dir-lookup.h ├── gste-popsquares.h ├── popsquares.c ├── gs-theme-window.h ├── gste-slideshow.h ├── Makefile.am ├── gs-theme-engine.h ├── slideshow.c ├── xdg-user-dir-lookup.c ├── gs-theme-engine.c └── gs-theme-window.c ├── po ├── LINGUAS ├── POTFILES.skip └── POTFILES.in ├── data ├── xfce4-screensaver ├── org.xfce.ScreenSaver.service.in ├── xfce4-screensaver.directory.in ├── images │ ├── Makefile.am │ └── xfce-logo-white.svg ├── xfce4-screensaver.pc.in ├── xfce4-screensaver-preferences.desktop.in ├── xfce4-screensavers.menu.in ├── migrate-xscreensaver-config.sh ├── xscreensaver-config.xsl ├── xfce4-screensaver-preferences.1 ├── xfce4-screensaver-command.1 ├── xfce4-screensaver.1 └── Makefile.am ├── TODO ├── AUTHORS ├── doc ├── config.xsl ├── docbook.css ├── Makefile.am └── xfce4-screensaver.xml.in ├── .github └── issue_template.md ├── .gitignore ├── Makefile.am ├── autogen.sh ├── README.md └── NEWS /src/xfcekbd-indicator-marshal.list: -------------------------------------------------------------------------------- 1 | VOID:VOID 2 | -------------------------------------------------------------------------------- /savers/gs-theme-engine-marshal.list: -------------------------------------------------------------------------------- 1 | BOOLEAN:BOXED 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # please keep this list sorted alphabetically 2 | # 3 | -------------------------------------------------------------------------------- /data/xfce4-screensaver: -------------------------------------------------------------------------------- 1 | @include common-auth 2 | auth optional pam_gnome_keyring.so -------------------------------------------------------------------------------- /src/gs-marshal.list: -------------------------------------------------------------------------------- 1 | BOOLEAN:VOID 2 | BOOLEAN:INT 3 | BOOLEAN:BOOLEAN 4 | VOID:STRING,STRING,STRING 5 | -------------------------------------------------------------------------------- /data/org.xfce.ScreenSaver.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.xfce.ScreenSaver 3 | Exec=@EXPANDED_BINDIR@/xfce4-screensaver --no-daemon 4 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | savers/xfce-floaters.desktop.in 2 | savers/personal-slideshow.desktop.in 3 | savers/popsquares.desktop.in 4 | src/xfce4-screensaver.desktop.in 5 | -------------------------------------------------------------------------------- /data/xfce4-screensaver.directory.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | _Name=Screensavers 4 | _Comment=Screensaver themes 5 | Icon=screensaver 6 | Type=Directory 7 | OnlyShowIn=XFCE; 8 | NoDisplay=false 9 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | - Compile .ui files to .h 2 | - Make sure gnome-, mate-, and xfce4-screensaver are co-installable 3 | - Consider replacement for Cosmos screensaver 4 | - Improve build defaults so the screensaver is functional without configure arguments -------------------------------------------------------------------------------- /data/images/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | SUBDIRS = \ 4 | $(NULL) 5 | 6 | imagedir = $(datadir)/pixmaps 7 | image_DATA = \ 8 | xfce-logo-white.svg \ 9 | $(NULL) 10 | 11 | EXTRA_DIST = \ 12 | $(image_DATA) \ 13 | $(NULL) 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Xfce: 2 | Sean Davis 3 | Simon Steinbeiss 4 | 5 | MATE: 6 | Perberos 7 | Steve Zesch 8 | Stefano Karapetsas 9 | 10 | GNOME: 11 | William Jon McCann 12 | -------------------------------------------------------------------------------- /doc/config.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/docbook.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: luxi sans,sans-serif; 3 | } 4 | 5 | table { 6 | border: solid 1pt; 7 | border-collapse: collapse; 8 | } 9 | 10 | th { 11 | background: #eeeeee; 12 | padding: 5px; 13 | } 14 | 15 | td { 16 | border: solid 1pt; 17 | padding: 5px; 18 | } 19 | -------------------------------------------------------------------------------- /savers/popsquares.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | _Name=Pop art squares 3 | _Comment=A pop-art-ish grid of pulsing colors. 4 | Exec=@SAVERDIR@/popsquares 5 | TryExec=@SAVERDIR@/popsquares 6 | StartupNotify=false 7 | Terminal=false 8 | Type=Application 9 | Categories=Screensaver; 10 | OnlyShowIn=XFCE; 11 | -------------------------------------------------------------------------------- /savers/personal-slideshow.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | _Name=Pictures folder 3 | _Comment=Display a slideshow from your Pictures folder 4 | Exec=@SAVERDIR@/slideshow 5 | TryExec=@SAVERDIR@/slideshow 6 | StartupNotify=false 7 | Terminal=false 8 | Type=Application 9 | Categories=Screensaver; 10 | OnlyShowIn=XFCE; 11 | -------------------------------------------------------------------------------- /savers/xfce-floaters.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | _Name=Floating Xfce 3 | _Comment=Bubbles the Xfce logo around the screen 4 | Exec=@SAVERDIR@/floaters @FLOATERS_XFCE_IMAGE@ 5 | TryExec=@SAVERDIR@/floaters 6 | StartupNotify=false 7 | Terminal=false 8 | Type=Application 9 | Categories=Screensaver; 10 | OnlyShowIn=XFCE; 11 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | #### Expected behaviour 2 | 3 | 4 | #### Actual behaviour 5 | 6 | 7 | #### Steps to reproduce the behaviour 8 | 9 | 10 | #### XFCE general version 11 | 12 | 13 | #### Package version 14 | 15 | 16 | #### Linux Distribution 17 | 18 | 19 | #### Link to downstream report of your Distribution 20 | -------------------------------------------------------------------------------- /data/xfce4-screensaver.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | libexecdir=@libexecdir@ 5 | includedir=@includedir@ 6 | datarootdir=@datarootdir@ 7 | datadir=@datadir@ 8 | 9 | privlibexecdir=@privlibexecdir@ 10 | privdatadir=@privdatadir@ 11 | themesdir=@themesdir@ 12 | 13 | Name: xfce4-screensaver 14 | Description: Xfce Screensaver 15 | Version: @VERSION@ 16 | Requires: 17 | Libs: 18 | Cflags: 19 | -------------------------------------------------------------------------------- /data/xfce4-screensaver-preferences.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | _Name=Screensaver 3 | _Comment=Set your screensaver preferences 4 | Icon=preferences-desktop-screensaver 5 | Exec=xfce4-screensaver-preferences 6 | Terminal=false 7 | Type=Application 8 | Categories=GTK;Settings;DesktopSettings; 9 | OnlyShowIn=XFCE; 10 | StartupNotify=true 11 | X-XFCE-Bugzilla-Bugzilla=XFCE 12 | X-XFCE-Bugzilla-Product=xfce4-screensaver 13 | X-XFCE-Bugzilla-Component=general 14 | -------------------------------------------------------------------------------- /src/xfce4-screensaver.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | _Name=Screensaver 4 | _Comment=Launch screensaver and locker program 5 | Icon=preferences-desktop-screensaver 6 | Exec=xfce4-screensaver 7 | OnlyShowIn=XFCE; 8 | NoDisplay=true 9 | X-XFCE-Autostart-Phase=Application 10 | X-XFCE-Autostart-Notify=true 11 | X-XFCE-Bugzilla-Bugzilla=XFCE 12 | X-XFCE-Bugzilla-Product=xfce4-screensaver 13 | X-XFCE-Bugzilla-Component=general 14 | X-XFCE-Bugzilla-Version=@VERSION@ 15 | -------------------------------------------------------------------------------- /data/xfce4-screensavers.menu.in: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Screensavers 7 | xfce4-screensaver.directory 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Screensaver 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | SPEC_XML_FILES = \ 4 | xfce4-screensaver.xml \ 5 | dbus-interface.xml \ 6 | $(NULL) 7 | 8 | if DOCBOOK_DOCS_ENABLED 9 | 10 | htmldocdir = $(DOCDIR) 11 | htmldoc_DATA = xfce4-screensaver.html 12 | 13 | xfce4-screensaver.html : dbus-interface.xml 14 | $(XMLTO) html-nochunks -m config.xsl xfce4-screensaver.xml 15 | 16 | endif # DOCBOOK_DOCS_ENABLED 17 | 18 | EXTRA_DIST = \ 19 | xfce4-screensaver.xml.in \ 20 | config.xsl \ 21 | docbook.css \ 22 | $(SPEC_XML_FILES) 23 | $(NULL) 24 | 25 | clean-local: 26 | rm -f *~ 27 | rm -f xfce4-screensaver.html 28 | -------------------------------------------------------------------------------- /data/migrate-xscreensaver-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIST_BIN=`dirname "$0"` 4 | 5 | CMD=xsltproc 6 | XSL=${DIST_BIN}/xscreensaver-config.xsl 7 | 8 | if test "x$1" = "x" -o "x$1" = "x-h" -o "x$1" = "x--help"; then 9 | echo "usage: $0 [file] ..." 10 | exit 1 11 | fi 12 | 13 | if [ ! -r ${XSL} ]; then 14 | echo "Cannot find XSLT file" 15 | exit 1 16 | fi 17 | 18 | FILES="$@" 19 | for FILE in $FILES; do 20 | echo "${FILE}" | grep ".xml$" > /dev/null 21 | if [ $? -ne 0 ]; then 22 | echo "Skipping non-xml file: ${FILE}" 23 | continue 24 | fi 25 | 26 | d=`dirname ${FILE}` 27 | b=`basename ${FILE} .xml` 28 | 29 | outfile="${b}.desktop" 30 | echo "Creating: ${outfile}" 31 | ${CMD} -o ${outfile} ${XSL} ${FILE} 32 | done 33 | 34 | exit 0 35 | -------------------------------------------------------------------------------- /doc/xfce4-screensaver.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Xfce Screensaver @VERSION@ Documentation 7 | Version @VERSION@ 8 | 6 June, 2006 9 | 10 | 11 | William Jon 12 | McCann 13 | 14 |
15 | mccann@jhu.edu 16 |
17 |
18 |
19 |
20 |
21 | 22 | 23 |
24 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # Please keep this file sorted alphabetically. 3 | [type: gettext/glade]data/lock-dialog-default.ui 4 | data/xfce4-screensaver-preferences.desktop.in 5 | [type: gettext/glade]data/xfce4-screensaver-preferences.ui 6 | data/xfce4-screensaver.directory.in 7 | savers/floaters.c 8 | savers/xfce-floaters.desktop.in.in 9 | savers/personal-slideshow.desktop.in.in 10 | savers/popsquares.c 11 | savers/popsquares.desktop.in.in 12 | savers/slideshow.c 13 | src/copy-theme-dialog.c 14 | src/gs-auth-pam.c 15 | src/gs-listener-dbus.c 16 | src/gs-lock-plug.c 17 | src/xfce-rr.c 18 | src/xfce4-screensaver-command.c 19 | src/xfce4-screensaver-dialog.c 20 | src/xfce4-screensaver-preferences.c 21 | src/xfce4-screensaver.c 22 | src/xfce4-screensaver.desktop.in.in 23 | src/xfcekbd-indicator.c 24 | -------------------------------------------------------------------------------- /src/setuid.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * xscreensaver, Copyright (c) 1993-2004 Jamie Zawinski 4 | * 5 | * Permission to use, copy, modify, distribute, and sell this software and its 6 | * documentation for any purpose is hereby granted without fee, provided that 7 | * the above copyright notice appear in all copies and that both that 8 | * copyright notice and this permission notice appear in supporting 9 | * documentation. No representations are made about the suitability of this 10 | * software for any purpose. It is provided "as is" without express or 11 | * implied warranty. 12 | */ 13 | 14 | #ifndef __GS_SETUID_H 15 | #define __GS_SETUID_H 16 | 17 | #include 18 | 19 | G_BEGIN_DECLS 20 | 21 | gboolean hack_uid (char **nolock_reason, 22 | char **orig_uid, 23 | char **uid_message); 24 | 25 | G_END_DECLS 26 | 27 | #endif /* __GS_SETUID_H */ 28 | -------------------------------------------------------------------------------- /data/xscreensaver-config.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | [Desktop Entry] 9 | Encoding=UTF-8 10 | Name= 11 | Comment= 12 | 13 | TryExec= 14 | Exec= 15 | 16 | 17 | TryExec= 18 | Exec= 19 | 20 | StartupNotify=false 21 | Terminal=false 22 | Type=Application 23 | Categories=Screensaver; 24 | OnlyShowIn=XFCE; 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Directories 2 | .deps/ 3 | .libs/ 4 | .vscode/ 5 | autom4te.cache/ 6 | cov-int/ 7 | m4/ 8 | xfce4-screensaver-*/ 9 | 10 | # Wildcard Match 11 | *.a 12 | *.bak 13 | *.desktop 14 | *.gmo 15 | *.html 16 | *.m4 17 | *.o 18 | *.pot 19 | *.tgz 20 | *.xz 21 | *intltool* 22 | *marshal.c 23 | *marshal.h 24 | *~ 25 | config.* 26 | stamp-* 27 | 28 | # File Match 29 | ChangeLog 30 | compile 31 | configure 32 | depcomp 33 | INSTALL 34 | install-sh 35 | libtool 36 | ltmain.sh 37 | Makefile 38 | Makefile.in 39 | missing 40 | NONE 41 | POTFILES 42 | 43 | # Paths 44 | data/org.xfce.ScreenSaver.service 45 | data/xfce4-screensaver.directory 46 | data/xfce4-screensaver.pc 47 | data/xfce4-screensavers.menu 48 | doc/xfce4-screensaver.xml 49 | po/Makefile.in.in 50 | savers/*.desktop.in 51 | savers/floaters 52 | savers/popsquares 53 | savers/slideshow 54 | src/test-fade 55 | src/test-passwd 56 | src/test-watcher 57 | src/test-window 58 | src/xfce4-screensaver 59 | src/xfce4-screensaver-command 60 | src/xfce4-screensaver-dialog 61 | src/xfce4-screensaver-gl-helper 62 | src/xfce4-screensaver-preferences 63 | src/xfce4-screensaver.desktop.in 64 | -------------------------------------------------------------------------------- /src/gs-visual-gl.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __GS_VISUAL_GL_H 22 | #define __GS_VISUAL_GL_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | GdkVisual *gs_visual_gl_get_best_for_display (GdkDisplay *display); 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __GS_VISUAL_GL_H */ 33 | -------------------------------------------------------------------------------- /src/xfce4-screensaver.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __XFCE_SCREENSAVER_H 24 | #define __XFCE_SCREENSAVER_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | void xfce4_screensaver_quit(void); 31 | 32 | G_END_DECLS 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/xfce-rr-private.h: -------------------------------------------------------------------------------- 1 | #ifndef XFCE_RR_PRIVATE_H 2 | #define XFCE_RR_PRIVATE_H 3 | 4 | #include 5 | 6 | #ifdef HAVE_RANDR 7 | #include 8 | #endif 9 | 10 | typedef struct ScreenInfo ScreenInfo; 11 | 12 | struct ScreenInfo 13 | { 14 | #ifdef HAVE_RANDR 15 | XRRScreenResources *resources; 16 | RROutput primary; 17 | #endif 18 | 19 | XfceRROutput **outputs; 20 | XfceRRCrtc **crtcs; 21 | XfceRRMode **modes; 22 | XfceRRMode **clone_modes; 23 | XfceRRScreen *screen; 24 | int min_width; 25 | int max_width; 26 | int min_height; 27 | int max_height; 28 | }; 29 | 30 | struct XfceRRScreenPrivate 31 | { 32 | GdkScreen *gdk_screen; 33 | GdkWindow *gdk_root; 34 | Display *xdisplay; 35 | Screen *xscreen; 36 | ScreenInfo *info; 37 | Window xroot; 38 | 39 | int randr_event_base; 40 | int rr_major_version; 41 | int rr_minor_version; 42 | 43 | Atom connector_type_atom; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/subprocs.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * subprocs.c --- choosing, spawning, and killing screenhacks. 4 | * 5 | * xscreensaver, Copyright (c) 1991-2003 Jamie Zawinski 6 | * 7 | * Permission to use, copy, modify, distribute, and sell this software and its 8 | * documentation for any purpose is hereby granted without fee, provided that 9 | * the above copyright notice appear in all copies and that both that 10 | * copyright notice and this permission notice appear in supporting 11 | * documentation. No representations are made about the suitability of this 12 | * software for any purpose. It is provided "as is" without express or 13 | * implied warranty. 14 | */ 15 | 16 | #ifndef __GS_SUBPROCS_H 17 | #define __GS_SUBPROCS_H 18 | 19 | #include 20 | #include 21 | 22 | G_BEGIN_DECLS 23 | 24 | void unblock_sigchld (void); 25 | 26 | #ifdef HAVE_SIGACTION 27 | sigset_t 28 | #else /* !HAVE_SIGACTION */ 29 | int 30 | #endif /* !HAVE_SIGACTION */ 31 | block_sigchld (void); 32 | 33 | int signal_pid (int pid, 34 | int signal); 35 | void await_dying_children (int pid, 36 | gboolean debug); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* __GS_SUBPROCS_H */ 41 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # This file will be processed with automake-1.7 to create Makefile.in 2 | 3 | AUTOMAKE_OPTIONS = 1.7 4 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} 5 | 6 | NULL = 7 | 8 | DISTCHECK_CONFIGURE_FLAGS = \ 9 | --without-systemd 10 | 11 | SUBDIRS = \ 12 | src \ 13 | savers \ 14 | po \ 15 | data \ 16 | doc \ 17 | $(NULL) 18 | 19 | EXTRA_DIST = \ 20 | autogen.sh \ 21 | COPYING \ 22 | COPYING.LIB \ 23 | COPYING.LGPL \ 24 | AUTHORS \ 25 | INSTALL \ 26 | README.md \ 27 | ChangeLog \ 28 | NEWS \ 29 | intltool-extract.in \ 30 | intltool-merge.in \ 31 | intltool-update.in \ 32 | $(NULL) 33 | 34 | DISTCLEANFILES = \ 35 | intltool-extract \ 36 | intltool-merge \ 37 | intltool-update \ 38 | ./po/.intltool-merge-cache \ 39 | $(NULL) 40 | 41 | MAINTAINERCLEANFILES = \ 42 | *~ \ 43 | intltool-*.in \ 44 | compile \ 45 | configure \ 46 | INSTALL \ 47 | COPYING \ 48 | install-sh \ 49 | missing \ 50 | mkinstalldirs \ 51 | config.guess \ 52 | ltmain.sh \ 53 | config.sub \ 54 | depcomp \ 55 | Makefile.in \ 56 | config.h.* \ 57 | aclocal.m4 \ 58 | acinclude.m4 \ 59 | $(NULL) 60 | 61 | # Build ChangeLog from GIT history 62 | ChangeLog: 63 | $(AM_V_GEN) if test -d $(top_srcdir)/.git; then \ 64 | GIT_DIR="$(top_srcdir)/.git" git log --stat > $@; \ 65 | fi 66 | 67 | dist: ChangeLog 68 | 69 | .PHONY: ChangeLog 70 | 71 | -------------------------------------------------------------------------------- /savers/xdg-user-dir-lookup.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is not licenced under the GPL like the rest of the code. 3 | Its is under the MIT license, to encourage reuse by cut-and-paste. 4 | 5 | Copyright (c) 2007 Red Hat, inc 6 | 7 | Permission is hereby granted, free of charge, to any person 8 | obtaining a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 22 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 23 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | char * xdg_user_dir_lookup (const char *type); 29 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2002-2009 The Xfce development team. All rights reserved. 4 | # 5 | # This library is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the Free 7 | # Software Foundation; either version 2 of the License, or (at your option) 8 | # any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | # more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; see the file COPYING.LGPL. If not, write 17 | # to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | # Boston, MA 02110-1301 USA 19 | # 20 | # Written for Xfce by Benedikt Meurer 21 | # and Brian Tarricone . 22 | # 23 | 24 | (type xdt-autogen) >/dev/null 2>&1 || { 25 | cat >&2 < /tmp/gs-debug-log.txt 2>&1 40 | 41 | # or just run it with debugging on 42 | xfce4-screensaver --no-daemon --debug 43 | -------------------------------------------------------------------------------- /src/xfce-desktop-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; c-set-style: linux indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ 2 | /* xfce-ditem.h - Utilities for the Xfce Desktop 3 | 4 | Copyright (C) 1998 Tom Tromey 5 | Copyright (C) 2018 Sean Davis 6 | All rights reserved. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this library; see the file COPYING.LIB. If not, 20 | write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | Boston, MA 02110-1301, USA. */ 22 | /* 23 | @NOTATION@ 24 | */ 25 | 26 | #ifndef XFCE_DESKTOP_UTILS_H 27 | #define XFCE_DESKTOP_UTILS_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | /* replace gdk_spawn_command_line_on_screen, not available in GTK3 */ 36 | gboolean xfce_gdk_spawn_command_line_on_screen (GdkScreen *screen, 37 | const gchar *command, 38 | GError **error); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* XFCE_DESKTOP_UTILS_H */ 43 | -------------------------------------------------------------------------------- /data/xfce4-screensaver-preferences.1: -------------------------------------------------------------------------------- 1 | .\" xfce4-screensaver-preferences manual page 2 | .\" 3 | .\" This is free software; you may redistribute it and/or modify 4 | .\" it under the terms of the GNU General Public License as 5 | .\" published by the Free Software Foundation; either version 2, 6 | .\" or (at your option) any later version. 7 | .\" 8 | .\" This is distributed in the hope that it will be useful, but 9 | .\" WITHOUT ANY WARRANTY; without even the implied warranty of 10 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | .\" GNU General Public License for more details. 12 | .\" 13 | .\"You should have received a copy of the GNU General Public License along 14 | .\"with this program; if not, write to the Free Software Foundation, Inc., 15 | .\"51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | .\" 17 | .TH XFCE-SCREENSAVER-PREFERENCES 1 "13 February 2014" "Xfce Desktop Environment" 18 | .\" Please adjust this date whenever revising the manpage. 19 | .\" 20 | .SH NAME 21 | xfce4-screensaver-preferences \- Configure Xfce Screensaver 22 | .SH SYNOPSIS 23 | .B xfce4-screensaver-preferences [ OPTIONS] 24 | .SH DESCRIPTION 25 | Manages preferences for the Xfce Screensaver. 26 | .SH OPTIONS 27 | This program only accepts the standard GTK options. 28 | .SH "BUGS" 29 | .SS Should you encounter any bugs, they may be reported at: 30 | http://github.com/xfce-desktop/xfce4-screensaver/issues 31 | .SH "AUTHORS" 32 | .SS xfce4-screensaver is maintained by: 33 | .nf 34 | Perberos 35 | Steve Zesch 36 | Stefano Karapetsas 37 | .fi 38 | .SS This manual page was originally written by: 39 | Sven Arvidsson (2007) 40 | .SS It has been updated for the Xfce Desktop Environment by: 41 | Adam Erdman (2014) 42 | .SH "HISTORY" 43 | .SS gnome-screensaver was written by William Jon McCann 44 | .SH "SEE ALSO" 45 | .SS The documentation available through the program's menu. 46 | Further information may also be available at: http://wiki.xfce.org/docs 47 | .P 48 | .BR xfce4-screensaver (1), 49 | .BR xfce4-screensaver-command (1), 50 | .BR gtk-options (7) 51 | -------------------------------------------------------------------------------- /src/copy-theme-dialog.h: -------------------------------------------------------------------------------- 1 | /* copy-theme-dialog.h 2 | * Copyright (C) 2008 John Millikin 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 17 | * 02110-1301, USA. 18 | **/ 19 | 20 | #ifndef __COPY_THEME_DIALOG_H__ 21 | #define __COPY_THEME_DIALOG_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define COPY_THEME_DIALOG_TYPE copy_theme_dialog_get_type () 28 | #define COPY_THEME_DIALOG(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, COPY_THEME_DIALOG_TYPE, CopyThemeDialog) 29 | #define COPY_THEME_DIALOG_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, COPY_THEME_DIALOG_TYPE, CopyThemeDialogClass) 30 | #define IS_COPY_THEME_DIALOG(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, COPY_THEME_DIALOG_TYPE) 31 | 32 | typedef struct _CopyThemeDialog CopyThemeDialog; 33 | typedef struct _CopyThemeDialogClass CopyThemeDialogClass; 34 | typedef struct _CopyThemeDialogPrivate CopyThemeDialogPrivate; 35 | 36 | struct _CopyThemeDialog 37 | { 38 | GtkDialog dialog; 39 | CopyThemeDialogPrivate *priv; 40 | }; 41 | 42 | struct _CopyThemeDialogClass 43 | { 44 | GtkDialogClass parent_class; 45 | 46 | void (*cancelled) (CopyThemeDialog *dialog); 47 | void (*complete) (CopyThemeDialog *dialog); 48 | }; 49 | 50 | GType copy_theme_dialog_get_type (void); 51 | GtkWidget *copy_theme_dialog_new (GList *files); 52 | void copy_theme_dialog_begin (CopyThemeDialog *dialog); 53 | 54 | G_END_DECLS 55 | 56 | #endif /* __COPY_THEME_DIALOG_H__ */ 57 | -------------------------------------------------------------------------------- /savers/gste-popsquares.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GSTE_POPSQUARES_H 24 | #define __GSTE_POPSQUARES_H 25 | 26 | #include 27 | #include 28 | #include "gs-theme-engine.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GSTE_TYPE_POPSQUARES (gste_popsquares_get_type ()) 33 | #define GSTE_POPSQUARES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSTE_TYPE_POPSQUARES, GSTEPopsquares)) 34 | #define GSTE_POPSQUARES_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSTE_TYPE_POPSQUARES, GSTEPopsquaresClass)) 35 | #define GSTE_IS_POPSQUARES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSTE_TYPE_POPSQUARES)) 36 | #define GSTE_IS_POPSQUARES_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSTE_TYPE_POPSQUARES)) 37 | #define GSTE_POPSQUARES_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSTE_TYPE_POPSQUARES, GSTEPopsquaresClass)) 38 | 39 | typedef struct GSTEPopsquaresPrivate GSTEPopsquaresPrivate; 40 | 41 | typedef struct 42 | { 43 | GSThemeEngine parent; 44 | GSTEPopsquaresPrivate *priv; 45 | } GSTEPopsquares; 46 | 47 | typedef struct 48 | { 49 | GSThemeEngineClass parent_class; 50 | } GSTEPopsquaresClass; 51 | 52 | GType gste_popsquares_get_type (void); 53 | GSThemeEngine *gste_popsquares_new (void); 54 | 55 | G_END_DECLS 56 | 57 | #endif /* __GSTE_POPSQUARES_H */ 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **!!! THIS REPOSITORY IS ARCHIVED !!!**\ 2 | Xfce Screensaver has moved to the Xfce infrastructure. 3 | - [Git](https://git.xfce.org/apps/xfce4-screensaver/) 4 | - [Bugzilla](https://bugzilla.xfce.org/buglist.cgi?component=General&product=Xfce4-screensaver) 5 | - [Documentation](https://docs.xfce.org/apps/screensaver/start) 6 | 7 | Xfce Screensaver 8 | ================ 9 | 10 | xfce4-screensaver is a screen saver and locker that aims to have 11 | simple, sane, secure defaults and be well integrated with the desktop. 12 | 13 | This project is a port of [MATE Screensaver](https://github.com/mate-desktop/mate-screensaver), 14 | itself a port of [GNOME Screensaver](https://gitlab.gnome.org/Archive/gnome-screensaver). 15 | It has been tightly integrated with the Xfce desktop, utilizing Xfce 16 | libraries and the Xfconf configuration backend. 17 | 18 | Features 19 | ======== 20 | 21 | - Integration with the Xfce Desktop per-monitor wallpaper 22 | - Locking down of configuration settings via Xfconf 23 | - DBUS interface to limited screensaver interaction 24 | - Full translation support into many languages 25 | - Shared styles with LightDM GTK+ Greeter 26 | - Support for XScreensaver screensavers 27 | - User switching 28 | 29 | Known Issues 30 | ============ 31 | 32 | - Theming issues with the Adwaita GTK theme 33 | 34 | Installation 35 | ============ 36 | 37 | See the file 'INSTALL' 38 | 39 | `./autogen.sh --prefix=/usr --sysconfdir=/etc` 40 | 41 | (For testing, we are using: 42 | `./autogen.sh --disable-static --with-mit-ext --with-console-kit --enable-locking --enable-debug --sysconfdir=/etc` 43 | ) 44 | 45 | `make && sudo make install` 46 | 47 | 48 | How to report bugs 49 | ================== 50 | 51 | For the time being, please report bugs here on GitHub: 52 | https://github.com/bluesabre/xfce4-screensaver/issues 53 | 54 | You will need to create an account if you don't have one already. 55 | 56 | In the bug report please include information about your system, if possible: 57 | 58 | - What operating system and version 59 | - What version of xfce4-screensaver, i.e. the output of the `xfce4-screensaver-command --version` command 60 | 61 | If you want to debug your installation you may also be able to get meaningful debug output when starting xfce4-screensaver from the debug script: 62 | `./src/debug-screensaver.sh` 63 | -------------------------------------------------------------------------------- /src/gs-monitor.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_MONITOR_H 24 | #define __GS_MONITOR_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_MONITOR (gs_monitor_get_type ()) 31 | #define GS_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_MONITOR, GSMonitor)) 32 | #define GS_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_MONITOR, GSMonitorClass)) 33 | #define GS_IS_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_MONITOR)) 34 | #define GS_IS_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_MONITOR)) 35 | #define GS_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_MONITOR, GSMonitorClass)) 36 | 37 | typedef struct GSMonitorPrivate GSMonitorPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSMonitorPrivate *priv; 43 | } GSMonitor; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | } GSMonitorClass; 49 | 50 | GType gs_monitor_get_type (void); 51 | 52 | GSMonitor * gs_monitor_new (void); 53 | gboolean gs_monitor_start (GSMonitor *monitor, 54 | GError **error); 55 | void gs_monitor_set_lock_enabled (GSMonitor *monitor, 56 | gboolean lock_enabled); 57 | G_END_DECLS 58 | 59 | #endif /* __GS_MONITOR_H */ 60 | -------------------------------------------------------------------------------- /src/gs-auth.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #ifndef __GS_AUTH_H 23 | #define __GS_AUTH_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | typedef enum 30 | { 31 | GS_AUTH_MESSAGE_PROMPT_ECHO_ON, 32 | GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, 33 | GS_AUTH_MESSAGE_ERROR_MSG, 34 | GS_AUTH_MESSAGE_TEXT_INFO 35 | } GSAuthMessageStyle; 36 | 37 | typedef enum 38 | { 39 | GS_AUTH_ERROR_GENERAL, 40 | GS_AUTH_ERROR_AUTH_ERROR, 41 | GS_AUTH_ERROR_USER_UNKNOWN, 42 | GS_AUTH_ERROR_AUTH_DENIED 43 | } GSAuthError; 44 | 45 | typedef gboolean (* GSAuthMessageFunc) (GSAuthMessageStyle style, 46 | const char *msg, 47 | char **response, 48 | gpointer data); 49 | 50 | #define GS_AUTH_ERROR gs_auth_error_quark () 51 | 52 | GQuark gs_auth_error_quark (void); 53 | 54 | void gs_auth_set_verbose (gboolean verbose); 55 | gboolean gs_auth_get_verbose (void); 56 | 57 | gboolean gs_auth_priv_init (void); 58 | gboolean gs_auth_init (void); 59 | gboolean gs_auth_verify_user (const char *username, 60 | const char *display, 61 | GSAuthMessageFunc func, 62 | gpointer data, 63 | GError **error); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* __GS_AUTH_H */ 68 | -------------------------------------------------------------------------------- /savers/popsquares.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include "gs-theme-window.h" 31 | #include "gs-theme-engine.h" 32 | #include "gste-popsquares.h" 33 | 34 | int 35 | main (int argc, 36 | char **argv) 37 | { 38 | GSThemeEngine *engine; 39 | GtkWidget *window; 40 | GError *error; 41 | 42 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 43 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 44 | textdomain (GETTEXT_PACKAGE); 45 | 46 | error = NULL; 47 | 48 | if (!gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 49 | { 50 | g_printerr (_("%s. See --help for usage information.\n"), 51 | error->message); 52 | g_error_free (error); 53 | exit (1); 54 | } 55 | 56 | window = gs_theme_window_new (); 57 | g_signal_connect (G_OBJECT (window), "delete-event", 58 | G_CALLBACK (gtk_main_quit), NULL); 59 | 60 | g_set_prgname ("popsquares"); 61 | 62 | engine = g_object_new (GSTE_TYPE_POPSQUARES, NULL); 63 | gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (engine)); 64 | 65 | gtk_widget_show (GTK_WIDGET (engine)); 66 | 67 | gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); 68 | gtk_widget_show (window); 69 | 70 | gtk_main (); 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /src/xfce4-screensaver-gl-helper.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #include "gs-visual-gl.h" 32 | 33 | int 34 | main (int argc, 35 | char **argv) 36 | { 37 | GdkDisplay *display; 38 | GdkVisual *visual; 39 | Visual *xvisual; 40 | GError *error = NULL; 41 | 42 | #ifdef ENABLE_NLS 43 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 44 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET 45 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 46 | # endif 47 | textdomain (GETTEXT_PACKAGE); 48 | #endif 49 | 50 | g_set_prgname (argv[0]); 51 | if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 52 | { 53 | if (error != NULL) 54 | { 55 | g_warning ("%s", error->message); 56 | g_error_free (error); 57 | } 58 | else 59 | { 60 | g_warning ("Unable to initialize GTK+"); 61 | } 62 | exit (1); 63 | } 64 | 65 | display = gdk_display_get_default (); 66 | visual = gs_visual_gl_get_best_for_display (display); 67 | 68 | if (visual != NULL) 69 | { 70 | xvisual = gdk_x11_visual_get_xvisual (visual); 71 | printf ("0x%x\n", (unsigned int) XVisualIDFromVisual (xvisual)); 72 | } 73 | else 74 | { 75 | printf ("none\n"); 76 | } 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /data/xfce4-screensaver-command.1: -------------------------------------------------------------------------------- 1 | .\" Copyright (C) 2007 Sven Arvidsson 2 | .\" 3 | .\" This is free software; you may redistribute it and/or modify 4 | .\" it under the terms of the GNU General Public License as 5 | .\" published by the Free Software Foundation; either version 2, 6 | .\" or (at your option) any later version. 7 | .\" 8 | .\" This is distributed in the hope that it will be useful, but 9 | .\" WITHOUT ANY WARRANTY; without even the implied warranty of 10 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | .\" GNU General Public License for more details. 12 | .\" 13 | .\"You should have received a copy of the GNU General Public License along 14 | .\"with this program; if not, write to the Free Software Foundation, Inc., 15 | .\"51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | .TH xfce4-screensaver-command 1 "2007\-09\-27" "XFCE" 17 | .SH NAME 18 | xfce4-screensaver-command \- controls Xfce screensaver 19 | .SH SYNOPSIS 20 | .B xfce4-screensaver-command 21 | .RI [ OPTION... ] 22 | .SH DESCRIPTION 23 | xfce4-screensaver-command is a tool for controlling an already running instance of xfce4-screensaver. 24 | .SH OPTIONS 25 | .TP 26 | .B \-\-exit 27 | Causes the screensaver to exit gracefully 28 | .TP 29 | .B \-q, \-\-query 30 | Query the state of the screensaver 31 | .TP 32 | .B \-t, \-\-time 33 | Query the length of time the screensaver has been active 34 | .TP 35 | .B \-l, \-\-lock 36 | Tells the running screensaver process to lock the screen immediately 37 | .TP 38 | .B \-c, \-\-cycle 39 | If the screensaver is active then switch to another graphics demo 40 | .TP 41 | .B \-a, \-\-activate 42 | Turn the screensaver on (blank the screen) 43 | .TP 44 | .B \-d, \-\-deactivate 45 | If the screensaver is active then deactivate it (un-blank the screen) 46 | .TP 47 | .B \-p, \-\-poke 48 | Poke the running screensaver to simulate user activity 49 | .TP 50 | .B \-i, \-\-inhibit 51 | Inhibit the screensaver from activating. Command blocks while inhibit 52 | is active. 53 | .TP 54 | .B \-n, \-\-application-name 55 | The calling application that is inhibiting the screensaver 56 | .TP 57 | .B \-r, \-\-reason 58 | The reason for inhibiting the screensaver 59 | .TP 60 | .B \-V, \-\-version 61 | Version of this application 62 | .SH AUTHORS 63 | .B 64 | This manual page was originally written by Sven Arvidsson for gnome-screensaver-command. 65 | .SH SEE ALSO 66 | .BR "xfce4-screensaver" (1) 67 | 68 | -------------------------------------------------------------------------------- /savers/gs-theme-window.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * gs-theme-window.h - special toplevel for screensavers 4 | * 5 | * Copyright (C) 2005 Ray Strode 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be 13 | * useful, but WITHOUT ANY WARRANTY; without even the implied 14 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 15 | * PURPOSE. See the GNU Lesser General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU Lesser General 19 | * Public License along with this program; see the file 20 | * COPYING.LGPL. If not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 22 | * 23 | * Originally written by: Ray Strode 24 | */ 25 | 26 | #ifndef GS_THEME_WINDOW_H 27 | #define GS_THEME_WINDOW_H 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | #define GS_TYPE_THEME_WINDOW (gs_theme_window_get_type ()) 37 | #define GS_THEME_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GS_TYPE_THEME_WINDOW, GSThemeWindow)) 38 | #define GS_THEME_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GS_TYPE_THEME_WINDOW, GSThemeWindowClass)) 39 | #define GS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GS_TYPE_THEME_WINDOW)) 40 | #define GS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GS_TYPE_THEME_WINDOW)) 41 | #define GS_THEME_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GS_TYPE_THEME_WINDOW, GSThemeWindowClass)) 42 | 43 | typedef struct _GSThemeWindow GSThemeWindow; 44 | typedef struct _GSThemeWindowClass GSThemeWindowClass; 45 | 46 | struct _GSThemeWindow 47 | { 48 | GtkWindow parent; 49 | 50 | /*< private >*/ 51 | /* reserved for priv pointer */ 52 | gpointer reserved; 53 | }; 54 | 55 | struct _GSThemeWindowClass 56 | { 57 | GtkWindowClass parent_class; 58 | 59 | /* for signals later if needed */ 60 | gpointer reserved_1; 61 | gpointer reserved_2; 62 | gpointer reserved_3; 63 | gpointer reserved_4; 64 | }; 65 | 66 | #ifndef GS_HIDE_FUNCTION_DECLARATIONS 67 | GType gs_theme_window_get_type (void); 68 | GtkWidget *gs_theme_window_new (void); 69 | #endif 70 | 71 | G_END_DECLS 72 | #endif /* GS_THEME_WINDOW_H */ 73 | -------------------------------------------------------------------------------- /src/xfcekbd-indicator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Sergey V. Udaltsov 3 | * Copyright (C) 2018 Sean Davis 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; see the file COPYING.LGPL. If not, 17 | * write to the Free Software Foundation, Inc., 51 Franklin St, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __XFCEKBD_INDICATOR_H__ 22 | #define __XFCEKBD_INDICATOR_H__ 23 | 24 | #include 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct _XfcekbdIndicator XfcekbdIndicator; 33 | typedef struct _XfcekbdIndicatorPrivate XfcekbdIndicatorPrivate; 34 | typedef struct _XfcekbdIndicatorClass XfcekbdIndicatorClass; 35 | 36 | #define XFCEKBD_TYPE_INDICATOR (xfcekbd_indicator_get_type ()) 37 | #define XFCEKBD_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCEKBD_TYPE_INDICATOR, XfcekbdIndicator)) 38 | #define XFCEKBD_INDICATOR_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), XFCEKBD_TYPE_INDICATOR, XfcekbdIndicatorClass)) 39 | #define XFCEKBD_IS_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCEKBD_TYPE_INDICATOR)) 40 | #define XFCEKBD_IS_INDICATOR_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), XFCEKBD_TYPE_INDICATOR)) 41 | #define XFCEKBD_INDICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCEKBD_TYPE_INDICATOR, XfcekbdIndicatorClass)) 42 | 43 | struct _XfcekbdIndicator { 44 | GtkNotebook parent; 45 | XfcekbdIndicatorPrivate *priv; 46 | }; 47 | 48 | struct _XfcekbdIndicatorClass { 49 | GtkNotebookClass parent_class; 50 | 51 | void (*reinit_ui) (XfcekbdIndicator * gki); 52 | }; 53 | 54 | extern GType xfcekbd_indicator_get_type (void); 55 | 56 | extern GtkWidget * xfcekbd_indicator_new (void); 57 | 58 | extern void xfcekbd_indicator_set_parent_tooltips (XfcekbdIndicator *gki, 59 | gboolean ifset); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #endif 65 | -------------------------------------------------------------------------------- /data/xfce4-screensaver.1: -------------------------------------------------------------------------------- 1 | .\" xfce4-screensaver manual page 2 | .\" 3 | .\" This is free software; you may redistribute it and/or modify 4 | .\" it under the terms of the GNU General Public License as 5 | .\" published by the Free Software Foundation; either version 2, 6 | .\" or (at your option) any later version. 7 | .\" 8 | .\" This is distributed in the hope that it will be useful, but 9 | .\" WITHOUT ANY WARRANTY; without even the implied warranty of 10 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | .\" GNU General Public License for more details. 12 | .\" 13 | .\"You should have received a copy of the GNU General Public License along 14 | .\"with this program; if not, write to the Free Software Foundation, Inc., 15 | .\"51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | .\" 17 | .TH XFCE-SCREENSAVER 1 "13 February 2014" "Xfce Desktop Environment" 18 | .\" Please adjust this date whenever revising the manpage. 19 | .\" 20 | .SH "NAME" 21 | xfce4-screensaver \- The Xfce Desktop Screensaver and Locker 22 | .SH "SYNOPSIS" 23 | .B xfce4-screensaver [OPTIONS] 24 | .SH "DESCRIPTION" 25 | Xfce Screensaver is the default screen saver and locker for the Xfce Desktop. It is designed with simplicity and security in mind. \fBxfce4-screensaver\fP integrates well with the Xfce desktop, and it supports User Switching and the ability to lock down configuration settings. 26 | .SH "OPTIONS" 27 | .TP 28 | \fB\-\-display=DISPLAY\fR 29 | X display to use. 30 | .TP 31 | \fB\-\-no\-daemon\fR 32 | Don't start as a daemon 33 | .TP 34 | \fB\-\-debug\fR 35 | Enable debugging messages for \fBxfce4-screensaver\fP 36 | .TP 37 | \fB\-\-version\fR 38 | Output version information and exit. 39 | .TP 40 | \fB\-h, \-\-help\fR 41 | Print standard command line options. 42 | .TP 43 | \fB\-\-help\-all\fR 44 | Print all command line options. 45 | .P 46 | This program also accepts the standard GTK options. 47 | .SH "BUGS" 48 | .SS Should you encounter any bugs, they may be reported at: 49 | http://github.com/xfce-desktop/xfce4-screensaver/issues 50 | .SH "AUTHORS" 51 | .SS xfce4-screensaver is maintained by: 52 | .nf 53 | Perberos 54 | Steve Zesch 55 | Stefano Karapetsas 56 | .fi 57 | .SS This Man Page has been updated for the Xfce Desktop Environment by: 58 | Adam Erdman (2014) 59 | .SH "HISTORY" 60 | .SS gnome-screensaver was written by William Jon McCann 61 | .SS This manual page was originally written by Sven Arvidsson (2007) 62 | .SH "SEE ALSO" 63 | .SS Further information may also be available at: http://wiki.xfce.org/docs 64 | .P 65 | .BR xfce4-screensaver-command (1), 66 | .BR xfce4-screensaver-preferences (1), 67 | .BR gtk-options (7) 68 | -------------------------------------------------------------------------------- /src/gs-job.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_JOB_H 24 | #define __GS_JOB_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_JOB (gs_job_get_type ()) 31 | #define GS_JOB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_JOB, GSJob)) 32 | #define GS_JOB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_JOB, GSJobClass)) 33 | #define GS_IS_JOB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_JOB)) 34 | #define GS_IS_JOB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_JOB)) 35 | #define GS_JOB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_JOB, GSJobClass)) 36 | 37 | typedef struct GSJobPrivate GSJobPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSJobPrivate *priv; 43 | } GSJob; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | } GSJobClass; 49 | 50 | GType gs_job_get_type (void); 51 | 52 | GSJob *gs_job_new (void); 53 | GSJob *gs_job_new_for_widget (GtkWidget *widget); 54 | 55 | gboolean gs_job_is_running (GSJob *job); 56 | gboolean gs_job_start (GSJob *job); 57 | gboolean gs_job_stop (GSJob *job); 58 | gboolean gs_job_suspend (GSJob *job, 59 | gboolean suspend); 60 | 61 | void gs_job_set_widget (GSJob *job, 62 | GtkWidget *widget); 63 | 64 | gboolean gs_job_set_command (GSJob *job, 65 | const char *command); 66 | 67 | G_END_DECLS 68 | 69 | #endif /* __GS_JOB_H */ 70 | -------------------------------------------------------------------------------- /src/gs-watcher.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_WATCHER_H 24 | #define __GS_WATCHER_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_WATCHER (gs_watcher_get_type ()) 31 | #define GS_WATCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_WATCHER, GSWatcher)) 32 | #define GS_WATCHER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_WATCHER, GSWatcherClass)) 33 | #define GS_IS_WATCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_WATCHER)) 34 | #define GS_IS_WATCHER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_WATCHER)) 35 | #define GS_WATCHER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_WATCHER, GSWatcherClass)) 36 | 37 | typedef struct GSWatcherPrivate GSWatcherPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSWatcherPrivate *priv; 43 | } GSWatcher; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | 49 | gboolean (* idle_changed) (GSWatcher *watcher, 50 | gboolean is_idle); 51 | gboolean (* idle_notice_changed) (GSWatcher *watcher, 52 | gboolean in_effect); 53 | } GSWatcherClass; 54 | 55 | GType gs_watcher_get_type (void); 56 | 57 | GSWatcher * gs_watcher_new (void); 58 | gboolean gs_watcher_set_enabled (GSWatcher *watcher, 59 | gboolean enabled); 60 | gboolean gs_watcher_get_enabled (GSWatcher *watcher); 61 | gboolean gs_watcher_set_active (GSWatcher *watcher, 62 | gboolean active); 63 | gboolean gs_watcher_get_active (GSWatcher *watcher); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* __GS_WATCHER_H */ 68 | -------------------------------------------------------------------------------- /src/gs-debug.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_DEBUG_H 24 | #define __GS_DEBUG_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 32 | #define gs_debug(...) gs_debug_real (__func__, __FILE__, __LINE__, __VA_ARGS__) 33 | #elif defined(__GNUC__) && __GNUC__ >= 3 34 | #define gs_debug(...) gs_debug_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) 35 | #else 36 | #define gs_debug(...) 37 | #endif 38 | 39 | void gs_debug_init (gboolean debug, 40 | gboolean to_file); 41 | gboolean gs_debug_enabled (void); 42 | void gs_debug_shutdown (void); 43 | void gs_debug_real (const char *func, 44 | const char *file, 45 | int line, 46 | const char *format, ...); 47 | 48 | #ifdef ENABLE_PROFILING 49 | #ifdef G_HAVE_ISO_VARARGS 50 | #define gs_profile_start(...) _gs_profile_log (G_STRFUNC, "start", __VA_ARGS__) 51 | #define gs_profile_end(...) _gs_profile_log (G_STRFUNC, "end", __VA_ARGS__) 52 | #define gs_profile_msg(...) _gs_profile_log (NULL, NULL, __VA_ARGS__) 53 | #elif defined(G_HAVE_GNUC_VARARGS) 54 | #define gs_profile_start(format...) _gs_profile_log (G_STRFUNC, "start", format) 55 | #define gs_profile_end(format...) _gs_profile_log (G_STRFUNC, "end", format) 56 | #define gs_profile_msg(format...) _gs_profile_log (NULL, NULL, format) 57 | #endif 58 | #else 59 | #define gs_profile_start(...) 60 | #define gs_profile_end(...) 61 | #define gs_profile_msg(...) 62 | #endif 63 | 64 | void _gs_profile_log (const char *func, 65 | const char *note, 66 | const char *format, 67 | ...) G_GNUC_PRINTF (3, 4); 68 | 69 | G_END_DECLS 70 | 71 | #endif /* __GS_DEBUG_H */ 72 | -------------------------------------------------------------------------------- /src/xfce-desktop-utils.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; c-set-style: linux indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ 2 | /* xfce-desktop-utils.c - Utilities for the Xfce Desktop 3 | 4 | Copyright (C) 1998 Tom Tromey 5 | Copyright (C) 2018 Sean Davis 6 | All rights reserved. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this library; see the file COPYING.LIB. If not, 20 | write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | Boston, MA 02110-1301, USA. */ 22 | /* 23 | @NOTATION@ 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | /** 36 | * xfce_gdk_spawn_command_line_on_screen: 37 | * @screen: a GdkScreen 38 | * @command: a command line 39 | * @error: return location for errors 40 | * 41 | * This is a replacement for gdk_spawn_command_line_on_screen, deprecated 42 | * in GDK 2.24 and removed in GDK 3.0. 43 | * 44 | * gdk_spawn_command_line_on_screen is like g_spawn_command_line_async(), 45 | * except the child process is spawned in such an environment that on 46 | * calling gdk_display_open() it would be returned a GdkDisplay with 47 | * screen as the default screen. 48 | * 49 | * This is useful for applications which wish to launch an application 50 | * on a specific screen. 51 | * 52 | * Returns: TRUE on success, FALSE if error is set. 53 | * 54 | * Since: 1.7.1 55 | **/ 56 | gboolean 57 | xfce_gdk_spawn_command_line_on_screen (GdkScreen *screen, 58 | const gchar *command, 59 | GError **error) 60 | { 61 | GAppInfo *appinfo = NULL; 62 | GdkAppLaunchContext *context = NULL; 63 | gboolean res = FALSE; 64 | 65 | appinfo = g_app_info_create_from_commandline (command, NULL, G_APP_INFO_CREATE_NONE, error); 66 | 67 | if (appinfo) { 68 | context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen)); 69 | res = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), error); 70 | g_object_unref (context); 71 | g_object_unref (appinfo); 72 | } 73 | 74 | return res; 75 | } 76 | -------------------------------------------------------------------------------- /src/xfcekbd-keyboard-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Sergey V. Udaltsov 3 | * Copyright (C) 2018 Sean Davis 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; see the file COPYING.LGPL. If not, 17 | * write to the Free Software Foundation, Inc., 51 Franklin St, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __XFCEKBD_KEYBOARD_CONFIG_H__ 22 | #define __XFCEKBD_KEYBOARD_CONFIG_H__ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | extern const gchar XFCEKBD_KEYBOARD_CONFIG_KEY_MODEL[]; 30 | extern const gchar XFCEKBD_KEYBOARD_CONFIG_KEY_LAYOUTS[]; 31 | extern const gchar XFCEKBD_KEYBOARD_CONFIG_KEY_OPTIONS[]; 32 | 33 | /* 34 | * Keyboard Configuration 35 | */ 36 | typedef struct _XfcekbdKeyboardConfig XfcekbdKeyboardConfig; 37 | struct _XfcekbdKeyboardConfig { 38 | gchar *model; 39 | gchar **layouts_variants; 40 | gchar **options; 41 | 42 | /* private, transient */ 43 | int config_listener_id; 44 | XklEngine *engine; 45 | }; 46 | 47 | /* 48 | * XfcekbdKeyboardConfig functions 49 | */ 50 | extern void xfcekbd_keyboard_config_init (XfcekbdKeyboardConfig *kbd_config, 51 | XklEngine *engine); 52 | extern void xfcekbd_keyboard_config_term (XfcekbdKeyboardConfig *kbd_config); 53 | 54 | extern void xfcekbd_keyboard_config_load_from_x_current (XfcekbdKeyboardConfig *kbd_config, 55 | XklConfigRec *buf); 56 | 57 | extern gboolean xfcekbd_keyboard_config_split_items (const gchar *merged, 58 | gchar **parent, 59 | gchar **child); 60 | 61 | extern const gchar * xfcekbd_keyboard_config_format_full_layout (const gchar *layout_descr, 62 | const gchar *variant_descr); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /savers/gste-slideshow.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GSTE_SLIDESHOW_H 24 | #define __GSTE_SLIDESHOW_H 25 | 26 | #include 27 | #include 28 | #include "gs-theme-engine.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GSTE_TYPE_SLIDESHOW (gste_slideshow_get_type ()) 33 | #define GSTE_SLIDESHOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSTE_TYPE_SLIDESHOW, GSTESlideshow)) 34 | #define GSTE_SLIDESHOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSTE_TYPE_SLIDESHOW, GSTESlideshowClass)) 35 | #define GSTE_IS_SLIDESHOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSTE_TYPE_SLIDESHOW)) 36 | #define GSTE_IS_SLIDESHOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSTE_TYPE_SLIDESHOW)) 37 | #define GSTE_SLIDESHOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSTE_TYPE_SLIDESHOW, GSTESlideshowClass)) 38 | 39 | typedef struct GSTESlideshowPrivate GSTESlideshowPrivate; 40 | 41 | typedef struct 42 | { 43 | GSThemeEngine parent; 44 | GSTESlideshowPrivate *priv; 45 | } GSTESlideshow; 46 | 47 | typedef struct 48 | { 49 | GSThemeEngineClass parent_class; 50 | } GSTESlideshowClass; 51 | 52 | GType gste_slideshow_get_type (void); 53 | GSThemeEngine *gste_slideshow_new (void); 54 | 55 | void gste_slideshow_set_images_location (GSTESlideshow *show, 56 | const char *location); 57 | 58 | void gste_slideshow_set_sort_images (GSTESlideshow *show, 59 | gboolean sort_image); 60 | 61 | void gste_slideshow_set_background_color (GSTESlideshow *show, 62 | const char *background_color); 63 | 64 | void gste_slideshow_set_no_stretch_hint (GSTESlideshow *show, 65 | gboolean no_stretch_hint); 66 | 67 | G_END_DECLS 68 | 69 | #endif /* __GSTE_SLIDESHOW_H */ 70 | -------------------------------------------------------------------------------- /src/gs-theme-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_THEME_MANAGER_H 24 | #define __GS_THEME_MANAGER_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_THEME_MANAGER (gs_theme_manager_get_type ()) 31 | #define GS_THEME_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_THEME_MANAGER, GSThemeManager)) 32 | #define GS_THEME_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_THEME_MANAGER, GSThemeManagerClass)) 33 | #define GS_IS_THEME_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_THEME_MANAGER)) 34 | #define GS_IS_THEME_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_THEME_MANAGER)) 35 | #define GS_THEME_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_THEME_MANAGER, GSThemeManagerClass)) 36 | 37 | typedef struct GSThemeManagerPrivate GSThemeManagerPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSThemeManagerPrivate *priv; 43 | } GSThemeManager; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | } GSThemeManagerClass; 49 | 50 | typedef struct _GSThemeInfo GSThemeInfo; 51 | 52 | GType gs_theme_manager_get_type (void); 53 | 54 | GSThemeManager *gs_theme_manager_new (void); 55 | 56 | GSList *gs_theme_manager_get_info_list (GSThemeManager *manager); 57 | GSThemeInfo *gs_theme_manager_lookup_theme_info (GSThemeManager *manager, 58 | const char *theme); 59 | GSThemeInfo *gs_theme_info_ref (GSThemeInfo *info); 60 | void gs_theme_info_unref (GSThemeInfo *info); 61 | const char *gs_theme_info_get_id (GSThemeInfo *info); 62 | const char *gs_theme_info_get_name (GSThemeInfo *info); 63 | const char *gs_theme_info_get_exec (GSThemeInfo *info); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* __GS_THEME_MANAGER_H */ 68 | -------------------------------------------------------------------------------- /src/gs-fade.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_FADE_H 24 | #define __GS_FADE_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_FADE (gs_fade_get_type ()) 31 | #define GS_FADE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_FADE, GSFade)) 32 | #define GS_FADE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_FADE, GSFadeClass)) 33 | #define GS_IS_FADE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_FADE)) 34 | #define GS_IS_FADE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_FADE)) 35 | #define GS_FADE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_FADE, GSFadeClass)) 36 | 37 | 38 | typedef struct GSFadePrivate GSFadePrivate; 39 | 40 | typedef struct 41 | { 42 | GObject parent; 43 | GSFadePrivate *priv; 44 | } GSFade; 45 | 46 | typedef struct 47 | { 48 | GObjectClass parent_class; 49 | 50 | void (* faded) (GSFade *fade); 51 | } GSFadeClass; 52 | 53 | typedef void (* GSFadeDoneFunc) (GSFade *fade, 54 | gpointer data); 55 | 56 | 57 | GType gs_fade_get_type (void); 58 | 59 | GSFade * gs_fade_new (void); 60 | 61 | void gs_fade_async (GSFade *fade, 62 | guint timeout, 63 | GSFadeDoneFunc done_cb, 64 | gpointer data); 65 | void gs_fade_sync (GSFade *fade, 66 | guint timeout); 67 | 68 | void gs_fade_finish (GSFade *fade); 69 | void gs_fade_reset (GSFade *fade); 70 | 71 | gboolean gs_fade_get_active (GSFade *fade); 72 | 73 | gboolean gs_fade_get_enabled (GSFade *fade); 74 | void gs_fade_set_enabled (GSFade *fade, 75 | gboolean enabled); 76 | 77 | G_END_DECLS 78 | 79 | #endif /* __GS_FADE_H */ 80 | -------------------------------------------------------------------------------- /src/gs-auth-bsdauth.c: -------------------------------------------------------------------------------- 1 | /* 2 | * gs-auth-bsdauth.c --- verifying typed passwords with bsd_auth(3) 3 | * 4 | * Copyright (c) 1993-1998 Jamie Zawinski 5 | * Copyright (C) 2006 William Jon McCann 6 | * Copyright (c) 2009 Antoine Jacoutot 7 | * Copyright (c) 2017 Robert Nagy 8 | * 9 | * Permission to use, copy, modify, and distribute this software for any 10 | * purpose with or without fee is hereby granted, provided that the above 11 | * copyright notice and this permission notice appear in all copies. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #ifdef HAVE_UNISTD_H 29 | #include 30 | #endif 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #include "gs-auth.h" 38 | #include "subprocs.h" 39 | 40 | static gboolean verbose_enabled = FALSE; 41 | 42 | GQuark 43 | gs_auth_error_quark (void) 44 | { 45 | static GQuark quark = 0; 46 | if (! quark) { 47 | quark = g_quark_from_static_string ("gs_auth_error"); 48 | } 49 | 50 | return quark; 51 | } 52 | 53 | void 54 | gs_auth_set_verbose (gboolean enabled) 55 | { 56 | verbose_enabled = enabled; 57 | } 58 | 59 | gboolean 60 | gs_auth_get_verbose (void) 61 | { 62 | return verbose_enabled; 63 | } 64 | 65 | gboolean 66 | gs_auth_verify_user (const char *username, 67 | const char *display, 68 | GSAuthMessageFunc func, 69 | gpointer data, 70 | GError **error) 71 | { 72 | int res; 73 | char *password; 74 | 75 | /* ask for the password for user */ 76 | if (func != NULL) { 77 | func (GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, 78 | "Password: ", 79 | &password, 80 | data); 81 | } 82 | 83 | if (password == NULL) { 84 | return FALSE; 85 | } 86 | 87 | /* authenticate */ 88 | res = auth_userokay((char *)username, NULL, "auth-xfce4-screensaver", password); 89 | 90 | return res; 91 | } 92 | 93 | gboolean 94 | gs_auth_init (void) 95 | { 96 | return TRUE; 97 | } 98 | 99 | gboolean 100 | gs_auth_priv_init (void) 101 | { 102 | return TRUE; 103 | } 104 | -------------------------------------------------------------------------------- /src/xfcekbd-indicator-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Sergey V. Udaltsov 3 | * Copyright (C) 2018 Sean Davis 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; see the file COPYING.LGPL. If not, 17 | * write to the Free Software Foundation, Inc., 51 Franklin St, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __XFCEKBD_INDICATOR_CONFIG_H__ 22 | #define __XFCEKBD_INDICATOR_CONFIG_H__ 23 | 24 | #include 25 | #include 26 | 27 | #include "xfcekbd-keyboard-config.h" 28 | 29 | /* 30 | * Indicator configuration 31 | */ 32 | typedef struct _XfcekbdIndicatorConfig XfcekbdIndicatorConfig; 33 | struct _XfcekbdIndicatorConfig { 34 | int secondary_groups_mask; 35 | gboolean show_flags; 36 | 37 | gchar *font_family; 38 | gchar *foreground_color; 39 | gchar *background_color; 40 | 41 | /* private, transient */ 42 | XfconfChannel *channel; 43 | GSList *image_filenames; 44 | GtkIconTheme *icon_theme; 45 | int config_listener_id; 46 | XklEngine *engine; 47 | }; 48 | 49 | /* 50 | * XfcekbdIndicatorConfig functions - 51 | * some of them require XfcekbdKeyboardConfig as well - 52 | * for loading approptiate images 53 | */ 54 | void xfcekbd_indicator_config_init (XfcekbdIndicatorConfig *applet_config, 55 | XklEngine *engine); 56 | void xfcekbd_indicator_config_term (XfcekbdIndicatorConfig *applet_config); 57 | 58 | void xfcekbd_indicator_config_load_from_xfconf (XfcekbdIndicatorConfig *applet_config); 59 | 60 | void xfcekbd_indicator_config_load_image_filenames (XfcekbdIndicatorConfig *applet_config, 61 | XfcekbdKeyboardConfig *kbd_config); 62 | void xfcekbd_indicator_config_free_image_filenames (XfcekbdIndicatorConfig *applet_config); 63 | 64 | /* Should be updated on Indicator/Xfconf configuration change */ 65 | void xfcekbd_indicator_config_activate (XfcekbdIndicatorConfig *applet_config); 66 | 67 | void xfcekbd_indicator_config_start_listen (XfcekbdIndicatorConfig *applet_config, 68 | GCallback func, 69 | gpointer user_data); 70 | 71 | void xfcekbd_indicator_config_stop_listen (XfcekbdIndicatorConfig *applet_config); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/test-watcher.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | * Authors: William Jon McCann 21 | * 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #include "gs-watcher.h" 32 | #include "gs-debug.h" 33 | 34 | static gboolean 35 | watcher_idle_cb (GSWatcher *watcher, 36 | gboolean is_idle, 37 | gpointer data) 38 | { 39 | g_message ("Idle status changed: %s", is_idle ? "idle" : "not idle"); 40 | 41 | /* return FALSE so that the idle watcher continues */ 42 | return FALSE; 43 | } 44 | 45 | static gboolean 46 | watcher_idle_notice_cb (GSWatcher *watcher, 47 | gboolean is_idle, 48 | gpointer data) 49 | { 50 | g_message ("Idle notice status changed: %s", is_idle ? "idle" : "not idle"); 51 | 52 | return TRUE; 53 | } 54 | 55 | static void 56 | connect_watcher_signals (GSWatcher *watcher) 57 | { 58 | g_signal_connect (watcher, "idle-changed", 59 | G_CALLBACK (watcher_idle_cb), NULL); 60 | g_signal_connect (watcher, "idle-notice-changed", 61 | G_CALLBACK (watcher_idle_notice_cb), NULL); 62 | } 63 | 64 | static void 65 | test_watcher (void) 66 | { 67 | GSWatcher *watcher; 68 | 69 | watcher = gs_watcher_new (); 70 | gs_watcher_set_enabled (watcher, TRUE); 71 | gs_watcher_set_active (watcher, TRUE); 72 | 73 | connect_watcher_signals (watcher); 74 | } 75 | 76 | int 77 | main (int argc, 78 | char **argv) 79 | { 80 | GError *error = NULL; 81 | 82 | #ifdef ENABLE_NLS 83 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 84 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET 85 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 86 | # endif 87 | textdomain (GETTEXT_PACKAGE); 88 | #endif 89 | 90 | if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 91 | { 92 | fprintf (stderr, "%s", error->message); 93 | g_error_free (error); 94 | exit (1); 95 | } 96 | 97 | gs_debug_init (TRUE, FALSE); 98 | 99 | test_watcher (); 100 | 101 | gtk_main (); 102 | 103 | gs_debug_shutdown (); 104 | 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /src/gs-grab.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_GRAB_H 24 | #define __GS_GRAB_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GS_TYPE_GRAB (gs_grab_get_type ()) 32 | #define GS_GRAB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_GRAB, GSGrab)) 33 | #define GS_GRAB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_GRAB, GSGrabClass)) 34 | #define GS_IS_GRAB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_GRAB)) 35 | #define GS_IS_GRAB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_GRAB)) 36 | #define GS_GRAB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_GRAB, GSGrabClass)) 37 | 38 | typedef struct GSGrabPrivate GSGrabPrivate; 39 | 40 | typedef struct 41 | { 42 | GObject parent; 43 | GSGrabPrivate *priv; 44 | } GSGrab; 45 | 46 | typedef struct 47 | { 48 | GObjectClass parent_class; 49 | 50 | } GSGrabClass; 51 | 52 | GType gs_grab_get_type (void); 53 | 54 | GSGrab * gs_grab_new (void); 55 | 56 | void gs_grab_release (GSGrab *grab, 57 | gboolean flush); 58 | 59 | gboolean gs_grab_grab_window (GSGrab *grab, 60 | GdkWindow *window, 61 | GdkDisplay *display, 62 | gboolean no_pointer_grab, 63 | gboolean hide_cursor); 64 | 65 | gboolean gs_grab_grab_root (GSGrab *grab, 66 | gboolean no_pointer_grab, 67 | gboolean hide_cursor); 68 | gboolean gs_grab_grab_offscreen (GSGrab *grab, 69 | gboolean no_pointer_grab, 70 | gboolean hide_cursor); 71 | 72 | void gs_grab_move_to_window (GSGrab *grab, 73 | GdkWindow *window, 74 | GdkDisplay *display, 75 | gboolean no_pointer_grab, 76 | gboolean hide_cursor); 77 | 78 | void gs_grab_reset (GSGrab *grab); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __GS_GRAB_H */ 83 | -------------------------------------------------------------------------------- /src/gs-lock-plug.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_LOCK_PLUG_H 24 | #define __GS_LOCK_PLUG_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef enum 31 | { 32 | GS_LOCK_PLUG_RESPONSE_NONE = -1, 33 | GS_LOCK_PLUG_RESPONSE_OK = -2, 34 | GS_LOCK_PLUG_RESPONSE_CANCEL = -3 35 | } GSPlugResponseType; 36 | 37 | #define GS_TYPE_LOCK_PLUG (gs_lock_plug_get_type ()) 38 | #define GS_LOCK_PLUG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_LOCK_PLUG, GSLockPlug)) 39 | #define GS_LOCK_PLUG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_LOCK_PLUG, GSLockPlugClass)) 40 | #define GS_IS_LOCK_PLUG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_LOCK_PLUG)) 41 | #define GS_IS_LOCK_PLUG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_LOCK_PLUG)) 42 | #define GS_LOCK_PLUG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_LOCK_PLUG, GSLockPlugClass)) 43 | 44 | typedef struct GSLockPlugPrivate GSLockPlugPrivate; 45 | 46 | typedef struct 47 | { 48 | GtkPlug parent; 49 | 50 | GSLockPlugPrivate *priv; 51 | } GSLockPlug; 52 | 53 | typedef struct 54 | { 55 | GtkPlugClass parent_class; 56 | 57 | void (* response) (GSLockPlug *plug, gint response_id); 58 | 59 | /* Keybinding signals */ 60 | void (* close) (GSLockPlug *plug); 61 | 62 | } GSLockPlugClass; 63 | 64 | GType gs_lock_plug_get_type (void); 65 | GtkWidget * gs_lock_plug_new (void); 66 | 67 | int gs_lock_plug_run (GSLockPlug *plug); 68 | void gs_lock_plug_set_sensitive (GSLockPlug *plug, 69 | gboolean sensitive); 70 | void gs_lock_plug_enable_prompt (GSLockPlug *plug, 71 | const char *message, 72 | gboolean visible); 73 | void gs_lock_plug_disable_prompt (GSLockPlug *plug); 74 | void gs_lock_plug_set_busy (GSLockPlug *plug); 75 | void gs_lock_plug_set_ready (GSLockPlug *plug); 76 | 77 | void gs_lock_plug_get_text (GSLockPlug *plug, 78 | char **text); 79 | void gs_lock_plug_show_message (GSLockPlug *plug, 80 | const char *message); 81 | 82 | G_END_DECLS 83 | 84 | #endif /* __GS_LOCK_PLUG_H */ 85 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | images 3 | 4 | NULL = 5 | 6 | man_MANS = \ 7 | xfce4-screensaver.1 \ 8 | xfce4-screensaver-command.1 \ 9 | xfce4-screensaver-preferences.1 \ 10 | $(NULL) 11 | 12 | @INTLTOOL_DESKTOP_RULE@ 13 | 14 | desktopdir = $(datadir)/applications 15 | desktop_in_files = xfce4-screensaver-preferences.desktop.in 16 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) 17 | 18 | @INTLTOOL_DIRECTORY_RULE@ 19 | 20 | directorydir = $(datadir)/desktop-directories 21 | directory_in_files = \ 22 | xfce4-screensaver.directory.in \ 23 | $(NULL) 24 | directory_DATA = $(directory_in_files:.directory.in=.directory) 25 | 26 | menudir = $(sysconfdir)/xdg/menus 27 | menu_DATA = \ 28 | xfce4-screensavers.menu \ 29 | $(NULL) 30 | 31 | gtkbuilderdir = $(pkgdatadir) 32 | gtkbuilder_DATA = \ 33 | xfce4-screensaver-preferences.ui \ 34 | lock-dialog-default.ui \ 35 | $(NULL) 36 | 37 | pkgconfigdir = $(libdir)/pkgconfig 38 | pkgconfig_DATA = xfce4-screensaver.pc 39 | 40 | dbussessionservicedir = $(DBUS_SESSION_SERVICE_DIR) 41 | dbussessionservice_DATA = org.xfce.ScreenSaver.service 42 | 43 | @INTLTOOL_XML_NOMERGE_RULE@ 44 | 45 | EXTRA_DIST = \ 46 | $(desktop_in_files) \ 47 | $(directory_in_files) \ 48 | $(gtkbuilder_DATA) \ 49 | $(man_MANS) \ 50 | xfce4-screensaver \ 51 | xfce4-screensaver.pc.in \ 52 | org.xfce.ScreenSaver.service.in\ 53 | xscreensaver-config.xsl \ 54 | migrate-xscreensaver-config.sh \ 55 | $(NULL) 56 | 57 | DISTCLEANFILES = \ 58 | $(desktop_DATA) \ 59 | $(directory_DATA) \ 60 | $(NULL) 61 | 62 | MAINTAINERCLEANFILES = \ 63 | *~ \ 64 | Makefile.in 65 | 66 | install-data-hook: 67 | @system=`uname`; \ 68 | if test -f /usr/include/security/pam_appl.h; then \ 69 | if test '!' -d $(DESTDIR)$(PAM_PREFIX)/pam.d; then \ 70 | $(mkinstalldirs) $(DESTDIR)$(PAM_PREFIX)/pam.d; \ 71 | chmod 755 $(DESTDIR)$(PAM_PREFIX)/pam.d; \ 72 | fi; \ 73 | if test $$system = Linux; then \ 74 | if test '!' -f $(DESTDIR)$(PAM_PREFIX)/pam.d/xfce4-screensaver; then \ 75 | $(INSTALL_DATA) xfce4-screensaver $(DESTDIR)$(PAM_PREFIX)/pam.d/xfce4-screensaver; \ 76 | fi; \ 77 | if test "x$(PAM_PREFIX)" != "x/etc/pam.d"; then \ 78 | echo "***" ; \ 79 | echo "*** Warning: xfce4-screensaver has been compiled with support for" ; \ 80 | echo "*** Pluggable Authentication Modules (PAM). However, you may need to" ; \ 81 | echo "*** manually install $(PAM_PREFIX)/pam.d/xfce4-screensaver" ; \ 82 | echo "*** to /etc/pam.d/xfce4-screensaver. Otherwise, unlocking might" ; \ 83 | echo "*** not work." ; \ 84 | echo "***" ; \ 85 | echo "*** Note: If you are using SuSE/Novell you may have to modify this file." ; \ 86 | echo "***" ; \ 87 | fi; \ 88 | fi; \ 89 | if test $$system = SunOS; then \ 90 | echo "***" ; \ 91 | echo "*** Warning: xfce4-screensaver has been compiled with support for" ; \ 92 | echo "*** Pluggable Authentication Modules (PAM). However, you" ; \ 93 | echo "*** need to manually add authentication for xfce4-screensaver in" ; \ 94 | echo "*** $(PAM_PREFIX)/pam.conf or /etc/pam.conf." ; \ 95 | echo "*** Otherwise, unlocking might not work." ; \ 96 | echo "***" ; \ 97 | fi; \ 98 | fi 99 | -------------------------------------------------------------------------------- /src/xfcekbd-desktop-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Sergey V. Udaltsov 3 | * Copyright (C) 2018 Sean Davis 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; see the file COPYING.LGPL. If not, 17 | * write to the Free Software Foundation, Inc., 51 Franklin St, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __XFCEKBD_DESKTOP_CONFIG_H__ 22 | #define __XFCEKBD_DESKTOP_CONFIG_H__ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | /* 32 | * General configuration 33 | */ 34 | typedef struct _XfcekbdDesktopConfig XfcekbdDesktopConfig; 35 | struct _XfcekbdDesktopConfig { 36 | gint default_group; 37 | gboolean group_per_app; 38 | gboolean handle_indicators; 39 | gboolean layout_names_as_group_names; 40 | gboolean load_extra_items; 41 | 42 | /* private, transient */ 43 | XfconfChannel *channel; 44 | int config_listener_id; 45 | XklEngine *engine; 46 | }; 47 | 48 | /* 49 | * XfcekbdDesktopConfig functions 50 | */ 51 | extern void xfcekbd_desktop_config_init (XfcekbdDesktopConfig *config, 52 | XklEngine *engine); 53 | extern void xfcekbd_desktop_config_term (XfcekbdDesktopConfig *config); 54 | 55 | extern void xfcekbd_desktop_config_load_from_xfconf (XfcekbdDesktopConfig *config); 56 | 57 | extern gboolean xfcekbd_desktop_config_activate (XfcekbdDesktopConfig *config); 58 | 59 | extern gboolean xfcekbd_desktop_config_load_group_descriptions (XfcekbdDesktopConfig *config, 60 | XklConfigRegistry *registry, 61 | const gchar **layout_ids, 62 | const gchar **variant_ids, 63 | gchar ***short_group_names, 64 | gchar ***full_group_names); 65 | 66 | extern void xfcekbd_desktop_config_lock_next_group (XfcekbdDesktopConfig *config); 67 | 68 | extern void xfcekbd_desktop_config_start_listen (XfcekbdDesktopConfig *config, 69 | GCallback func, 70 | gpointer user_data); 71 | 72 | extern void xfcekbd_desktop_config_stop_listen (XfcekbdDesktopConfig *config); 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /savers/Makefile.am: -------------------------------------------------------------------------------- 1 | ## We require new-style dependency handling. 2 | AUTOMAKE_OPTIONS = 1.7 3 | 4 | NULL = 5 | 6 | AM_CPPFLAGS = \ 7 | -I. \ 8 | -I$(srcdir) \ 9 | $(XFCE_SCREENSAVER_SAVER_CFLAGS) \ 10 | $(DISABLE_DEPRECATED_CFLAGS) \ 11 | -DLIBEXECDIR=\""$(libexecdir)"\" \ 12 | -DXFCELOCALEDIR=\""$(datadir)/locale"\" \ 13 | -DDATADIR=\""$(datadir)"\" \ 14 | $(WARN_CFLAGS) \ 15 | $(NULL) 16 | 17 | DESKTOP_IN_IN_FILES = \ 18 | xfce-floaters.desktop.in.in \ 19 | personal-slideshow.desktop.in.in \ 20 | popsquares.desktop.in.in \ 21 | $(NULL) 22 | 23 | xfce-floaters.desktop.in: xfce-floaters.desktop.in.in Makefile 24 | $(edit) $< >$@ 25 | personal-slideshow.desktop.in: personal-slideshow.desktop.in.in Makefile 26 | $(edit) $< >$@ 27 | popsquares.desktop.in: popsquares.desktop.in.in Makefile 28 | $(edit) $< >$@ 29 | 30 | @INTLTOOL_DESKTOP_RULE@ 31 | 32 | edit = sed \ 33 | -e 's|@FLOATERS_XFCE_IMAGE[@]|$(FLOATERS_XFCE_IMAGE)|g' \ 34 | -e 's|@SAVERDIR[@]|$(privlibexecdir)|g' 35 | 36 | themesdir = $(datadir)/applications/screensavers 37 | themes_in_files = \ 38 | xfce-floaters.desktop.in \ 39 | personal-slideshow.desktop.in \ 40 | popsquares.desktop.in \ 41 | $(NULL) 42 | themes_DATA = $(themes_in_files:.desktop.in=.desktop) 43 | 44 | BUILT_SOURCES = \ 45 | gs-theme-engine-marshal.c \ 46 | gs-theme-engine-marshal.h \ 47 | $(NULL) 48 | 49 | gs-theme-engine-marshal.c: gs-theme-engine-marshal.list 50 | echo "#include \"gs-theme-engine-marshal.h\"" > $@ && \ 51 | @GLIB_GENMARSHAL@ $< --prefix=gs_theme_engine_marshal --body >> $@ 52 | 53 | gs-theme-engine-marshal.h: gs-theme-engine-marshal.list 54 | @GLIB_GENMARSHAL@ $< --prefix=gs_theme_engine_marshal --header > $@ 55 | 56 | noinst_LIBRARIES = \ 57 | libgs-theme-engine.a 58 | 59 | libgs_theme_engine_a_CPPFLAGS = \ 60 | $(XFCE_SCREENSAVER_SAVER_CFLAGS) \ 61 | -DDATADIR=\""$(datadir)"\" \ 62 | $(NULL) 63 | 64 | libgs_theme_engine_a_SOURCES = \ 65 | $(BUILT_SOURCES) \ 66 | gs-theme-window.h \ 67 | gs-theme-window.c \ 68 | gs-theme-engine.c \ 69 | gs-theme-engine.h \ 70 | $(NULL) 71 | 72 | saverdir = $(libexecdir)/xfce4-screensaver 73 | saver_PROGRAMS = \ 74 | floaters \ 75 | popsquares \ 76 | slideshow \ 77 | $(NULL) 78 | 79 | floaters_SOURCES = \ 80 | floaters.c \ 81 | $(NULL) 82 | 83 | floaters_LDADD = \ 84 | libgs-theme-engine.a \ 85 | $(XFCE_SCREENSAVER_SAVER_LIBS) \ 86 | -lm \ 87 | $(NULL) 88 | 89 | popsquares_SOURCES = \ 90 | gste-popsquares.c \ 91 | gste-popsquares.h \ 92 | popsquares.c \ 93 | $(NULL) 94 | 95 | popsquares_LDADD = \ 96 | libgs-theme-engine.a \ 97 | $(XFCE_SCREENSAVER_SAVER_LIBS) \ 98 | $(NULL) 99 | 100 | slideshow_SOURCES = \ 101 | gste-slideshow.c \ 102 | gste-slideshow.h \ 103 | xdg-user-dir-lookup.c \ 104 | xdg-user-dir-lookup.h \ 105 | slideshow.c \ 106 | $(NULL) 107 | 108 | slideshow_LDADD = \ 109 | libgs-theme-engine.a \ 110 | $(XFCE_SCREENSAVER_SAVER_LIBS) \ 111 | $(NULL) 112 | 113 | EXTRA_DIST = \ 114 | gs-theme-engine-marshal.list \ 115 | $(DESKTOP_IN_IN_FILES) \ 116 | $(themes_in_files) \ 117 | $(NULL) 118 | 119 | CLEANFILES = \ 120 | $(BUILT_SOURCES) \ 121 | xfce-floaters.desktop.in \ 122 | popsquares.desktop.in \ 123 | personal-slideshow.desktop.in \ 124 | $(NULL) 125 | 126 | DISTCLEANFILES = \ 127 | $(themes_DATA) \ 128 | $(NULL) 129 | 130 | MAINTAINERCLEANFILES = \ 131 | *~ \ 132 | Makefile.in \ 133 | xfce-floaters.desktop \ 134 | personal-slideshow.desktop \ 135 | popsquares.desktop \ 136 | $(NULL) 137 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | ### mate-screensaver 1.20.0 2 | 3 | * Translations update 4 | * require GTK+ 3.22 and GLib 2.50 5 | * Add HiDPI support for lock screen 6 | * gs-lock-plug.c: Fix build warning: 7 | 8 | ### mate-screensaver 1.19.1 9 | 10 | * Translations update 11 | * WidthOfScreen and HeightOfScreen implementation 12 | * restore the correct mate-screensaver-command manpage 13 | * fix loop initial declarations 14 | 15 | ### mate-screensaver 1.19.0 16 | 17 | * Translations update 18 | * Fix: idle slider display in all languages 19 | * drop glib required max version 20 | * avoid deprecated gdk_screen_get_width/height 21 | * don't use deprecated gtk_show_uri 22 | * Restore Polish translation credits from GNOME 23 | * Implement OpenBSD authentication using bsd_auth(3). 24 | * Bug Fix: g_get_real_name will never return NULL pointer 25 | * lock-dialog UI: avoid deprecated widgets 26 | * Bug fix: screensaver and lock screen not correctly displayed 27 | in configurations with overlapping monitor geometries 28 | * [GTK+3.20] Switch to GdkSeat 29 | * Set input purpose for the password entry widget 30 | * copy theme dialog: fix build warning about wrong variable type 31 | 32 | ### mate-screensaver 1.18.0 33 | 34 | * NEWS: use consistent, project wide, markdown-like formatting to make 35 | generating release announcements easier 36 | * Build: require libmate-menu >= 1.10 37 | * Build: require libxfcekbd and libmate-desktop >= 1.17 38 | * Move to GTK+3 (require GTK+ >= 3.14), drop GTK+2 code and --with-gtk 39 | build option 40 | * Lock screen: load user's background instead of system one 41 | * Preferences: fix some GTK+ deprecations 42 | * Translations update 43 | 44 | ### mate-screensaver 1.16.1 45 | 46 | * Fix build breakage with GTK+ 3.14 47 | * Fix "Blank screen" theme with GTK+ 3.22 48 | * GTK+2: fix switching to "Blank screen" theme in fullscreen preview 49 | * Properly restore password dialog position after wrong password attempt 50 | * Check for gdm-binary process when switching user 51 | 52 | ### mate-screensaver 1.16.0 53 | 54 | * Fix locking when screensaver is already active 55 | * GTK+3: fix background and locking in multi-monitor setup 56 | * GTK+3: fix several deprecations 57 | * Some more fixes and cleanups 58 | * Translations update 59 | * Make distcheck use currently selected GTK+ version 60 | 61 | ### mate-screensaver 1.14.1 62 | 63 | * Translations update 64 | * GTK+-3: fix assertion 'GTK_IS_WIDGET (widget)' failed 65 | * GTK+-3: add style class lock-dialog 66 | 67 | ### mate-screensaver 1.14.0 68 | 69 | * Drop MateConf migration script 70 | * GTK+3: fix several deprecations 71 | * Some more fixes and cleanups 72 | * Translations update 73 | * Add Changelog generation 74 | 75 | ### mate-screensaver 1.12.0 76 | 77 | * Retrieve strings directly from gschema (requires intltool 0.50.1) 78 | * Switch to org.gnome.SessionManager 79 | * Add support for libsystemd (in addition to libsystemd-login) 80 | * Don't fade to black when locking the screen 81 | * Fix systemd event handling 82 | * Some more fixes and cleanups 83 | 84 | ### mate-screensaver 1.10.2 85 | 86 | * Fix segfault due to wrong object being destroyed 87 | * Translations update 88 | 89 | ### mate-screensaver 1.10.1 90 | 91 | * Check for running display manager when user switching 92 | 93 | ### mate-screensaver 1.10.0 94 | 95 | * Update to api changes for XfceRR* in mate-desktop (thanks monsta for testing) 96 | 97 | ### mate-screensaver 1.8.0 98 | 99 | * Show date and time in lock dialog. 100 | * Add theme to use GNOME foot logo as floaters screensaver 101 | * Rename Floating Feet as Floating MATE 102 | * Add GTK3 support 103 | 104 | ### mate-screensaver 1.1.0 105 | 106 | * First MATE release. 107 | -------------------------------------------------------------------------------- /src/test-fade.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | * Authors: William Jon McCann 21 | * 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "gs-fade.h" 39 | #include "gs-debug.h" 40 | 41 | #ifdef HAVE_XF86VMODE_GAMMA 42 | # include 43 | #endif 44 | 45 | #define XF86_VIDMODE_NAME "XFree86-VidModeExtension" 46 | 47 | static void 48 | test_fade (void) 49 | { 50 | GSFade *fade; 51 | int reps = 2; 52 | int delay = 2; 53 | 54 | fade = gs_fade_new (); 55 | 56 | while (reps-- > 0) 57 | { 58 | g_print ("fading out..."); 59 | gs_fade_sync (fade, 1000); 60 | g_print ("done.\n"); 61 | 62 | g_print ("fading in..."); 63 | gs_fade_reset (fade); 64 | g_print ("done.\n"); 65 | 66 | if (delay) 67 | { 68 | sleep (delay); 69 | } 70 | } 71 | 72 | g_object_unref (fade); 73 | } 74 | 75 | int 76 | main (int argc, 77 | char **argv) 78 | { 79 | GError *error = NULL; 80 | int op, event, err; 81 | 82 | #ifdef ENABLE_NLS 83 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 84 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET 85 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 86 | # endif 87 | textdomain (GETTEXT_PACKAGE); 88 | #endif 89 | 90 | if (error) 91 | { 92 | fprintf (stderr, "%s\n", error->message); 93 | exit (1); 94 | } 95 | 96 | if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 97 | { 98 | fprintf (stderr, "%s", error->message); 99 | g_error_free (error); 100 | exit (1); 101 | } 102 | 103 | if (! XQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XF86_VIDMODE_NAME, &op, &event, &err)) 104 | { 105 | g_message ("no " XF86_VIDMODE_NAME " extension"); 106 | } 107 | else 108 | { 109 | # ifdef HAVE_XF86VMODE_GAMMA 110 | int major; 111 | int minor; 112 | 113 | if (! XF86VidModeQueryVersion (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &major, &minor)) 114 | { 115 | g_message ("unable to get " XF86_VIDMODE_NAME " version"); 116 | } 117 | else 118 | { 119 | g_message (XF86_VIDMODE_NAME " version %d.%d", major, minor); 120 | } 121 | # else /* !HAVE_XF86VMODE_GAMMA */ 122 | g_message ("no support for display's " XF86_VIDMODE_NAME " extension"); 123 | # endif /* !HAVE_XF86VMODE_GAMMA */ 124 | } 125 | 126 | gs_debug_init (TRUE, FALSE); 127 | 128 | test_fade (); 129 | 130 | gs_debug_shutdown (); 131 | 132 | return 0; 133 | } 134 | -------------------------------------------------------------------------------- /savers/gs-theme-engine.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_THEME_ENGINE_H 24 | #define __GS_THEME_ENGINE_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GS_TYPE_THEME_ENGINE (gs_theme_engine_get_type ()) 32 | #define GS_THEME_ENGINE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_THEME_ENGINE, GSThemeEngine)) 33 | #define GS_THEME_ENGINE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_THEME_ENGINE, GSThemeEngineClass)) 34 | #define GS_IS_THEME_ENGINE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_THEME_ENGINE)) 35 | #define GS_IS_THEME_ENGINE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_THEME_ENGINE)) 36 | #define GS_THEME_ENGINE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_THEME_ENGINE, GSThemeEngineClass)) 37 | 38 | typedef struct GSThemeEnginePrivate GSThemeEnginePrivate; 39 | 40 | typedef struct 41 | { 42 | GtkDrawingArea parent; 43 | GSThemeEnginePrivate *priv; 44 | } GSThemeEngine; 45 | 46 | typedef struct 47 | { 48 | GtkDrawingAreaClass parent_class; 49 | 50 | /* for signals later if needed */ 51 | gpointer reserved_1; 52 | gpointer reserved_2; 53 | gpointer reserved_3; 54 | gpointer reserved_4; 55 | } GSThemeEngineClass; 56 | 57 | GType gs_theme_engine_get_type (void); 58 | 59 | void gs_theme_engine_get_window_size (GSThemeEngine *engine, 60 | int *width, 61 | int *height); 62 | GdkWindow *gs_theme_engine_get_window (GSThemeEngine *engine); 63 | 64 | #define ENABLE_PROFILING 1 65 | #ifdef ENABLE_PROFILING 66 | #ifdef G_HAVE_ISO_VARARGS 67 | #define gs_theme_engine_profile_start(...) _gs_theme_engine_profile_log (G_STRFUNC, "start", __VA_ARGS__) 68 | #define gs_theme_engine_profile_end(...) _gs_theme_engine_profile_log (G_STRFUNC, "end", __VA_ARGS__) 69 | #define gs_theme_engine_profile_msg(...) _gs_theme_engine_profile_log (NULL, NULL, __VA_ARGS__) 70 | #elif defined(G_HAVE_GNUC_VARARGS) 71 | #define gs_theme_engine_profile_start(format...) _gs_theme_engine_profile_log (G_STRFUNC, "start", format) 72 | #define gs_theme_engine_profile_end(format...) _gs_theme_engine_profile_log (G_STRFUNC, "end", format) 73 | #define gs_theme_engine_profile_msg(format...) _gs_theme_engine_profile_log (NULL, NULL, format) 74 | #endif 75 | #else 76 | #define gs_theme_engine_profile_start(...) 77 | #define gs_theme_engine_profile_end(...) 78 | #define gs_theme_engine_profile_msg(...) 79 | #endif 80 | 81 | void _gs_theme_engine_profile_log (const char *func, 82 | const char *note, 83 | const char *format, 84 | ...) G_GNUC_PRINTF (3, 4); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* __GS_THEME_ENGINE_H */ 89 | -------------------------------------------------------------------------------- /src/gs-listener-dbus.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_LISTENER_H 24 | #define __GS_LISTENER_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_LISTENER (gs_listener_get_type ()) 31 | #define GS_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_LISTENER, GSListener)) 32 | #define GS_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_LISTENER, GSListenerClass)) 33 | #define GS_IS_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_LISTENER)) 34 | #define GS_IS_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_LISTENER)) 35 | #define GS_LISTENER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_LISTENER, GSListenerClass)) 36 | 37 | typedef struct GSListenerPrivate GSListenerPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSListenerPrivate *priv; 43 | } GSListener; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | 49 | void (* lock) (GSListener *listener); 50 | void (* cycle) (GSListener *listener); 51 | void (* quit) (GSListener *listener); 52 | void (* simulate_user_activity) (GSListener *listener); 53 | gboolean (* active_changed) (GSListener *listener, 54 | gboolean active); 55 | void (* throttle_changed) (GSListener *listener, 56 | gboolean throttled); 57 | void (* show_message) (GSListener *listener, 58 | const char *summary, 59 | const char *body, 60 | const char *icon); 61 | 62 | } GSListenerClass; 63 | 64 | typedef enum 65 | { 66 | GS_LISTENER_ERROR_SERVICE_UNAVAILABLE, 67 | GS_LISTENER_ERROR_ACQUISITION_FAILURE, 68 | GS_LISTENER_ERROR_ACTIVATION_FAILURE 69 | } GSListenerError; 70 | 71 | #define GS_LISTENER_ERROR gs_listener_error_quark () 72 | 73 | GQuark gs_listener_error_quark (void); 74 | 75 | GType gs_listener_get_type (void); 76 | 77 | GSListener *gs_listener_new (void); 78 | gboolean gs_listener_acquire (GSListener *listener, 79 | GError **error); 80 | gboolean gs_listener_set_active (GSListener *listener, 81 | gboolean active); 82 | gboolean gs_listener_set_session_idle (GSListener *listener, 83 | gboolean idle); 84 | void gs_listener_set_activation_enabled (GSListener *listener, 85 | gboolean enabled); 86 | gboolean gs_listener_get_activation_enabled (GSListener *listener); 87 | gboolean gs_listener_is_inhibited (GSListener *listener); 88 | 89 | G_END_DECLS 90 | 91 | #endif /* __GS_LISTENER_H */ 92 | -------------------------------------------------------------------------------- /src/gs-visual-gl.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2018 Sean Davis 4 | * Copyright (C) 2006 William Jon McCann 5 | * Copyright (C) 1999, 2000, 2003 Jamie Zawinski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License as 9 | * published by the Free Software Foundation; either version 2 of the 10 | * License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 20 | * 02110-1301, USA. 21 | * 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #ifdef HAVE_LIBGL 34 | #include 35 | #include 36 | #endif /* HAVE_GL */ 37 | 38 | #include "gs-visual-gl.h" 39 | #include "gs-debug.h" 40 | 41 | GdkVisual * 42 | gs_visual_gl_get_best_for_display (GdkDisplay *display) 43 | { 44 | GdkVisual *visual; 45 | #ifdef HAVE_LIBGL 46 | Display *xdisplay; 47 | GdkScreen *screen; 48 | int screen_num; 49 | int i; 50 | 51 | # define R GLX_RED_SIZE 52 | # define G GLX_GREEN_SIZE 53 | # define B GLX_BLUE_SIZE 54 | # define D GLX_DEPTH_SIZE 55 | # define I GLX_BUFFER_SIZE 56 | # define DB GLX_DOUBLEBUFFER 57 | # define ST GLX_STENCIL_SIZE 58 | 59 | static int attrs [][20] = 60 | { 61 | { GLX_RGBA, R, 8, G, 8, B, 8, D, 8, DB, ST,1, 0 }, /* rgb double, stencil */ 62 | { GLX_RGBA, R, 4, G, 4, B, 4, D, 4, DB, ST,1, 0 }, 63 | { GLX_RGBA, R, 2, G, 2, B, 2, D, 2, DB, ST,1, 0 }, 64 | { GLX_RGBA, R, 8, G, 8, B, 8, D, 8, DB, 0 }, /* rgb double */ 65 | { GLX_RGBA, R, 4, G, 4, B, 4, D, 4, DB, 0 }, 66 | { GLX_RGBA, R, 2, G, 2, B, 2, D, 2, DB, 0 }, 67 | { GLX_RGBA, R, 8, G, 8, B, 8, D, 8, 0 }, /* rgb single */ 68 | { GLX_RGBA, R, 4, G, 4, B, 4, D, 4, 0 }, 69 | { GLX_RGBA, R, 2, G, 2, B, 2, D, 2, 0 }, 70 | { I, 8, D, 8, DB, 0 }, /* cmap double */ 71 | { I, 4, D, 4, DB, 0 }, 72 | { I, 8, D, 8, 0 }, /* cmap single */ 73 | { I, 4, D, 4, 0 }, 74 | { GLX_RGBA, R, 1, G, 1, B, 1, D, 1, 0 } /* monochrome */ 75 | }; 76 | 77 | g_return_val_if_fail (display != NULL, NULL); 78 | 79 | xdisplay = GDK_DISPLAY_XDISPLAY (display); 80 | screen = gdk_display_get_default_screen (display); 81 | screen_num = GDK_SCREEN_XNUMBER (screen); 82 | 83 | gdk_x11_display_error_trap_push (display); 84 | 85 | visual = NULL; 86 | for (i = 0; i < G_N_ELEMENTS (attrs); i++) 87 | { 88 | XVisualInfo *vi; 89 | 90 | vi = glXChooseVisual (xdisplay, screen_num, attrs [i]); 91 | 92 | if (vi != NULL) 93 | { 94 | VisualID vid; 95 | 96 | vid = XVisualIDFromVisual (vi->visual); 97 | 98 | visual = gdk_x11_screen_lookup_visual (screen, vid); 99 | 100 | XFree (vi); 101 | 102 | if (visual != NULL) 103 | { 104 | break; 105 | } 106 | } 107 | } 108 | 109 | gdk_x11_display_error_trap_pop_ignored (display); 110 | #else 111 | visual = NULL; 112 | #endif /* HAVE_LIBGL */ 113 | 114 | return visual; 115 | } 116 | -------------------------------------------------------------------------------- /src/xfce4-screensaver.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * Copyright (C) 2004-2006 William Jon McCann 4 | * Copyright (C) 2018 Sean Davis 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of the 9 | * License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | * Authors: William Jon McCann 22 | * 23 | */ 24 | 25 | #include "config.h" 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #include "xfce4-screensaver.h" 38 | #include "gs-monitor.h" 39 | #include "gs-debug.h" 40 | 41 | #include 42 | 43 | void xfce4_screensaver_quit(void) 44 | { 45 | gtk_main_quit(); 46 | } 47 | 48 | int main(int argc, 49 | char **argv) 50 | { 51 | GSMonitor *monitor; 52 | GError *error = NULL; 53 | 54 | static gboolean show_version = FALSE; 55 | static gboolean no_daemon = TRUE; 56 | static gboolean debug = FALSE; 57 | 58 | static GOptionEntry entries[] = { 59 | {"version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Version of this application"), NULL}, 60 | {"no-daemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Don't become a daemon"), NULL}, 61 | {"debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL}, 62 | {NULL} 63 | }; 64 | 65 | #ifdef ENABLE_NLS 66 | bindtextdomain(GETTEXT_PACKAGE, XFCELOCALEDIR); 67 | #ifdef HAVE_BIND_TEXTDOMAIN_CODESET 68 | bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); 69 | #endif 70 | textdomain(GETTEXT_PACKAGE); 71 | #endif 72 | 73 | if (!gtk_init_with_args(&argc, &argv, NULL, entries, NULL, &error)) 74 | { 75 | if (error) 76 | { 77 | g_warning("%s", error->message); 78 | g_error_free(error); 79 | } 80 | else 81 | { 82 | g_warning("Unable to initialize GTK+"); 83 | } 84 | 85 | exit(1); 86 | } 87 | 88 | if (show_version) 89 | { 90 | g_print("%s %s\n", argv[0], VERSION); 91 | exit(1); 92 | } 93 | 94 | if (!xfconf_init(&error)) 95 | { 96 | g_error("Failed to connect to xfconf daemon: %s.", error->message); 97 | g_error_free(error); 98 | 99 | return EXIT_FAILURE; 100 | } 101 | 102 | /* debug to a file if in deamon mode */ 103 | gs_debug_init(debug, FALSE); 104 | gs_debug("initializing xfce4-screensaver %s", VERSION); 105 | 106 | monitor = gs_monitor_new(); 107 | 108 | if (monitor == NULL) 109 | { 110 | exit (1); 111 | } 112 | 113 | error = NULL; 114 | 115 | if (!gs_monitor_start(monitor, &error)) 116 | { 117 | if (error) 118 | { 119 | g_warning("%s", error->message); 120 | g_error_free(error); 121 | } 122 | else 123 | { 124 | g_warning("Unable to start screensaver"); 125 | } 126 | 127 | exit(1); 128 | } 129 | 130 | gtk_main(); 131 | 132 | g_object_unref(monitor); 133 | 134 | gs_debug("xfce4-screensaver finished"); 135 | 136 | gs_debug_shutdown(); 137 | 138 | return 0; 139 | } 140 | -------------------------------------------------------------------------------- /src/xfcekbd-config-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Sergey V. Udaltsov 3 | * Copyright (C) 2018 Sean Davis 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; see the file COPYING.LGPL. If not, 17 | * write to the Free Software Foundation, Inc., 51 Franklin St, 18 | * Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __XFCEKBD_CONFIG_PRIVATE_H__ 22 | #define __XFCEKBD_CONFIG_PRIVATE_H__ 23 | 24 | #include "xfcekbd-desktop-config.h" 25 | #include "xfcekbd-keyboard-config.h" 26 | 27 | #define SETTINGS_XFCONF_CHANNEL "xfce4-screensaver" 28 | 29 | /** 30 | * KBD/General: Default group, assigned on window creation 31 | */ 32 | #define KEY_KBD_DEFAULT_GROUP "/kbd/general/default-group" 33 | #define DEFAULT_KEY_KBD_DEFAULT_GROUP -1 34 | 35 | /** 36 | * KBD/General: Keep and manage separate group per window 37 | */ 38 | #define KEY_KBD_GROUP_PER_WINDOW "/kbd/general/group-per-window" 39 | #define DEFAULT_KEY_KBD_GROUP_PER_WINDOW TRUE 40 | 41 | /** 42 | * KBD/General: Save/restore indicators together with layout groups 43 | */ 44 | #define KEY_KBD_HANDLE_INDICATORS "/kbd/general/handle-indicators" 45 | #define DEFAULT_KEY_KBD_HANDLE_INDICATORS FALSE 46 | 47 | /** 48 | * KBD/General: Show layout names instead of group names 49 | * Only for versions of XFree supporting multiple layouts 50 | */ 51 | #define KEY_KBD_LAYOUT_NAMES_AS_GROUP_NAMES "/kbd/general/layout-names-as-group-names" 52 | #define DEFAULT_KEY_KBD_LAYOUT_NAMES_AS_GROUP_NAMES TRUE 53 | 54 | /** 55 | * KBD/General: Load extra configuration items 56 | * Load exotic, rarely used layouts and options 57 | */ 58 | #define KEY_KBD_LOAD_EXTRA_ITEMS "/kbd/general/load-extra-items" 59 | #define DEFAULT_KEY_KBD_LOAD_EXTRA_ITEMS FALSE 60 | 61 | /** 62 | * KBD/Indicator: Show flags instead of language code 63 | */ 64 | #define KEY_KBD_INDICATOR_SHOW_FLAGS "/kbd/indicator/show-flags" 65 | #define DEFAULT_KEY_KBD_INDICATOR_SHOW_FLAGS FALSE 66 | 67 | /** 68 | * KBD/Indicator: Secondary groups 69 | */ 70 | #define KEY_KBD_INDICATOR_SECONDARIES "/kbd/indicator/secondary" 71 | #define DEFAULT_KEY_KBD_INDICATOR_SECONDARIES 0 72 | 73 | /** 74 | * KBD/Indicator: The font 75 | * The font for the layout indicator. This should be in 76 | * "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]" format. 77 | */ 78 | #define KEY_KBD_INDICATOR_FONT_FAMILY "/kbd/indicator/font-family" 79 | #define DEFAULT_KEY_KBD_INDICATOR_FONT_FAMILY "" 80 | 81 | /** 82 | * KBD/Indicator: The foreground color 83 | * The foreground color for the layout indicator. 84 | * This should be in "R G B" format, for example "255 0 0". 85 | */ 86 | #define KEY_KBD_INDICATOR_FOREGROUND_COLOR "/kbd/indicator/foreground-color" 87 | #define DEFAULT_KEY_KBD_INDICATOR_FOREGROUND_COLOR "" 88 | 89 | /** 90 | * KBD/Indicator: The background color 91 | * The background color for the layout indicator. 92 | * This should be in "R G B" format, for example "255 0 0". 93 | */ 94 | #define KEY_KBD_INDICATOR_BACKGROUND_COLOR "/kbd/indicator/background-color" 95 | #define DEFAULT_KEY_KBD_INDICATOR_BACKGROUND_COLOR "" 96 | 97 | /** 98 | * General config functions (private) 99 | */ 100 | extern void xfcekbd_keyboard_config_model_set (XfcekbdKeyboardConfig *kbd_config, 101 | const gchar *model_name); 102 | 103 | extern void xfcekbd_keyboard_config_options_set (XfcekbdKeyboardConfig *kbd_config, 104 | gint idx, 105 | const gchar *group_name, 106 | const gchar *option_name); 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /src/xfce-bg.h: -------------------------------------------------------------------------------- 1 | /* xfce-bg.h - 2 | 3 | Copyright (C) 2007 Red Hat, Inc. 4 | Copyright (C) 2012 Jasmine Hassan 5 | Copyright (C) 2018 Sean Davis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public 18 | License along with this library; see the file COPYING.LIB. If not, 19 | write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 | Boston, MA 02110-1301, USA. 21 | 22 | Authors: Soren Sandmann 23 | Jasmine Hassan 24 | */ 25 | 26 | #ifndef __XFCE_BG_H__ 27 | #define __XFCE_BG_H__ 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define XFCE_TYPE_BG (xfce_bg_get_type ()) 36 | #define XFCE_BG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_BG, XfceBG)) 37 | #define XFCE_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_BG, XfceBGClass)) 38 | #define XFCE_IS_BG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_BG)) 39 | #define XFCE_IS_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_BG)) 40 | #define XFCE_BG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_BG, XfceBGClass)) 41 | 42 | /* whether to draw the desktop bg */ 43 | #define XFCE_BG_KEY_DRAW_BACKGROUND "draw-background" 44 | 45 | /* whether Thunar or xfce-settings-daemon draw the desktop */ 46 | #define XFCE_BG_KEY_SHOW_DESKTOP "show-desktop-icons" 47 | 48 | /* whether to fade when changing background (By Thunar/m-s-d) */ 49 | #define XFCE_BG_KEY_BACKGROUND_FADE "background-fade" 50 | 51 | #define XFCE_BG_KEY_PRIMARY_COLOR "primary-color" 52 | #define XFCE_BG_KEY_SECONDARY_COLOR "secondary-color" 53 | #define XFCE_BG_KEY_COLOR_TYPE "color-shading-type" 54 | #define XFCE_BG_KEY_PICTURE_PLACEMENT "picture-options" 55 | #define XFCE_BG_KEY_PICTURE_OPACITY "picture-opacity" 56 | #define XFCE_BG_KEY_PICTURE_FILENAME "picture-filename" 57 | 58 | typedef struct _XfceBG XfceBG; 59 | typedef struct _XfceBGClass XfceBGClass; 60 | 61 | typedef enum { 62 | XFCE_BG_COLOR_SOLID, 63 | XFCE_BG_COLOR_H_GRADIENT, 64 | XFCE_BG_COLOR_V_GRADIENT, 65 | XFCE_BG_COLOR_TRANSPARENT 66 | } XfceBGColorType; 67 | 68 | typedef enum { 69 | XFCE_BG_PLACEMENT_NONE, 70 | XFCE_BG_PLACEMENT_CENTERED, 71 | XFCE_BG_PLACEMENT_TILED, 72 | XFCE_BG_PLACEMENT_FILL_SCREEN, 73 | XFCE_BG_PLACEMENT_SCALED, 74 | XFCE_BG_PLACEMENT_ZOOMED, 75 | XFCE_BG_PLACEMENT_SPANNED 76 | } XfceBGPlacement; 77 | 78 | GType xfce_bg_get_type (void); 79 | XfceBG * xfce_bg_new (void); 80 | void xfce_bg_load_from_preferences (XfceBG *bg, 81 | GdkMonitor *monitor); 82 | 83 | /* Drawing and thumbnailing */ 84 | cairo_surface_t * xfce_bg_create_surface (XfceBG *bg, 85 | GdkWindow *window, 86 | int screen_width, 87 | int screen_height, 88 | int monitor_width, 89 | int monitor_height); 90 | 91 | GdkPixbuf * xfce_bg_get_pixbuf (XfceBG *bg, 92 | int screen_width, 93 | int screen_height, 94 | int monitor_width, 95 | int monitor_height); 96 | 97 | G_END_DECLS 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /src/gs-debug.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | #include "gs-debug.h" 36 | 37 | static gboolean debugging = FALSE; 38 | static FILE *debug_out = NULL; 39 | 40 | /* Based on rhythmbox/lib/rb-debug.c */ 41 | /* Our own funky debugging function, should only be used when something 42 | * is not going wrong, if something *is* wrong use g_warning. 43 | */ 44 | void 45 | gs_debug_real (const char *func, 46 | const char *file, 47 | const int line, 48 | const char *format, ...) 49 | { 50 | va_list args; 51 | char buffer [1025]; 52 | char *str_time; 53 | time_t the_time; 54 | 55 | if (debugging == FALSE) 56 | return; 57 | 58 | va_start (args, format); 59 | 60 | g_vsnprintf (buffer, 1024, format, args); 61 | 62 | va_end (args); 63 | 64 | time (&the_time); 65 | str_time = g_new0 (char, 255); 66 | strftime (str_time, 254, "%H:%M:%S", localtime (&the_time)); 67 | 68 | fprintf ((debug_out ? debug_out : stderr), 69 | "[%s] %s:%d (%s):\t %s\n", 70 | func, file, line, str_time, buffer); 71 | 72 | if (debug_out) 73 | fflush (debug_out); 74 | 75 | g_free (str_time); 76 | } 77 | 78 | gboolean 79 | gs_debug_enabled (void) 80 | { 81 | return debugging; 82 | } 83 | 84 | void 85 | gs_debug_init (gboolean debug, 86 | gboolean to_file) 87 | { 88 | /* return if already initialized */ 89 | if (debugging == TRUE) 90 | { 91 | return; 92 | } 93 | 94 | debugging = debug; 95 | 96 | if (debug && to_file) 97 | { 98 | const char path [50] = "xfce4_screensaver_debug_XXXXXX"; 99 | int fd; 100 | 101 | fd = g_file_open_tmp (path, NULL, NULL); 102 | 103 | if (fd >= 0) 104 | { 105 | debug_out = fdopen (fd, "a"); 106 | } 107 | } 108 | 109 | gs_debug ("Debugging %s", (debug) ? "enabled" : "disabled"); 110 | } 111 | 112 | void 113 | gs_debug_shutdown (void) 114 | { 115 | if (! debugging) 116 | return; 117 | 118 | gs_debug ("Shutting down debugging"); 119 | 120 | debugging = FALSE; 121 | 122 | if (debug_out != NULL) 123 | { 124 | fclose (debug_out); 125 | debug_out = NULL; 126 | } 127 | } 128 | 129 | void 130 | _gs_profile_log (const char *func, 131 | const char *note, 132 | const char *format, 133 | ...) 134 | { 135 | va_list args; 136 | char *str; 137 | char *formatted; 138 | 139 | if (format == NULL) 140 | { 141 | formatted = g_strdup (""); 142 | } 143 | else 144 | { 145 | va_start (args, format); 146 | formatted = g_strdup_vprintf (format, args); 147 | va_end (args); 148 | } 149 | 150 | if (func != NULL) 151 | { 152 | str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted); 153 | } 154 | else 155 | { 156 | str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted); 157 | } 158 | 159 | g_free (formatted); 160 | 161 | g_access (str, F_OK); 162 | g_free (str); 163 | } 164 | -------------------------------------------------------------------------------- /savers/slideshow.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include "gs-theme-window.h" 35 | #include "gs-theme-engine.h" 36 | #include "gste-slideshow.h" 37 | 38 | #include "xdg-user-dir-lookup.h" 39 | 40 | int 41 | main (int argc, char **argv) 42 | { 43 | GSThemeEngine *engine; 44 | GtkWidget *window; 45 | GError *error; 46 | gboolean ret; 47 | char *location = NULL; 48 | char *background_color = NULL; 49 | gboolean sort_images = FALSE; 50 | gboolean no_stretch = FALSE; 51 | GOptionEntry entries [] = 52 | { 53 | { 54 | "location", 0, 0, G_OPTION_ARG_STRING, &location, 55 | N_("Location to get images from"), N_("PATH") 56 | }, 57 | { 58 | "background-color", 0, 0, G_OPTION_ARG_STRING, &background_color, 59 | N_("Color to use for images background"), N_("\"#rrggbb\"") 60 | }, 61 | { 62 | "sort-images", 0, 0, G_OPTION_ARG_NONE, &sort_images, 63 | N_("Do not randomize pictures from location"), NULL 64 | }, 65 | { 66 | "no-stretch", 0, 0, G_OPTION_ARG_NONE, &no_stretch, 67 | N_("Do not try to stretch images on screen"), NULL 68 | }, 69 | { NULL } 70 | }; 71 | 72 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 73 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 74 | textdomain (GETTEXT_PACKAGE); 75 | 76 | error = NULL; 77 | 78 | ret = gtk_init_with_args (&argc, &argv, 79 | NULL, 80 | entries, 81 | NULL, 82 | &error); 83 | if (! ret) 84 | { 85 | g_message ("%s", error->message); 86 | g_error_free (error); 87 | exit (1); 88 | } 89 | 90 | g_chdir (g_get_home_dir ()); 91 | 92 | g_set_prgname ("slideshow"); 93 | 94 | window = gs_theme_window_new (); 95 | g_signal_connect (G_OBJECT (window), "delete-event", 96 | G_CALLBACK (gtk_main_quit), NULL); 97 | 98 | engine = g_object_new (GSTE_TYPE_SLIDESHOW, NULL); 99 | 100 | if (location == NULL) 101 | { 102 | location = xdg_user_dir_lookup ("PICTURES"); 103 | if (location == NULL || 104 | strcmp (location, "/tmp") == 0 || 105 | strcmp (location, g_get_home_dir ()) == 0) 106 | { 107 | free (location); 108 | location = g_build_filename (g_get_home_dir (), "Pictures", NULL); 109 | } 110 | } 111 | 112 | if (location != NULL) 113 | { 114 | g_object_set (engine, "images-location", location, NULL); 115 | } 116 | 117 | if (sort_images) 118 | { 119 | g_object_set (engine, "sort-images", sort_images, NULL); 120 | } 121 | 122 | if (background_color != NULL) 123 | { 124 | g_object_set (engine, "background-color", background_color, NULL); 125 | } 126 | 127 | if (no_stretch) 128 | { 129 | g_object_set (engine, "no-stretch", no_stretch, NULL); 130 | } 131 | 132 | gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (engine)); 133 | 134 | gtk_widget_show (GTK_WIDGET (engine)); 135 | 136 | gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); 137 | gtk_widget_show (window); 138 | 139 | gtk_main (); 140 | 141 | return 0; 142 | } 143 | -------------------------------------------------------------------------------- /src/subprocs.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * subprocs.c --- choosing, spawning, and killing screenhacks. 4 | * 5 | * xscreensaver, Copyright (c) 1991-2003 Jamie Zawinski 6 | * Modified: Copyright (c) 2004 William Jon McCann 7 | * 8 | * Permission to use, copy, modify, distribute, and sell this software and its 9 | * documentation for any purpose is hereby granted without fee, provided that 10 | * the above copyright notice appear in all copies and that both that 11 | * copyright notice and this permission notice appear in supporting 12 | * documentation. No representations are made about the suitability of this 13 | * software for any purpose. It is provided "as is" without express or 14 | * implied warranty. 15 | */ 16 | 17 | #include "config.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef ESRCH 25 | # include 26 | #endif 27 | 28 | #include /* sys/resource.h needs this for timeval */ 29 | # include /* for waitpid() and associated macros */ 30 | 31 | #ifdef VMS 32 | # include 33 | # include /* for close */ 34 | # include /* for getpid */ 35 | # define pid_t int 36 | # define fork vfork 37 | #endif /* VMS */ 38 | 39 | #include /* for the signal names */ 40 | 41 | #include 42 | #include "subprocs.h" 43 | 44 | #if !defined(SIGCHLD) && defined(SIGCLD) 45 | # define SIGCHLD SIGCLD 46 | #endif 47 | 48 | /* Semaphore to temporarily turn the SIGCHLD handler into a no-op. 49 | Don't alter this directly -- use block_sigchld() / unblock_sigchld(). 50 | */ 51 | static int block_sigchld_handler = 0; 52 | 53 | 54 | #ifdef HAVE_SIGACTION 55 | sigset_t 56 | #else /* !HAVE_SIGACTION */ 57 | int 58 | #endif /* !HAVE_SIGACTION */ 59 | block_sigchld (void) 60 | { 61 | #ifdef HAVE_SIGACTION 62 | sigset_t child_set; 63 | sigemptyset (&child_set); 64 | sigaddset (&child_set, SIGCHLD); 65 | sigaddset (&child_set, SIGPIPE); 66 | sigprocmask (SIG_BLOCK, &child_set, 0); 67 | #endif /* HAVE_SIGACTION */ 68 | 69 | block_sigchld_handler++; 70 | 71 | #ifdef HAVE_SIGACTION 72 | return child_set; 73 | #else /* !HAVE_SIGACTION */ 74 | return 0; 75 | #endif /* !HAVE_SIGACTION */ 76 | } 77 | 78 | void 79 | unblock_sigchld (void) 80 | { 81 | #ifdef HAVE_SIGACTION 82 | sigset_t child_set; 83 | sigemptyset (&child_set); 84 | sigaddset (&child_set, SIGCHLD); 85 | sigaddset (&child_set, SIGPIPE); 86 | sigprocmask (SIG_UNBLOCK, &child_set, 0); 87 | #endif /* HAVE_SIGACTION */ 88 | 89 | block_sigchld_handler--; 90 | } 91 | 92 | int 93 | signal_pid (int pid, 94 | int signal) 95 | { 96 | int status = -1; 97 | gboolean verbose = TRUE; 98 | 99 | if (block_sigchld_handler) 100 | /* This function should not be called from the signal handler. */ 101 | abort(); 102 | 103 | block_sigchld (); /* we control the horizontal... */ 104 | 105 | status = kill (pid, signal); 106 | 107 | if (verbose && status < 0) 108 | { 109 | if (errno == ESRCH) 110 | g_message ("Child process %lu was already dead.", 111 | (unsigned long) pid); 112 | else 113 | { 114 | char buf [1024]; 115 | snprintf (buf, sizeof (buf), "Couldn't kill child process %lu", 116 | (unsigned long) pid); 117 | perror (buf); 118 | } 119 | } 120 | 121 | unblock_sigchld (); 122 | 123 | if (block_sigchld_handler < 0) 124 | abort (); 125 | 126 | return status; 127 | } 128 | 129 | #ifndef VMS 130 | 131 | void 132 | await_dying_children (int pid, 133 | gboolean debug) 134 | { 135 | while (1) 136 | { 137 | int wait_status = 0; 138 | pid_t kid; 139 | 140 | errno = 0; 141 | kid = waitpid (-1, &wait_status, WNOHANG|WUNTRACED); 142 | 143 | if (debug) 144 | { 145 | if (kid < 0 && errno) 146 | g_message ("waitpid(%d) ==> %ld (%d)", pid, (long) kid, errno); 147 | else if (kid != 0) 148 | g_message ("waitpid(%d) ==> %ld", pid, (long) kid); 149 | } 150 | 151 | /* 0 means no more children to reap. 152 | -1 means error -- except "interrupted system call" isn't a "real" 153 | error, so if we get that, we should just try again. */ 154 | if (kid < 0 && errno != EINTR) 155 | break; 156 | } 157 | } 158 | 159 | 160 | #else /* VMS */ 161 | static void await_dying_children (saver_info *si) 162 | { 163 | return; 164 | } 165 | #endif /* VMS */ 166 | 167 | -------------------------------------------------------------------------------- /src/xfce-rr.h: -------------------------------------------------------------------------------- 1 | /* xfce-rr.h 2 | * 3 | * Copyright 2007, 2008, Red Hat, Inc. 4 | * Copyright 2018 Sean Davis 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public License as 8 | * published by the Free Software Foundation; either version 2 of the 9 | * License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; see the file COPYING.LIB. If not, 18 | * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | * 21 | * Author: Soren Sandmann 22 | */ 23 | #ifndef XFCE_RR_H 24 | #define XFCE_RR_H 25 | 26 | #include 27 | #include 28 | 29 | typedef struct XfceRRScreenPrivate XfceRRScreenPrivate; 30 | typedef struct XfceRROutput XfceRROutput; 31 | typedef struct XfceRRCrtc XfceRRCrtc; 32 | typedef struct XfceRRMode XfceRRMode; 33 | 34 | typedef struct { 35 | GObject parent; 36 | 37 | XfceRRScreenPrivate* priv; 38 | } XfceRRScreen; 39 | 40 | typedef struct { 41 | GObjectClass parent_class; 42 | 43 | void (* changed) (void); 44 | } XfceRRScreenClass; 45 | 46 | typedef enum 47 | { 48 | XFCE_RR_ROTATION_0 = (1 << 0), 49 | XFCE_RR_ROTATION_90 = (1 << 1), 50 | XFCE_RR_ROTATION_180 = (1 << 2), 51 | XFCE_RR_ROTATION_270 = (1 << 3), 52 | XFCE_RR_REFLECT_X = (1 << 4), 53 | XFCE_RR_REFLECT_Y = (1 << 5) 54 | } XfceRRRotation; 55 | 56 | /* Error codes */ 57 | 58 | #define XFCE_RR_ERROR (xfce_rr_error_quark ()) 59 | 60 | GQuark xfce_rr_error_quark (void); 61 | 62 | typedef enum { 63 | XFCE_RR_ERROR_UNKNOWN, /* generic "fail" */ 64 | XFCE_RR_ERROR_NO_RANDR_EXTENSION, /* RANDR extension is not present */ 65 | XFCE_RR_ERROR_RANDR_ERROR, /* generic/undescribed error from the underlying XRR API */ 66 | XFCE_RR_ERROR_BOUNDS_ERROR, /* requested bounds of a CRTC are outside the maximum size */ 67 | XFCE_RR_ERROR_CRTC_ASSIGNMENT, /* could not assign CRTCs to outputs */ 68 | XFCE_RR_ERROR_NO_MATCHING_CONFIG, /* none of the saved configurations matched the current configuration */ 69 | } XfceRRError; 70 | 71 | #define XFCE_RR_CONNECTOR_TYPE_PANEL "Panel" /* This is a laptop's built-in LCD */ 72 | 73 | #define XFCE_TYPE_RR_SCREEN (xfce_rr_screen_get_type()) 74 | #define XFCE_RR_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_RR_SCREEN, XfceRRScreen)) 75 | #define XFCE_IS_RR_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_RR_SCREEN)) 76 | #define XFCE_RR_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_RR_SCREEN, XfceRRScreenClass)) 77 | #define XFCE_IS_RR_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_RR_SCREEN)) 78 | #define XFCE_RR_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_RR_SCREEN, XfceRRScreenClass)) 79 | 80 | #define XFCE_TYPE_RR_OUTPUT (xfce_rr_output_get_type()) 81 | #define XFCE_TYPE_RR_CRTC (xfce_rr_crtc_get_type()) 82 | #define XFCE_TYPE_RR_MODE (xfce_rr_mode_get_type()) 83 | 84 | GType xfce_rr_screen_get_type (void); 85 | GType xfce_rr_output_get_type (void); 86 | GType xfce_rr_crtc_get_type (void); 87 | GType xfce_rr_mode_get_type (void); 88 | 89 | /* XfceRRScreen */ 90 | XfceRRScreen * xfce_rr_screen_new (GdkScreen *screen, 91 | GError **error); 92 | XfceRRCrtc ** xfce_rr_screen_list_crtcs (XfceRRScreen *screen); 93 | gboolean xfce_rr_screen_refresh (XfceRRScreen *screen, 94 | GError **error); 95 | 96 | /* XfceRRCrtc */ 97 | XfceRRMode * xfce_rr_crtc_get_current_mode (XfceRRCrtc *crtc); 98 | 99 | gboolean xfce_rr_crtc_get_gamma (XfceRRCrtc *crtc, 100 | int *size, 101 | unsigned short **red, 102 | unsigned short **green, 103 | unsigned short **blue); 104 | void xfce_rr_crtc_set_gamma (XfceRRCrtc *crtc, 105 | int size, 106 | unsigned short *red, 107 | unsigned short *green, 108 | unsigned short *blue); 109 | #endif /* XFCE_RR_H */ 110 | -------------------------------------------------------------------------------- /savers/xdg-user-dir-lookup.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is not licenced under the GPL like the rest of the code. 3 | Its is under the MIT license, to encourage reuse by cut-and-paste. 4 | 5 | Copyright (c) 2007 Red Hat, inc 6 | 7 | Permission is hereby granted, free of charge, to any person 8 | obtaining a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 22 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 23 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include "xdg-user-dir-lookup.h" 33 | 34 | char * 35 | xdg_user_dir_lookup (const char *type) 36 | { 37 | FILE *file; 38 | char *home_dir, *config_home, *config_file; 39 | char buffer[512]; 40 | char *user_dir; 41 | char *p, *d; 42 | int len; 43 | int relative; 44 | 45 | home_dir = getenv ("HOME"); 46 | 47 | if (home_dir == NULL) 48 | return strdup ("/tmp"); 49 | 50 | config_home = getenv ("XDG_CONFIG_HOME"); 51 | if (config_home == NULL || config_home[0] == 0) 52 | { 53 | config_file = malloc (strlen (home_dir) + strlen ("/.config/user-dirs.dirs") + 1); 54 | strcpy (config_file, home_dir); 55 | strcat (config_file, "/.config/user-dirs.dirs"); 56 | } 57 | else 58 | { 59 | config_file = malloc (strlen (config_home) + strlen ("/user-dirs.dirs") + 1); 60 | strcpy (config_file, config_home); 61 | strcat (config_file, "/user-dirs.dirs"); 62 | } 63 | 64 | file = fopen (config_file, "r"); 65 | free (config_file); 66 | if (file == NULL) 67 | goto error; 68 | 69 | user_dir = NULL; 70 | while (fgets (buffer, sizeof (buffer), file)) 71 | { 72 | /* Remove newline at end */ 73 | len = strlen (buffer); 74 | if (len > 0 && buffer[len-1] == '\n') 75 | buffer[len-1] = 0; 76 | 77 | p = buffer; 78 | while (*p == ' ' || *p == '\t') 79 | p++; 80 | 81 | if (strncmp (p, "XDG_", 4) != 0) 82 | continue; 83 | p += 4; 84 | if (strncmp (p, type, strlen (type)) != 0) 85 | continue; 86 | p += strlen (type); 87 | if (strncmp (p, "_DIR", 4) != 0) 88 | continue; 89 | p += 4; 90 | 91 | while (*p == ' ' || *p == '\t') 92 | p++; 93 | 94 | if (*p != '=') 95 | continue; 96 | p++; 97 | 98 | while (*p == ' ' || *p == '\t') 99 | p++; 100 | 101 | if (*p != '"') 102 | continue; 103 | p++; 104 | 105 | relative = 0; 106 | if (strncmp (p, "$HOME/", 6) == 0) 107 | { 108 | p += 6; 109 | relative = 1; 110 | } 111 | else if (*p != '/') 112 | continue; 113 | 114 | if (relative) 115 | { 116 | user_dir = malloc (strlen (home_dir) + 1 + strlen (p) + 1); 117 | strcpy (user_dir, home_dir); 118 | strcat (user_dir, "/"); 119 | } 120 | else 121 | { 122 | user_dir = malloc (strlen (p) + 1); 123 | *user_dir = 0; 124 | } 125 | 126 | d = user_dir + strlen (user_dir); 127 | while (*p && *p != '"') 128 | { 129 | if ((*p == '\\') && (*(p+1) != 0)) 130 | p++; 131 | *d++ = *p++; 132 | } 133 | *d = 0; 134 | } 135 | fclose (file); 136 | 137 | if (user_dir) 138 | return user_dir; 139 | 140 | error: 141 | /* Special case desktop for historical compatibility */ 142 | if (strcmp (type, "DESKTOP") == 0) 143 | { 144 | user_dir = malloc (strlen (home_dir) + strlen ("/Desktop") + 1); 145 | strcpy (user_dir, home_dir); 146 | strcat (user_dir, "/Desktop"); 147 | return user_dir; 148 | } 149 | else 150 | return strdup (home_dir); 151 | } 152 | 153 | #ifdef STANDALONE 154 | 155 | int 156 | main (int argc, char *argv[]) 157 | { 158 | if (argc != 2) 159 | { 160 | fprintf (stderr, "Usage %s \n", argv[0]); 161 | exit (1); 162 | } 163 | 164 | printf ("%s\n", xdg_user_dir_lookup (argv[1])); 165 | return 0; 166 | } 167 | 168 | #endif 169 | -------------------------------------------------------------------------------- /src/gs-window.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_WINDOW_H 24 | #define __GS_WINDOW_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GS_TYPE_WINDOW (gs_window_get_type ()) 32 | #define GS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_WINDOW, GSWindow)) 33 | #define GS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_WINDOW, GSWindowClass)) 34 | #define GS_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_WINDOW)) 35 | #define GS_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_WINDOW)) 36 | #define GS_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_WINDOW, GSWindowClass)) 37 | 38 | typedef struct GSWindowPrivate GSWindowPrivate; 39 | 40 | typedef struct 41 | { 42 | GtkWindow window; 43 | 44 | GSWindowPrivate *priv; 45 | } GSWindow; 46 | 47 | typedef struct 48 | { 49 | GtkWindowClass parent_class; 50 | 51 | gboolean (* activity) (GSWindow *window); 52 | void (* deactivated) (GSWindow *window); 53 | void (* dialog_up) (GSWindow *window); 54 | void (* dialog_down) (GSWindow *window); 55 | } GSWindowClass; 56 | 57 | GType gs_window_get_type (void); 58 | 59 | gboolean gs_window_is_obscured (GSWindow *window); 60 | gboolean gs_window_is_dialog_up (GSWindow *window); 61 | 62 | GdkDisplay *gs_window_get_display (GSWindow *window); 63 | 64 | void gs_window_set_monitor (GSWindow *window, 65 | GdkMonitor *monitor); 66 | GdkMonitor *gs_window_get_monitor (GSWindow *window); 67 | 68 | void gs_window_set_background_surface (GSWindow *window, 69 | cairo_surface_t *surface); 70 | void gs_window_set_lock_enabled (GSWindow *window, 71 | gboolean lock_enabled); 72 | void gs_window_set_logout_enabled (GSWindow *window, 73 | gboolean logout_enabled); 74 | void gs_window_set_keyboard_enabled (GSWindow *window, 75 | gboolean enabled); 76 | void gs_window_set_keyboard_command (GSWindow *window, 77 | const char *command); 78 | void gs_window_set_user_switch_enabled (GSWindow *window, 79 | gboolean user_switch_enabled); 80 | void gs_window_set_logout_timeout (GSWindow *window, 81 | glong timeout); 82 | void gs_window_set_logout_command (GSWindow *window, 83 | const char *command); 84 | void gs_window_set_status_message (GSWindow *window, 85 | const char *status_message); 86 | void gs_window_show_message (GSWindow *window, 87 | const char *summary, 88 | const char *body, 89 | const char *icon); 90 | 91 | void gs_window_request_unlock (GSWindow *window); 92 | void gs_window_cancel_unlock_request (GSWindow *window); 93 | 94 | GSWindow * gs_window_new (GdkMonitor *monitor, 95 | gboolean lock_enabled); 96 | void gs_window_show (GSWindow *window); 97 | void gs_window_destroy (GSWindow *window); 98 | GdkWindow * gs_window_get_gdk_window (GSWindow *window); 99 | GtkWidget * gs_window_get_drawing_area (GSWindow *window); 100 | void gs_window_clear (GSWindow *window); 101 | 102 | G_END_DECLS 103 | 104 | #endif /* __GS_WINDOW_H */ 105 | -------------------------------------------------------------------------------- /src/test-window.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | * Authors: William Jon McCann 21 | * 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #include "gs-window.h" 32 | #include "gs-grab.h" 33 | #include "gs-debug.h" 34 | 35 | static GSGrab *grab = NULL; 36 | 37 | static void 38 | window_deactivated_cb (GSWindow *window, 39 | gpointer data) 40 | { 41 | gs_window_destroy (window); 42 | } 43 | 44 | static void 45 | window_dialog_up_cb (GSWindow *window, 46 | gpointer data) 47 | { 48 | } 49 | 50 | static void 51 | window_dialog_down_cb (GSWindow *window, 52 | gpointer data) 53 | { 54 | } 55 | 56 | static void 57 | window_show_cb (GSWindow *window, 58 | gpointer data) 59 | { 60 | /* move devices grab so that dialog can be used */ 61 | gs_grab_move_to_window (grab, 62 | gs_window_get_gdk_window (window), 63 | gs_window_get_display (window), 64 | TRUE, FALSE); 65 | } 66 | 67 | static gboolean 68 | window_activity_cb (GSWindow *window, 69 | gpointer data) 70 | { 71 | gs_window_request_unlock (window); 72 | 73 | return TRUE; 74 | } 75 | 76 | static void 77 | disconnect_window_signals (GSWindow *window) 78 | { 79 | gpointer data; 80 | 81 | data = NULL; 82 | g_signal_handlers_disconnect_by_func (window, window_activity_cb, data); 83 | g_signal_handlers_disconnect_by_func (window, window_deactivated_cb, data); 84 | g_signal_handlers_disconnect_by_func (window, window_dialog_up_cb, data); 85 | g_signal_handlers_disconnect_by_func (window, window_dialog_down_cb, data); 86 | g_signal_handlers_disconnect_by_func (window, window_show_cb, data); 87 | } 88 | 89 | static void 90 | window_destroyed_cb (GtkWindow *window, 91 | gpointer data) 92 | { 93 | disconnect_window_signals (GS_WINDOW (window)); 94 | gs_grab_release (grab, TRUE); 95 | gtk_main_quit (); 96 | } 97 | 98 | static void 99 | connect_window_signals (GSWindow *window) 100 | { 101 | gpointer data; 102 | 103 | data = NULL; 104 | 105 | g_signal_connect_object (window, "activity", 106 | G_CALLBACK (window_activity_cb), data, 0); 107 | g_signal_connect_object (window, "destroy", 108 | G_CALLBACK (window_destroyed_cb), data, 0); 109 | g_signal_connect_object (window, "deactivated", 110 | G_CALLBACK (window_deactivated_cb), data, 0); 111 | g_signal_connect_object (window, "dialog-up", 112 | G_CALLBACK (window_dialog_up_cb), data, 0); 113 | g_signal_connect_object (window, "dialog-down", 114 | G_CALLBACK (window_dialog_down_cb), data, 0); 115 | g_signal_connect_object (window, "show", 116 | G_CALLBACK (window_show_cb), data, 0); 117 | } 118 | 119 | static void 120 | test_window (void) 121 | { 122 | GSWindow *window; 123 | gboolean lock_active; 124 | gboolean user_switch_enabled; 125 | GdkDisplay *display; 126 | GdkMonitor *monitor; 127 | 128 | lock_active = TRUE; 129 | user_switch_enabled = TRUE; 130 | display = gdk_display_get_default (); 131 | monitor = gdk_display_get_primary_monitor (display); 132 | 133 | window = gs_window_new (monitor, lock_active); 134 | 135 | gs_window_set_user_switch_enabled (window, user_switch_enabled); 136 | 137 | connect_window_signals (window); 138 | 139 | gs_window_show (window); 140 | } 141 | 142 | int 143 | main (int argc, 144 | char **argv) 145 | { 146 | GError *error = NULL; 147 | 148 | #ifdef ENABLE_NLS 149 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 150 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET 151 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 152 | # endif 153 | textdomain (GETTEXT_PACKAGE); 154 | #endif 155 | 156 | if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 157 | { 158 | fprintf (stderr, "%s", error->message); 159 | g_error_free (error); 160 | exit (1); 161 | } 162 | 163 | gs_debug_init (TRUE, FALSE); 164 | 165 | grab = gs_grab_new (); 166 | 167 | test_window (); 168 | 169 | /* safety valve in case we can't authenticate */ 170 | g_timeout_add (30000, (GSourceFunc)gtk_main_quit, NULL); 171 | 172 | gtk_main (); 173 | 174 | g_object_unref (grab); 175 | 176 | gs_debug_shutdown (); 177 | 178 | return 0; 179 | } 180 | -------------------------------------------------------------------------------- /src/gs-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GS_MANAGER_H 24 | #define __GS_MANAGER_H 25 | 26 | #include "gs-prefs.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GS_TYPE_MANAGER (gs_manager_get_type ()) 31 | #define GS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_MANAGER, GSManager)) 32 | #define GS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_MANAGER, GSManagerClass)) 33 | #define GS_IS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_MANAGER)) 34 | #define GS_IS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_MANAGER)) 35 | #define GS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_MANAGER, GSManagerClass)) 36 | 37 | typedef struct GSManagerPrivate GSManagerPrivate; 38 | 39 | typedef struct 40 | { 41 | GObject parent; 42 | GSManagerPrivate *priv; 43 | } GSManager; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | 49 | void (* activated) (GSManager *manager); 50 | void (* deactivated) (GSManager *manager); 51 | void (* auth_request_begin) (GSManager *manager); 52 | void (* auth_request_end) (GSManager *manager); 53 | 54 | } GSManagerClass; 55 | 56 | GType gs_manager_get_type (void); 57 | 58 | GSManager * gs_manager_new (void); 59 | 60 | gboolean gs_manager_set_active (GSManager *manager, 61 | gboolean active); 62 | gboolean gs_manager_get_active (GSManager *manager); 63 | 64 | gboolean gs_manager_cycle (GSManager *manager); 65 | 66 | void gs_manager_get_lock_active (GSManager *manager, 67 | gboolean *lock_active); 68 | void gs_manager_set_lock_active (GSManager *manager, 69 | gboolean lock_active); 70 | void gs_manager_set_keyboard_enabled (GSManager *manager, 71 | gboolean enabled); 72 | void gs_manager_set_keyboard_command (GSManager *manager, 73 | const char *command); 74 | void gs_manager_set_status_message (GSManager *manager, 75 | const char *message); 76 | void gs_manager_get_lock_enabled (GSManager *manager, 77 | gboolean *lock_enabled); 78 | void gs_manager_set_lock_enabled (GSManager *manager, 79 | gboolean lock_enabled); 80 | void gs_manager_set_lock_timeout (GSManager *manager, 81 | glong lock_timeout); 82 | void gs_manager_set_logout_enabled (GSManager *manager, 83 | gboolean logout_enabled); 84 | void gs_manager_set_user_switch_enabled (GSManager *manager, 85 | gboolean user_switch_enabled); 86 | void gs_manager_set_logout_timeout (GSManager *manager, 87 | glong logout_timeout); 88 | void gs_manager_set_logout_command (GSManager *manager, 89 | const char *command); 90 | void gs_manager_set_throttled (GSManager *manager, 91 | gboolean lock_enabled); 92 | void gs_manager_set_cycle_timeout (GSManager *manager, 93 | glong cycle_timeout); 94 | void gs_manager_set_themes (GSManager *manager, 95 | GSList *themes); 96 | void gs_manager_set_mode (GSManager *manager, 97 | GSSaverMode mode); 98 | void gs_manager_show_message (GSManager *manager, 99 | const char *summary, 100 | const char *body, 101 | const char *icon); 102 | gboolean gs_manager_request_unlock (GSManager *manager); 103 | void gs_manager_cancel_unlock_request (GSManager *manager); 104 | 105 | G_END_DECLS 106 | 107 | #endif /* __GS_MANAGER_H */ 108 | -------------------------------------------------------------------------------- /savers/gs-theme-engine.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * Copyright (C) 2018 Sean Davis 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of the 9 | * License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #include "gs-theme-engine.h" 33 | #include "gs-theme-engine-marshal.h" 34 | 35 | static void gs_theme_engine_class_init (GSThemeEngineClass *klass); 36 | static void gs_theme_engine_init (GSThemeEngine *engine); 37 | static void gs_theme_engine_finalize (GObject *object); 38 | 39 | struct GSThemeEnginePrivate 40 | { 41 | gpointer reserved; 42 | }; 43 | 44 | static GObjectClass *parent_class = NULL; 45 | 46 | G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GSThemeEngine, gs_theme_engine, GTK_TYPE_DRAWING_AREA) 47 | 48 | void 49 | _gs_theme_engine_profile_log (const char *func, 50 | const char *note, 51 | const char *format, 52 | ...) 53 | { 54 | va_list args; 55 | char *str; 56 | char *formatted; 57 | 58 | va_start (args, format); 59 | formatted = g_strdup_vprintf (format, args); 60 | va_end (args); 61 | 62 | if (func != NULL) 63 | { 64 | str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted); 65 | } 66 | else 67 | { 68 | str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted); 69 | } 70 | 71 | g_free (formatted); 72 | 73 | access (str, F_OK); 74 | g_free (str); 75 | } 76 | 77 | static void 78 | gs_theme_engine_set_property (GObject *object, 79 | guint prop_id, 80 | const GValue *value, 81 | GParamSpec *pspec) 82 | { 83 | GS_THEME_ENGINE (object); 84 | 85 | switch (prop_id) 86 | { 87 | default: 88 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); 89 | break; 90 | } 91 | } 92 | 93 | static void 94 | gs_theme_engine_get_property (GObject *object, 95 | guint prop_id, 96 | GValue *value, 97 | GParamSpec *pspec) 98 | { 99 | GS_THEME_ENGINE (object); 100 | 101 | switch (prop_id) 102 | { 103 | default: 104 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); 105 | break; 106 | } 107 | } 108 | 109 | static gboolean 110 | gs_theme_engine_real_draw (GtkWidget *widget, 111 | cairo_t *cr) 112 | { 113 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); 114 | cairo_set_source_rgb (cr, 0, 0, 0); 115 | cairo_paint (cr); 116 | 117 | return FALSE; 118 | } 119 | 120 | static void 121 | gs_theme_engine_class_init (GSThemeEngineClass *klass) 122 | { 123 | GObjectClass *object_class = G_OBJECT_CLASS (klass); 124 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); 125 | 126 | parent_class = g_type_class_peek_parent (klass); 127 | 128 | object_class->finalize = gs_theme_engine_finalize; 129 | object_class->get_property = gs_theme_engine_get_property; 130 | object_class->set_property = gs_theme_engine_set_property; 131 | 132 | widget_class->draw = gs_theme_engine_real_draw; 133 | } 134 | 135 | static void 136 | gs_theme_engine_init (GSThemeEngine *engine) 137 | { 138 | engine->priv = gs_theme_engine_get_instance_private (engine); 139 | } 140 | 141 | static void 142 | gs_theme_engine_finalize (GObject *object) 143 | { 144 | GSThemeEngine *engine; 145 | 146 | g_return_if_fail (object != NULL); 147 | g_return_if_fail (GS_IS_THEME_ENGINE (object)); 148 | 149 | engine = GS_THEME_ENGINE (object); 150 | 151 | g_return_if_fail (engine->priv != NULL); 152 | 153 | G_OBJECT_CLASS (parent_class)->finalize (object); 154 | } 155 | 156 | void 157 | gs_theme_engine_get_window_size (GSThemeEngine *engine, 158 | int *width, 159 | int *height) 160 | { 161 | if (width != NULL) 162 | { 163 | *width = 0; 164 | } 165 | if (height != NULL) 166 | { 167 | *height = 0; 168 | } 169 | 170 | g_return_if_fail (GS_IS_THEME_ENGINE (engine)); 171 | 172 | if (! gtk_widget_get_visible (GTK_WIDGET (engine))) 173 | { 174 | return; 175 | } 176 | 177 | gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (engine)), 178 | NULL, 179 | NULL, 180 | width, 181 | height); 182 | } 183 | 184 | GdkWindow * 185 | gs_theme_engine_get_window (GSThemeEngine *engine) 186 | { 187 | g_return_val_if_fail (GS_IS_THEME_ENGINE (engine), NULL); 188 | 189 | return gtk_widget_get_window (GTK_WIDGET (engine)); 190 | } 191 | -------------------------------------------------------------------------------- /src/gs-auth-helper.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * written by Olaf Kirch 4 | * xscreensaver, Copyright (c) 1993-2004 Jamie Zawinski 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software and its 7 | * documentation for any purpose is hereby granted without fee, provided that 8 | * the above copyright notice appear in all copies and that both that 9 | * copyright notice and this permission notice appear in supporting 10 | * documentation. No representations are made about the suitability of this 11 | * software for any purpose. It is provided "as is" without express or 12 | * implied warranty. 13 | */ 14 | 15 | /* The idea here is to be able to run xfce4-screensaver-dialog without any setuid bits. 16 | * Password verification happens through an external program that you feed 17 | * your password to on stdin. The external command is invoked with a user 18 | * name argument. 19 | * 20 | * The external helper does whatever authentication is necessary. Currently, 21 | * SuSE uses "unix2_chkpwd", which is a variation of "unix_chkpwd" from the 22 | * PAM distribution. 23 | * 24 | * Normally, the password helper should just authenticate the calling user 25 | * (i.e. based on the caller's real uid). This is in order to prevent 26 | * brute-forcing passwords in a shadow environment. A less restrictive 27 | * approach would be to allow verifying other passwords as well, but always 28 | * with a 2 second delay or so. (Not sure what SuSE's "unix2_chkpwd" 29 | * currently does.) 30 | * -- Olaf Kirch , 16-Dec-2003 31 | */ 32 | 33 | #include "config.h" 34 | 35 | #include 36 | #ifdef HAVE_UNISTD_H 37 | # include 38 | #endif 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | #include 49 | 50 | #include "gs-auth.h" 51 | #include "subprocs.h" 52 | 53 | static gboolean verbose_enabled = FALSE; 54 | 55 | GQuark 56 | gs_auth_error_quark (void) 57 | { 58 | static GQuark quark = 0; 59 | if (! quark) 60 | { 61 | quark = g_quark_from_static_string ("gs_auth_error"); 62 | } 63 | 64 | return quark; 65 | } 66 | 67 | void 68 | gs_auth_set_verbose (gboolean enabled) 69 | { 70 | verbose_enabled = enabled; 71 | } 72 | 73 | gboolean 74 | gs_auth_get_verbose (void) 75 | { 76 | return verbose_enabled; 77 | } 78 | 79 | static gboolean 80 | ext_run (const char *user, 81 | const char *typed_passwd, 82 | gboolean verbose) 83 | { 84 | int pfd[2], status; 85 | pid_t pid; 86 | 87 | if (pipe (pfd) < 0) 88 | { 89 | return 0; 90 | } 91 | 92 | if (verbose) 93 | { 94 | g_message ("ext_run (%s, %s)", 95 | PASSWD_HELPER_PROGRAM, user); 96 | } 97 | 98 | block_sigchld (); 99 | 100 | if ((pid = fork ()) < 0) 101 | { 102 | close (pfd [0]); 103 | close (pfd [1]); 104 | return FALSE; 105 | } 106 | 107 | if (pid == 0) 108 | { 109 | close (pfd [1]); 110 | if (pfd [0] != 0) 111 | { 112 | dup2 (pfd [0], 0); 113 | } 114 | 115 | /* Helper is invoked as helper service-name [user] */ 116 | execlp (PASSWD_HELPER_PROGRAM, PASSWD_HELPER_PROGRAM, "xfce4-screensaver", user, NULL); 117 | if (verbose) 118 | { 119 | g_message ("%s: %s", PASSWD_HELPER_PROGRAM, g_strerror (errno)); 120 | } 121 | 122 | exit (1); 123 | } 124 | 125 | close (pfd [0]); 126 | 127 | /* Write out password to helper process */ 128 | if (!typed_passwd) 129 | { 130 | typed_passwd = ""; 131 | } 132 | write (pfd [1], typed_passwd, strlen (typed_passwd)); 133 | close (pfd [1]); 134 | 135 | while (waitpid (pid, &status, 0) < 0) 136 | { 137 | if (errno == EINTR) 138 | { 139 | continue; 140 | } 141 | 142 | if (verbose) 143 | { 144 | g_message ("ext_run: waitpid failed: %s\n", 145 | g_strerror (errno)); 146 | } 147 | 148 | unblock_sigchld (); 149 | return FALSE; 150 | } 151 | 152 | unblock_sigchld (); 153 | 154 | if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) 155 | { 156 | return FALSE; 157 | } 158 | 159 | return TRUE; 160 | } 161 | 162 | gboolean 163 | gs_auth_verify_user (const char *username, 164 | const char *display, 165 | GSAuthMessageFunc func, 166 | gpointer data, 167 | GError **error) 168 | { 169 | gboolean res = FALSE; 170 | char *password; 171 | 172 | password = NULL; 173 | 174 | /* ask for the password for user */ 175 | if (func != NULL) 176 | { 177 | func (GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, 178 | "Password: ", 179 | &password, 180 | data); 181 | } 182 | 183 | if (password == NULL) 184 | { 185 | return FALSE; 186 | } 187 | 188 | res = ext_run (username, password, gs_auth_get_verbose ()); 189 | 190 | return res; 191 | } 192 | 193 | gboolean 194 | gs_auth_init (void) 195 | { 196 | return TRUE; 197 | } 198 | 199 | gboolean 200 | gs_auth_priv_init (void) 201 | { 202 | /* Make sure the passwd helper exists */ 203 | if (g_access (PASSWD_HELPER_PROGRAM, X_OK) < 0) 204 | { 205 | g_warning ("%s does not exist. " 206 | "password authentication via " 207 | "external helper will not work.", 208 | PASSWD_HELPER_PROGRAM); 209 | return FALSE; 210 | } 211 | 212 | return TRUE; 213 | } 214 | -------------------------------------------------------------------------------- /savers/gs-theme-window.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- 2 | * 3 | * gs-theme-window.c - special toplevel for screensavers 4 | * 5 | * Copyright (C) 2005 Ray Strode 6 | * Copyright (C) 2018 Sean Davis 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be 14 | * useful, but WITHOUT ANY WARRANTY; without even the implied 15 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 16 | * PURPOSE. See the GNU Lesser General Public License for more 17 | * details. 18 | * 19 | * You should have received a copy of the GNU Lesser General 20 | * Public License along with this program; see the file 21 | * COPYING.LGPL. If not, write to the Free Software Foundation, 22 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 23 | * 24 | * Originally written by: Ray Strode 25 | */ 26 | 27 | #include "config.h" 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include "gs-theme-window.h" 39 | 40 | static void gs_theme_window_finalize (GObject *object); 41 | static void gs_theme_window_real_realize (GtkWidget *widget); 42 | 43 | static GObjectClass *parent_class = NULL; 44 | 45 | G_DEFINE_TYPE (GSThemeWindow, gs_theme_window, GTK_TYPE_WINDOW) 46 | 47 | #define MIN_SIZE 10 48 | 49 | static void 50 | gs_theme_window_class_init (GSThemeWindowClass *klass) 51 | { 52 | GObjectClass *object_class; 53 | GtkWidgetClass *widget_class; 54 | 55 | object_class = G_OBJECT_CLASS (klass); 56 | widget_class = GTK_WIDGET_CLASS (klass); 57 | 58 | parent_class = g_type_class_peek_parent (klass); 59 | 60 | object_class->finalize = gs_theme_window_finalize; 61 | 62 | widget_class->realize = gs_theme_window_real_realize; 63 | } 64 | 65 | static void 66 | gs_theme_window_init (GSThemeWindow *window) 67 | { 68 | gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE); 69 | } 70 | 71 | static void 72 | gs_theme_window_finalize (GObject *object) 73 | { 74 | GObjectClass *parent_class; 75 | 76 | GS_THEME_WINDOW (object); 77 | 78 | parent_class = G_OBJECT_CLASS (gs_theme_window_parent_class); 79 | 80 | if (parent_class->finalize != NULL) 81 | parent_class->finalize (object); 82 | } 83 | 84 | static void 85 | gs_theme_window_real_realize (GtkWidget *widget) 86 | { 87 | GdkWindow *window; 88 | Window remote_xwindow; 89 | GtkRequisition requisition; 90 | GtkAllocation allocation; 91 | const char *preview_xid; 92 | int x; 93 | int y; 94 | int width; 95 | int height; 96 | int event_mask; 97 | 98 | event_mask = 0; 99 | window = NULL; 100 | preview_xid = g_getenv ("XSCREENSAVER_WINDOW"); 101 | 102 | if (preview_xid != NULL) 103 | { 104 | char *end; 105 | 106 | remote_xwindow = (Window) strtoul (preview_xid, &end, 0); 107 | 108 | if ((remote_xwindow != 0) && (end != NULL) && 109 | ((*end == ' ') || (*end == '\0')) && 110 | ((remote_xwindow < G_MAXULONG) || (errno != ERANGE))) 111 | { 112 | window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), remote_xwindow); 113 | if (window != NULL) 114 | { 115 | /* This is a kludge; we need to set the same 116 | * flags gs-window-x11.c does, to ensure they 117 | * don't get unset by gtk_window_map() later. 118 | */ 119 | gtk_window_set_decorated (GTK_WINDOW (widget), FALSE); 120 | 121 | gtk_window_set_skip_taskbar_hint (GTK_WINDOW (widget), TRUE); 122 | gtk_window_set_skip_pager_hint (GTK_WINDOW (widget), TRUE); 123 | 124 | gtk_window_set_keep_above (GTK_WINDOW (widget), TRUE); 125 | 126 | gtk_window_fullscreen (GTK_WINDOW (widget)); 127 | 128 | event_mask = GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK; 129 | gtk_widget_set_events (widget, gtk_widget_get_events (widget) | event_mask); 130 | } 131 | } 132 | } 133 | 134 | if (window == NULL) 135 | { 136 | GtkWidgetClass *parent_class; 137 | 138 | parent_class = GTK_WIDGET_CLASS (gs_theme_window_parent_class); 139 | 140 | if (parent_class->realize != NULL) 141 | parent_class->realize (widget); 142 | 143 | return; 144 | } 145 | 146 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* GTK 3.18 */ 147 | gtk_style_context_set_background (gtk_widget_get_style_context (widget), 148 | window); 149 | G_GNUC_END_IGNORE_DEPRECATIONS 150 | gdk_window_set_decorations (window, (GdkWMDecoration) 0); 151 | gdk_window_set_events (window, gdk_window_get_events (window) | event_mask); 152 | 153 | gtk_widget_set_window (widget, window); 154 | gdk_window_set_user_data (window, widget); 155 | gtk_widget_set_realized (widget, TRUE); 156 | 157 | gdk_window_get_geometry (window, &x, &y, &width, &height); 158 | 159 | if (width < MIN_SIZE || height < MIN_SIZE) 160 | { 161 | g_critical ("This window is way too small to use"); 162 | exit (1); 163 | } 164 | 165 | gtk_widget_get_preferred_size (widget, &requisition, NULL); 166 | allocation.x = x; 167 | allocation.y = y; 168 | allocation.width = width; 169 | allocation.height = height; 170 | gtk_widget_size_allocate (widget, &allocation); 171 | gtk_window_resize (GTK_WINDOW (widget), width, height); 172 | } 173 | 174 | GtkWidget * 175 | gs_theme_window_new (void) 176 | { 177 | GSThemeWindow *window; 178 | 179 | window = g_object_new (GS_TYPE_THEME_WINDOW, 180 | "type", GTK_WINDOW_TOPLEVEL, 181 | NULL); 182 | 183 | return GTK_WIDGET (window); 184 | } 185 | -------------------------------------------------------------------------------- /data/images/xfce-logo-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 15 | 17 | image/svg+xml 18 | 20 | 21 | 22 | 23 | 24 | 26 | 30 | 31 | -------------------------------------------------------------------------------- /src/test-passwd.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2005-2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | * Authors: William Jon McCann 21 | * 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | #include "gs-auth.h" 37 | #include "setuid.h" 38 | 39 | /* Initializations that potentially take place as a priveleged user: 40 | If the executable is setuid root, then these initializations 41 | are run as root, before discarding privileges. 42 | */ 43 | static gboolean 44 | privileged_initialization (void) 45 | { 46 | gboolean ret; 47 | char *nolock_reason; 48 | char *orig_uid; 49 | char *uid_message; 50 | 51 | #ifndef NO_LOCKING 52 | /* before hack_uid () for proper permissions */ 53 | gs_auth_priv_init (); 54 | #endif /* NO_LOCKING */ 55 | 56 | ret = hack_uid (&nolock_reason, 57 | &orig_uid, 58 | &uid_message); 59 | if (nolock_reason) 60 | { 61 | g_warning ("Locking disabled: %s", nolock_reason); 62 | } 63 | if (uid_message && gs_auth_get_verbose ()) 64 | { 65 | g_print ("Modified UID: %s", uid_message); 66 | } 67 | 68 | g_free (nolock_reason); 69 | g_free (orig_uid); 70 | g_free (uid_message); 71 | 72 | return ret; 73 | } 74 | 75 | 76 | /* Figure out what locking mechanisms are supported. 77 | */ 78 | static gboolean 79 | lock_initialization (char **nolock_reason) 80 | { 81 | if (nolock_reason) 82 | { 83 | *nolock_reason = NULL; 84 | } 85 | 86 | #ifdef NO_LOCKING 87 | if (nolock_reason) 88 | { 89 | *nolock_reason = g_strdup ("not compiled with locking support"); 90 | } 91 | return FALSE; 92 | #else /* !NO_LOCKING */ 93 | 94 | /* Finish initializing locking, now that we're out of privileged code. */ 95 | if (! gs_auth_init ()) 96 | { 97 | if (nolock_reason) 98 | { 99 | *nolock_reason = g_strdup ("error getting password"); 100 | } 101 | return FALSE; 102 | } 103 | 104 | /* If locking is currently enabled, but the environment indicates that 105 | we have been launched as MDM's "Background" program, then disable 106 | locking just in case. 107 | */ 108 | if (getenv ("RUNNING_UNDER_MDM")) 109 | { 110 | if (nolock_reason) 111 | { 112 | *nolock_reason = g_strdup ("running under MDM"); 113 | } 114 | return FALSE; 115 | } 116 | 117 | /* If the server is XDarwin (MacOS X) then disable locking. 118 | (X grabs only affect X programs, so you can use Command-Tab 119 | to bring any other Mac program to the front, e.g., Terminal.) 120 | */ 121 | { 122 | gboolean macos = FALSE; 123 | 124 | #ifdef __APPLE__ 125 | /* Disable locking if *running* on Apple hardware, since we have no 126 | reliable way to determine whether the server is running on MacOS. 127 | Hopefully __APPLE__ means "MacOS" and not "Linux on Mac hardware" 128 | but I'm not really sure about that. 129 | */ 130 | macos = TRUE; 131 | #endif 132 | 133 | if (macos) 134 | { 135 | if (nolock_reason) 136 | { 137 | *nolock_reason = g_strdup ("Cannot lock securely on MacOS X"); 138 | } 139 | return FALSE; 140 | } 141 | } 142 | 143 | #endif /* NO_LOCKING */ 144 | 145 | return TRUE; 146 | } 147 | 148 | static char * 149 | request_password (const char *prompt) 150 | { 151 | char buf [255]; 152 | char *pass; 153 | char *password; 154 | struct termios ts0; 155 | struct termios ts1; 156 | 157 | tcgetattr (fileno (stdin), &ts0); 158 | ts1 = ts0; 159 | ts1.c_lflag &= ~ECHO; 160 | 161 | printf ("%s", prompt); 162 | 163 | if (tcsetattr (fileno (stdin), TCSAFLUSH, &ts1) != 0) 164 | { 165 | fprintf (stderr, "Could not set terminal attributes\n"); 166 | exit (1); 167 | } 168 | 169 | pass = fgets (buf, sizeof (buf) - 1, stdin); 170 | 171 | tcsetattr (fileno (stdin), TCSANOW, &ts0); 172 | 173 | if (!pass || !*pass) 174 | { 175 | exit (0); 176 | } 177 | 178 | if (pass [strlen (pass) - 1] == '\n') 179 | { 180 | pass [strlen (pass) - 1] = 0; 181 | } 182 | 183 | password = g_strdup (pass); 184 | 185 | memset (pass, '\b', strlen (pass)); 186 | 187 | return password; 188 | } 189 | 190 | static gboolean 191 | auth_message_handler (GSAuthMessageStyle style, 192 | const char *msg, 193 | char **response, 194 | gpointer data) 195 | { 196 | gboolean ret; 197 | 198 | g_message ("Got message style %d: '%s'", style, msg); 199 | 200 | ret = TRUE; 201 | 202 | switch (style) 203 | { 204 | case GS_AUTH_MESSAGE_PROMPT_ECHO_ON: 205 | break; 206 | case GS_AUTH_MESSAGE_PROMPT_ECHO_OFF: 207 | { 208 | char *password; 209 | password = request_password (msg); 210 | *response = password; 211 | } 212 | break; 213 | case GS_AUTH_MESSAGE_ERROR_MSG: 214 | break; 215 | case GS_AUTH_MESSAGE_TEXT_INFO: 216 | break; 217 | default: 218 | g_assert_not_reached (); 219 | } 220 | 221 | return ret; 222 | } 223 | 224 | int 225 | main (int argc, 226 | char **argv) 227 | { 228 | GError *error = NULL; 229 | gboolean verbose = TRUE; 230 | char *nolock_reason = NULL; 231 | 232 | #ifdef ENABLE_NLS 233 | bindtextdomain (GETTEXT_PACKAGE, XFCELOCALEDIR); 234 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET 235 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 236 | # endif 237 | textdomain (GETTEXT_PACKAGE); 238 | #endif 239 | 240 | gs_auth_set_verbose (verbose); 241 | if (! privileged_initialization ()) 242 | { 243 | exit (1); 244 | } 245 | 246 | if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) 247 | { 248 | fprintf (stderr, "%s", error->message); 249 | g_error_free (error); 250 | exit (1); 251 | } 252 | 253 | if (! lock_initialization (&nolock_reason)) 254 | { 255 | if (nolock_reason) 256 | { 257 | g_warning ("Screen locking disabled: %s", nolock_reason); 258 | g_free (nolock_reason); 259 | } 260 | 261 | exit (1); 262 | } 263 | 264 | again: 265 | error = NULL; 266 | 267 | if (gs_auth_verify_user (g_get_user_name (), g_getenv ("DISPLAY"), auth_message_handler, NULL, &error)) 268 | { 269 | printf ("Correct!\n"); 270 | } 271 | else 272 | { 273 | if (error != NULL) 274 | { 275 | fprintf (stderr, "ERROR: %s\n", error->message); 276 | g_error_free (error); 277 | } 278 | printf ("Incorrect\n"); 279 | goto again; 280 | } 281 | 282 | return 0; 283 | } 284 | -------------------------------------------------------------------------------- /src/gs-auth-pwent.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (c) 1993-1998 Jamie Zawinski 4 | * Copyright (C) 2006 William Jon McCann 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of the 9 | * License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #ifdef HAVE_UNISTD_H 27 | # include 28 | #endif 29 | 30 | #ifdef HAVE_CRYPT_H 31 | # include 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __bsdi__ 41 | # include 42 | # if _BSDI_VERSION >= 199608 43 | # define BSD_AUTH 44 | # endif 45 | #endif /* __bsdi__ */ 46 | 47 | #include 48 | #include 49 | 50 | #if defined(HAVE_SHADOW_PASSWD) /* passwds live in /etc/shadow */ 51 | 52 | # include 53 | # define PWTYPE struct spwd * 54 | # define PWPSLOT sp_pwdp 55 | # define GETPW getspnam 56 | 57 | #elif defined(HAVE_ENHANCED_PASSWD) /* passwds live in /tcb/files/auth/ */ 58 | /* M.Matsumoto */ 59 | # include 60 | # include 61 | 62 | # define PWTYPE struct pr_passwd * 63 | # define PWPSLOT ufld.fd_encrypt 64 | # define GETPW getprpwnam 65 | 66 | #elif defined(HAVE_ADJUNCT_PASSWD) 67 | 68 | # include 69 | # include 70 | # include 71 | 72 | # define PWTYPE struct passwd_adjunct * 73 | # define PWPSLOT pwa_passwd 74 | # define GETPW getpwanam 75 | 76 | #elif defined(HAVE_HPUX_PASSWD) 77 | 78 | # include 79 | # include 80 | 81 | # define PWTYPE struct s_passwd * 82 | # define PWPSLOT pw_passwd 83 | # define GETPW getspwnam 84 | 85 | # define HAVE_BIGCRYPT 86 | 87 | #endif 88 | 89 | #include "gs-auth.h" 90 | 91 | static gboolean verbose_enabled = FALSE; 92 | 93 | static char *encrypted_user_passwd = NULL; 94 | 95 | GQuark 96 | gs_auth_error_quark (void) 97 | { 98 | static GQuark quark = 0; 99 | if (! quark) 100 | { 101 | quark = g_quark_from_static_string ("gs_auth_error"); 102 | } 103 | 104 | return quark; 105 | } 106 | 107 | void 108 | gs_auth_set_verbose (gboolean enabled) 109 | { 110 | verbose_enabled = enabled; 111 | } 112 | 113 | gboolean 114 | gs_auth_get_verbose (void) 115 | { 116 | return verbose_enabled; 117 | } 118 | 119 | static gboolean 120 | passwd_known (const char *pw) 121 | { 122 | return (pw && 123 | pw[0] != '*' && /* This would be sensible... */ 124 | strlen (pw) > 4); /* ...but this is what Solaris does. */ 125 | } 126 | 127 | static char * 128 | get_encrypted_passwd (const char *user) 129 | { 130 | char *result = NULL; 131 | 132 | #ifdef PWTYPE 133 | if (user && *user && !result) 134 | { 135 | /* First check the shadow passwords. */ 136 | PWTYPE p = GETPW ((char *) user); 137 | if (p && passwd_known (p->PWPSLOT)) 138 | { 139 | result = g_strdup (p->PWPSLOT); 140 | } 141 | } 142 | #endif /* PWTYPE */ 143 | 144 | if (user && *user && !result) 145 | { 146 | /* Check non-shadow passwords too. */ 147 | struct passwd *p = getpwnam (user); 148 | if (p && passwd_known (p->pw_passwd)) 149 | { 150 | result = g_strdup (p->pw_passwd); 151 | } 152 | } 153 | 154 | /* The manual for passwd(4) on HPUX 10.10 says: 155 | 156 | Password aging is put in effect for a particular user if his 157 | encrypted password in the password file is followed by a comma and 158 | a nonnull string of characters from the above alphabet. This 159 | string defines the "age" needed to implement password aging. 160 | 161 | So this means that passwd->pw_passwd isn't simply a string of cyphertext, 162 | it might have trailing junk. So, if there is a comma in the string, and 163 | that comma is beyond position 13, terminate the string before the comma. 164 | */ 165 | if (result && strlen (result) > 13) 166 | { 167 | char *s = strchr (result + 13, ','); 168 | if (s) 169 | { 170 | *s = 0; 171 | } 172 | } 173 | 174 | #if !defined(HAVE_PAM) && !defined(HAVE_BSDAUTH) 175 | /* We only issue this warning if not compiled with support for PAM, 176 | or bsd_auth(3). If we're using PAM, it's not unheard of that 177 | normal pwent passwords would be unavailable. */ 178 | 179 | if (!result) 180 | { 181 | g_warning ("Couldn't get password of \"%s\"", 182 | (user ? user : "(null)")); 183 | } 184 | 185 | #endif /* !HAVE_PAM */ 186 | 187 | return result; 188 | } 189 | 190 | /* This has to be called before we've changed our effective user ID, 191 | because it might need privileges to get at the encrypted passwords. 192 | Returns false if we weren't able to get any passwords, and therefore, 193 | locking isn't possible. (It will also have written to stderr.) 194 | */ 195 | 196 | gboolean 197 | gs_auth_priv_init (void) 198 | { 199 | const char *u; 200 | 201 | u = g_get_user_name (); 202 | 203 | encrypted_user_passwd = get_encrypted_passwd (u); 204 | 205 | if (encrypted_user_passwd != NULL) 206 | { 207 | return TRUE; 208 | } 209 | else 210 | { 211 | return FALSE; 212 | } 213 | } 214 | 215 | 216 | gboolean 217 | gs_auth_init (void) 218 | { 219 | if (encrypted_user_passwd != NULL) 220 | { 221 | return TRUE; 222 | } 223 | else 224 | { 225 | return FALSE; 226 | } 227 | } 228 | 229 | static gboolean 230 | passwds_match (const char *cleartext, 231 | const char *ciphertext) 232 | { 233 | char *s = NULL; /* note that on some systems, crypt() may return null */ 234 | 235 | s = (char *) crypt (cleartext, ciphertext); 236 | if (s && !strcmp (s, ciphertext)) 237 | { 238 | return TRUE; 239 | } 240 | 241 | #ifdef HAVE_BIGCRYPT 242 | /* There seems to be no way to tell at runtime if an HP machine is in 243 | "trusted" mode, and thereby, which of crypt() or bigcrypt() we should 244 | be calling to compare passwords. So call them both, and see which 245 | one works. */ 246 | 247 | s = (char *) bigcrypt (cleartext, ciphertext); 248 | if (s && !strcmp (s, ciphertext)) 249 | { 250 | return TRUE; 251 | } 252 | 253 | #endif /* HAVE_BIGCRYPT */ 254 | 255 | return FALSE; 256 | } 257 | 258 | gboolean 259 | gs_auth_verify_user (const char *username, 260 | const char *display, 261 | GSAuthMessageFunc func, 262 | gpointer data, 263 | GError **error) 264 | { 265 | char *password; 266 | 267 | password = NULL; 268 | 269 | /* ask for the password for user */ 270 | if (func != NULL) 271 | { 272 | func (GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, 273 | "Password: ", 274 | &password, 275 | data); 276 | } 277 | 278 | if (password == NULL) 279 | { 280 | return FALSE; 281 | } 282 | 283 | if (encrypted_user_passwd && passwds_match (password, encrypted_user_passwd)) 284 | { 285 | return TRUE; 286 | } 287 | else 288 | { 289 | return FALSE; 290 | } 291 | } 292 | -------------------------------------------------------------------------------- /src/gs-prefs.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright (C) 2004-2006 William Jon McCann 4 | * Copyright (C) 2018 Sean Davis 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Authors: William Jon McCann 21 | * 22 | */ 23 | 24 | #ifndef __GS_PREFS_H 25 | #define __GS_PREFS_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GS_TYPE_PREFS (gs_prefs_get_type ()) 32 | #define GS_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_PREFS, GSPrefs)) 33 | #define GS_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_PREFS, GSPrefsClass)) 34 | #define GS_IS_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_PREFS)) 35 | #define GS_IS_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_PREFS)) 36 | #define GS_PREFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_PREFS, GSPrefsClass)) 37 | 38 | #define SETTINGS_XFCONF_CHANNEL "xfce4-screensaver" 39 | 40 | /** 41 | * Screensaver theme selection mode 42 | * The selection mode used by screensaver. May be "blank-only" to enable the screensaver 43 | * without using any theme on activation, "single" to enable screensaver using only one 44 | * theme on activation (specified in "themes" key), and "random" to enable the screensaver 45 | * using a random theme on activation. 46 | */ 47 | #define KEY_MODE "/mode" 48 | #define DEFAULT_KEY_MODE 0 49 | 50 | /** 51 | * Time before session is considered idle 52 | * The number of minutes of inactivity before the session is considered idle. 53 | */ 54 | #define KEY_IDLE_DELAY "/idle-delay" 55 | #define DEFAULT_KEY_IDLE_DELAY 5 56 | 57 | /** 58 | * Time before power management baseline 59 | * The number of seconds of inactivity before signalling to power management. 60 | * This key is set and maintained by the session power management agent. 61 | */ 62 | #define KEY_POWER_DELAY "/power-management-delay" 63 | #define DEFAULT_KEY_POWER_DELAY 30 64 | 65 | /** 66 | * Time before locking 67 | * The number of minutes after screensaver activation before locking the screen. 68 | */ 69 | #define KEY_LOCK_DELAY "/lock-delay" 70 | #define DEFAULT_KEY_LOCK_DELAY 0 71 | 72 | /** 73 | * Activate when idle 74 | * Set this to TRUE to activate the screensaver when the session is idle. 75 | */ 76 | #define KEY_IDLE_ACTIVATION_ENABLED "/idle-activation-enabled" 77 | #define DEFAULT_KEY_IDLE_ACTIVATION_ENABLED TRUE 78 | 79 | /** 80 | * Lock on activation 81 | * Set this to TRUE to lock the screen when the screensaver goes active. 82 | */ 83 | #define KEY_LOCK_ENABLED "/lock-enabled" 84 | #define DEFAULT_KEY_LOCK_ENABLED TRUE 85 | 86 | /** 87 | * Time before theme change 88 | * The number of minutes to run before changing the screensaver theme. 89 | */ 90 | #define KEY_CYCLE_DELAY "/cycle-delay" 91 | #define DEFAULT_KEY_CYCLE_DELAY 10 92 | 93 | /** 94 | * Allow embedding a keyboard into the window 95 | * Set this to TRUE to allow embedding a keyboard into the window when trying to unlock. 96 | * The "keyboard_command" key must be set with the appropriate command. 97 | */ 98 | #define KEY_KEYBOARD_ENABLED "/embedded-keyboard-enabled" 99 | #define DEFAULT_KEY_KEYBOARD_ENABLED FALSE 100 | 101 | /** 102 | * Embedded keyboard command 103 | * The command that will be run, if the "embedded_keyboard_enabled" key is set to TRUE, 104 | * to embed a keyboard widget into the window. This command should implement an XEMBED 105 | * plug interface and output a window XID on the standard output. 106 | */ 107 | #define KEY_KEYBOARD_COMMAND "/embedded-keyboard-command" 108 | #define DEFAULT_KEY_KEYBOARD_COMMAND "" 109 | 110 | /** 111 | * Allow the session status message to be displayed 112 | * Allow the session status message to be displayed when the screen is locked. 113 | */ 114 | #define KEY_STATUS_MESSAGE_ENABLED "/status-message-enabled" 115 | #define DEFAULT_KEY_STATUS_MESSAGE_ENABLED TRUE 116 | 117 | /** 118 | * Allow logout 119 | * Set this to TRUE to offer an option in the unlock dialog to allow logging out after a 120 | * delay. The delay is specified in the "logout_delay" key. 121 | */ 122 | #define KEY_LOGOUT_ENABLED "/logout-enabled" 123 | #define DEFAULT_KEY_LOGOUT_ENABLED FALSE 124 | 125 | /** 126 | * Time before logout option 127 | * The number of minutes after the screensaver activation before a logout option will 128 | * appear in the unlock dialog. This key has effect only if the "logout_enable" key is 129 | * set to TRUE. 130 | */ 131 | #define KEY_LOGOUT_DELAY "/logout-delay" 132 | #define DEFAULT_KEY_LOGOUT_DELAY 120 133 | 134 | /** 135 | * Logout command 136 | * The command to invoke when the logout button is clicked. This command should simply 137 | * log the user out without any interaction. This key has effect only if the 138 | * "logout_enable" key is set to TRUE. 139 | */ 140 | #define KEY_LOGOUT_COMMAND "/logout-command" 141 | #define DEFAULT_KEY_LOGOUT_COMMAND "" 142 | 143 | /** 144 | * Allow user switching 145 | * Set this to TRUE to offer an option in the unlock dialog to switch to a different 146 | * user account. 147 | */ 148 | #define KEY_USER_SWITCH_ENABLED "/user-switch-enabled" 149 | #define DEFAULT_KEY_USER_SWITCH_ENABLED TRUE 150 | 151 | /** 152 | * Screensaver themes 153 | * This key specifies the list of themes to be used by the screensaver. It's ignored 154 | * when "mode" key is "blank-only", should provide the theme name when "mode" is "single", 155 | * and should provide a list of themes when "mode" is "random". 156 | */ 157 | #define KEY_THEMES "/themes" 158 | 159 | typedef enum 160 | { 161 | GS_MODE_BLANK_ONLY, 162 | GS_MODE_RANDOM, 163 | GS_MODE_SINGLE 164 | } GSSaverMode; 165 | 166 | typedef struct GSPrefsPrivate GSPrefsPrivate; 167 | 168 | typedef struct 169 | { 170 | GObject parent; 171 | 172 | GSPrefsPrivate *priv; 173 | 174 | guint idle_activation_enabled : 1; /* whether to activate when idle */ 175 | guint lock_enabled : 1; /* whether to lock when active */ 176 | guint logout_enabled : 1; /* Whether to offer the logout option */ 177 | guint user_switch_enabled : 1; /* Whether to offer the user switch option */ 178 | guint keyboard_enabled : 1; /* Whether to try to embed a keyboard */ 179 | guint status_message_enabled : 1; /* show the status message in the lock */ 180 | guint power_timeout; /* how much idle time before power management */ 181 | guint timeout; /* how much idle time before activation */ 182 | guint lock_timeout; /* how long after activation locking starts */ 183 | guint logout_timeout; /* how long until the logout option appears */ 184 | guint cycle; /* how long each theme should run */ 185 | 186 | char *logout_command; /* command to use to logout */ 187 | char *keyboard_command; /* command to use to embed a keyboard */ 188 | 189 | GSList *themes; /* the screensaver themes to run */ 190 | GSSaverMode mode; /* theme selection mode */ 191 | } GSPrefs; 192 | 193 | typedef struct 194 | { 195 | GObjectClass parent_class; 196 | 197 | void (* changed) (GSPrefs *prefs); 198 | } GSPrefsClass; 199 | 200 | GType gs_prefs_get_type (void); 201 | GSPrefs * gs_prefs_new (void); 202 | void gs_prefs_load (GSPrefs *prefs); 203 | 204 | G_END_DECLS 205 | 206 | #endif /* __GS_PREFS_H */ 207 | --------------------------------------------------------------------------------