diff options
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Makefile.am | 96 | ||||
-rw-r--r-- | settings/Makefile.in | 1037 | ||||
-rw-r--r-- | settings/main.c | 255 | ||||
-rw-r--r-- | settings/session-editor.c | 904 | ||||
-rw-r--r-- | settings/xfae-dialog.c | 298 | ||||
-rw-r--r-- | settings/xfae-dialog.h | 55 | ||||
-rw-r--r-- | settings/xfae-model.c | 1282 | ||||
-rw-r--r-- | settings/xfae-model.h | 119 | ||||
-rw-r--r-- | settings/xfae-window.c | 548 | ||||
-rw-r--r-- | settings/xfae-window.h | 46 | ||||
-rw-r--r-- | settings/xfce-session-settings.desktop.in | 14 | ||||
-rw-r--r-- | settings/xfce4-session-marshal.c | 124 | ||||
-rw-r--r-- | settings/xfce4-session-marshal.h | 30 | ||||
-rw-r--r-- | settings/xfce4-session-settings-common.h | 26 | ||||
-rw-r--r-- | settings/xfce4-session-settings.ui | 902 | ||||
-rw-r--r-- | settings/xfce4-session-settings_ui.h | 435 | ||||
-rw-r--r-- | settings/xfce4-session.xml | 40 | ||||
-rw-r--r-- | settings/xfsm-client-dbus-client.c | 2905 | ||||
-rw-r--r-- | settings/xfsm-client-dbus-client.h | 431 | ||||
-rw-r--r-- | settings/xfsm-manager-dbus-client.c | 4263 | ||||
-rw-r--r-- | settings/xfsm-manager-dbus-client.h | 669 |
21 files changed, 14479 insertions, 0 deletions
diff --git a/settings/Makefile.am b/settings/Makefile.am new file mode 100644 index 0000000..c82efc1 --- /dev/null +++ b/settings/Makefile.am @@ -0,0 +1,96 @@ +bin_PROGRAMS = xfce4-session-settings + +xfce4_session_settings_SOURCES = \ + main.c \ + session-editor.c \ + xfae-dialog.c \ + xfae-dialog.h \ + xfae-model.c \ + xfae-model.h \ + xfae-window.c \ + xfae-window.h \ + xfce4-session-marshal.c \ + xfce4-session-marshal.h \ + xfce4-session-settings-common.h \ + xfce4-session-settings_ui.h \ + xfsm-client-dbus-client.h \ + xfsm-client-dbus-client.c \ + xfsm-manager-dbus-client.h \ + xfsm-manager-dbus-client.c + +xfce4_session_settings_CFLAGS = \ + -DLOCALEDIR=\"$(localedir)\" \ + -DG_LOG_DOMAIN=\"xfce4-session-settings\" \ + -I$(top_srcdir) \ + -I$(top_srcdir)/libxfsm \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBXFCE4UI_CFLAGS) \ + $(XFCONF_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GMODULE_CFLAGS) + +xfce4_session_settings_LDADD = \ + $(top_builddir)/libxfsm/libxfsm.la \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBXFCE4UI_LIBS) \ + $(XFCONF_LIBS) \ + $(GIO_LIBS) \ + $(GMODULE_LIBS) + +settingsdir = $(sysconfdir)/xdg/xfce4/xfconf/xfce-perchannel-xml +settings_DATA = xfce4-session.xml + +desktopdir = $(datadir)/applications +desktop_in_files = xfce-session-settings.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) + +@INTLTOOL_DESKTOP_RULE@ + + +if MAINTAINER_MODE + +BUILT_SOURCES = \ + xfce4-session-marshal.c \ + xfce4-session-marshal.h \ + xfce4-session-settings_ui.h \ + xfsm-client-dbus-client.h \ + xfsm-client-dbus-client.c \ + xfsm-manager-dbus-client.h \ + xfsm-manager-dbus-client.c + +xfce4-session-marshal.h: stamp-xfce4-session-marshal.h + @true +stamp-xfce4-session-marshal.h: xfce4-session-marshal.list Makefile + $(AM_V_GEN) glib-genmarshal --prefix=xfce4_session_marshal xfce4-session-marshal.list --header > xfce4-session-marshal.h + echo timestamp > $(@F) +xfce4-session-marshal.c: xfce4-session-marshal.list Makefile + $(AM_V_GEN) echo '#include "xfce4-session-marshal.h"' > $@ + glib-genmarshal --prefix=xfce4_session_marshal xfce4-session-marshal.list --body >> xfce4-session-marshal.c + +xfce4-session-settings_ui.h: xfce4-session-settings.ui + $(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=xfce4_session_settings_ui $< >$@ + +xfsm-client-dbus-client.c xfsm-client-dbus-client.h : $(top_srcdir)/xfce4-session/xfsm-client-dbus.xml Makefile.am + gdbus-codegen \ + --c-namespace=Xfsm \ + --interface-prefix=org.xfce.Session. \ + --generate-c-code=xfsm-client-dbus-client \ + $(top_srcdir)/xfce4-session/xfsm-client-dbus.xml + +xfsm-manager-dbus-client.c xfsm-manager-dbus-client.h : $(top_srcdir)/xfce4-session/xfsm-manager-dbus.xml Makefile.am + gdbus-codegen \ + --c-namespace=Xfsm \ + --interface-prefix=org.xfce.Session. \ + --generate-c-code=xfsm-manager-dbus-client \ + $(top_srcdir)/xfce4-session/xfsm-manager-dbus.xml + +endif + + +EXTRA_DIST = \ + $(desktop_in_files) \ + xfce4-session.xml \ + xfce4-session-settings.ui + +DISTCLEANFILES = \ + $(desktop_DATA) diff --git a/settings/Makefile.in b/settings/Makefile.in new file mode 100644 index 0000000..7cc5bb4 --- /dev/null +++ b/settings/Makefile.in @@ -0,0 +1,1037 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = xfce4-session-settings$(EXEEXT) +subdir = settings +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)" \ + "$(DESTDIR)$(settingsdir)" +PROGRAMS = $(bin_PROGRAMS) +am_xfce4_session_settings_OBJECTS = \ + xfce4_session_settings-main.$(OBJEXT) \ + xfce4_session_settings-session-editor.$(OBJEXT) \ + xfce4_session_settings-xfae-dialog.$(OBJEXT) \ + xfce4_session_settings-xfae-model.$(OBJEXT) \ + xfce4_session_settings-xfae-window.$(OBJEXT) \ + xfce4_session_settings-xfce4-session-marshal.$(OBJEXT) \ + xfce4_session_settings-xfsm-client-dbus-client.$(OBJEXT) \ + xfce4_session_settings-xfsm-manager-dbus-client.$(OBJEXT) +xfce4_session_settings_OBJECTS = $(am_xfce4_session_settings_OBJECTS) +am__DEPENDENCIES_1 = +xfce4_session_settings_DEPENDENCIES = \ + $(top_builddir)/libxfsm/libxfsm.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +xfce4_session_settings_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(xfce4_session_settings_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/xfce4_session_settings-main.Po \ + ./$(DEPDIR)/xfce4_session_settings-session-editor.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfae-dialog.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfae-model.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfae-window.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po \ + ./$(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(xfce4_session_settings_SOURCES) +DIST_SOURCES = $(xfce4_session_settings_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +DATA = $(desktop_DATA) $(settings_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BACKEND = @BACKEND@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_REQUIRED_VERSION = @GIO_REQUIRED_VERSION@ +GIO_VERSION = @GIO_VERSION@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMODULE_REQUIRED_VERSION = @GMODULE_REQUIRED_VERSION@ +GMODULE_VERSION = @GMODULE_VERSION@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@ +GTK_VERSION = @GTK_VERSION@ +HELPER_PATH_PREFIX = @HELPER_PATH_PREFIX@ +ICEAUTH = @ICEAUTH@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSM_CFLAGS = @LIBSM_CFLAGS@ +LIBSM_LDFLAGS = @LIBSM_LDFLAGS@ +LIBSM_LIBS = @LIBSM_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBWNCK_CFLAGS = @LIBWNCK_CFLAGS@ +LIBWNCK_LIBS = @LIBWNCK_LIBS@ +LIBWNCK_REQUIRED_VERSION = @LIBWNCK_REQUIRED_VERSION@ +LIBWNCK_VERSION = @LIBWNCK_VERSION@ +LIBX11_CFLAGS = @LIBX11_CFLAGS@ +LIBX11_LDFLAGS = @LIBX11_LDFLAGS@ +LIBX11_LIBS = @LIBX11_LIBS@ +LIBXFCE4UI_CFLAGS = @LIBXFCE4UI_CFLAGS@ +LIBXFCE4UI_LIBS = @LIBXFCE4UI_LIBS@ +LIBXFCE4UI_REQUIRED_VERSION = @LIBXFCE4UI_REQUIRED_VERSION@ +LIBXFCE4UI_VERSION = @LIBXFCE4UI_VERSION@ +LIBXFCE4UTIL_CFLAGS = @LIBXFCE4UTIL_CFLAGS@ +LIBXFCE4UTIL_LIBS = @LIBXFCE4UTIL_LIBS@ +LIBXFCE4UTIL_REQUIRED_VERSION = @LIBXFCE4UTIL_REQUIRED_VERSION@ +LIBXFCE4UTIL_VERSION = @LIBXFCE4UTIL_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POLKIT_REQUIRED_VERSION = @POLKIT_REQUIRED_VERSION@ +POLKIT_VERSION = @POLKIT_VERSION@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XFCONF_CFLAGS = @XFCONF_CFLAGS@ +XFCONF_LIBS = @XFCONF_LIBS@ +XFCONF_REQUIRED_VERSION = @XFCONF_REQUIRED_VERSION@ +XFCONF_VERSION = @XFCONF_VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_ARGS = @XGETTEXT_ARGS@ +XMKMF = @XMKMF@ +XSESSION_PREFIX = @XSESSION_PREFIX@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xfce4_session_settings_SOURCES = \ + main.c \ + session-editor.c \ + xfae-dialog.c \ + xfae-dialog.h \ + xfae-model.c \ + xfae-model.h \ + xfae-window.c \ + xfae-window.h \ + xfce4-session-marshal.c \ + xfce4-session-marshal.h \ + xfce4-session-settings-common.h \ + xfce4-session-settings_ui.h \ + xfsm-client-dbus-client.h \ + xfsm-client-dbus-client.c \ + xfsm-manager-dbus-client.h \ + xfsm-manager-dbus-client.c + +xfce4_session_settings_CFLAGS = \ + -DLOCALEDIR=\"$(localedir)\" \ + -DG_LOG_DOMAIN=\"xfce4-session-settings\" \ + -I$(top_srcdir) \ + -I$(top_srcdir)/libxfsm \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBXFCE4UI_CFLAGS) \ + $(XFCONF_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GMODULE_CFLAGS) + +xfce4_session_settings_LDADD = \ + $(top_builddir)/libxfsm/libxfsm.la \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBXFCE4UI_LIBS) \ + $(XFCONF_LIBS) \ + $(GIO_LIBS) \ + $(GMODULE_LIBS) + +settingsdir = $(sysconfdir)/xdg/xfce4/xfconf/xfce-perchannel-xml +settings_DATA = xfce4-session.xml +desktopdir = $(datadir)/applications +desktop_in_files = xfce-session-settings.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +@MAINTAINER_MODE_TRUE@BUILT_SOURCES = \ +@MAINTAINER_MODE_TRUE@ xfce4-session-marshal.c \ +@MAINTAINER_MODE_TRUE@ xfce4-session-marshal.h \ +@MAINTAINER_MODE_TRUE@ xfce4-session-settings_ui.h \ +@MAINTAINER_MODE_TRUE@ xfsm-client-dbus-client.h \ +@MAINTAINER_MODE_TRUE@ xfsm-client-dbus-client.c \ +@MAINTAINER_MODE_TRUE@ xfsm-manager-dbus-client.h \ +@MAINTAINER_MODE_TRUE@ xfsm-manager-dbus-client.c + +EXTRA_DIST = \ + $(desktop_in_files) \ + xfce4-session.xml \ + xfce4-session-settings.ui + +DISTCLEANFILES = \ + $(desktop_DATA) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign settings/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign settings/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +xfce4-session-settings$(EXEEXT): $(xfce4_session_settings_OBJECTS) $(xfce4_session_settings_DEPENDENCIES) $(EXTRA_xfce4_session_settings_DEPENDENCIES) + @rm -f xfce4-session-settings$(EXEEXT) + $(AM_V_CCLD)$(xfce4_session_settings_LINK) $(xfce4_session_settings_OBJECTS) $(xfce4_session_settings_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-session-editor.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfae-dialog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfae-model.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfae-window.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +xfce4_session_settings-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-main.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-main.Tpo -c -o xfce4_session_settings-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-main.Tpo $(DEPDIR)/xfce4_session_settings-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='xfce4_session_settings-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +xfce4_session_settings-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-main.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-main.Tpo -c -o xfce4_session_settings-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-main.Tpo $(DEPDIR)/xfce4_session_settings-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='xfce4_session_settings-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +xfce4_session_settings-session-editor.o: session-editor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-session-editor.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-session-editor.Tpo -c -o xfce4_session_settings-session-editor.o `test -f 'session-editor.c' || echo '$(srcdir)/'`session-editor.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-session-editor.Tpo $(DEPDIR)/xfce4_session_settings-session-editor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='session-editor.c' object='xfce4_session_settings-session-editor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-session-editor.o `test -f 'session-editor.c' || echo '$(srcdir)/'`session-editor.c + +xfce4_session_settings-session-editor.obj: session-editor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-session-editor.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-session-editor.Tpo -c -o xfce4_session_settings-session-editor.obj `if test -f 'session-editor.c'; then $(CYGPATH_W) 'session-editor.c'; else $(CYGPATH_W) '$(srcdir)/session-editor.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-session-editor.Tpo $(DEPDIR)/xfce4_session_settings-session-editor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='session-editor.c' object='xfce4_session_settings-session-editor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-session-editor.obj `if test -f 'session-editor.c'; then $(CYGPATH_W) 'session-editor.c'; else $(CYGPATH_W) '$(srcdir)/session-editor.c'; fi` + +xfce4_session_settings-xfae-dialog.o: xfae-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-dialog.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-dialog.Tpo -c -o xfce4_session_settings-xfae-dialog.o `test -f 'xfae-dialog.c' || echo '$(srcdir)/'`xfae-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-dialog.Tpo $(DEPDIR)/xfce4_session_settings-xfae-dialog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-dialog.c' object='xfce4_session_settings-xfae-dialog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-dialog.o `test -f 'xfae-dialog.c' || echo '$(srcdir)/'`xfae-dialog.c + +xfce4_session_settings-xfae-dialog.obj: xfae-dialog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-dialog.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-dialog.Tpo -c -o xfce4_session_settings-xfae-dialog.obj `if test -f 'xfae-dialog.c'; then $(CYGPATH_W) 'xfae-dialog.c'; else $(CYGPATH_W) '$(srcdir)/xfae-dialog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-dialog.Tpo $(DEPDIR)/xfce4_session_settings-xfae-dialog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-dialog.c' object='xfce4_session_settings-xfae-dialog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-dialog.obj `if test -f 'xfae-dialog.c'; then $(CYGPATH_W) 'xfae-dialog.c'; else $(CYGPATH_W) '$(srcdir)/xfae-dialog.c'; fi` + +xfce4_session_settings-xfae-model.o: xfae-model.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-model.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-model.Tpo -c -o xfce4_session_settings-xfae-model.o `test -f 'xfae-model.c' || echo '$(srcdir)/'`xfae-model.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-model.Tpo $(DEPDIR)/xfce4_session_settings-xfae-model.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-model.c' object='xfce4_session_settings-xfae-model.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-model.o `test -f 'xfae-model.c' || echo '$(srcdir)/'`xfae-model.c + +xfce4_session_settings-xfae-model.obj: xfae-model.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-model.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-model.Tpo -c -o xfce4_session_settings-xfae-model.obj `if test -f 'xfae-model.c'; then $(CYGPATH_W) 'xfae-model.c'; else $(CYGPATH_W) '$(srcdir)/xfae-model.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-model.Tpo $(DEPDIR)/xfce4_session_settings-xfae-model.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-model.c' object='xfce4_session_settings-xfae-model.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-model.obj `if test -f 'xfae-model.c'; then $(CYGPATH_W) 'xfae-model.c'; else $(CYGPATH_W) '$(srcdir)/xfae-model.c'; fi` + +xfce4_session_settings-xfae-window.o: xfae-window.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-window.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-window.Tpo -c -o xfce4_session_settings-xfae-window.o `test -f 'xfae-window.c' || echo '$(srcdir)/'`xfae-window.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-window.Tpo $(DEPDIR)/xfce4_session_settings-xfae-window.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-window.c' object='xfce4_session_settings-xfae-window.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-window.o `test -f 'xfae-window.c' || echo '$(srcdir)/'`xfae-window.c + +xfce4_session_settings-xfae-window.obj: xfae-window.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfae-window.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfae-window.Tpo -c -o xfce4_session_settings-xfae-window.obj `if test -f 'xfae-window.c'; then $(CYGPATH_W) 'xfae-window.c'; else $(CYGPATH_W) '$(srcdir)/xfae-window.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfae-window.Tpo $(DEPDIR)/xfce4_session_settings-xfae-window.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfae-window.c' object='xfce4_session_settings-xfae-window.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfae-window.obj `if test -f 'xfae-window.c'; then $(CYGPATH_W) 'xfae-window.c'; else $(CYGPATH_W) '$(srcdir)/xfae-window.c'; fi` + +xfce4_session_settings-xfce4-session-marshal.o: xfce4-session-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfce4-session-marshal.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Tpo -c -o xfce4_session_settings-xfce4-session-marshal.o `test -f 'xfce4-session-marshal.c' || echo '$(srcdir)/'`xfce4-session-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Tpo $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfce4-session-marshal.c' object='xfce4_session_settings-xfce4-session-marshal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfce4-session-marshal.o `test -f 'xfce4-session-marshal.c' || echo '$(srcdir)/'`xfce4-session-marshal.c + +xfce4_session_settings-xfce4-session-marshal.obj: xfce4-session-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfce4-session-marshal.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Tpo -c -o xfce4_session_settings-xfce4-session-marshal.obj `if test -f 'xfce4-session-marshal.c'; then $(CYGPATH_W) 'xfce4-session-marshal.c'; else $(CYGPATH_W) '$(srcdir)/xfce4-session-marshal.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Tpo $(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfce4-session-marshal.c' object='xfce4_session_settings-xfce4-session-marshal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfce4-session-marshal.obj `if test -f 'xfce4-session-marshal.c'; then $(CYGPATH_W) 'xfce4-session-marshal.c'; else $(CYGPATH_W) '$(srcdir)/xfce4-session-marshal.c'; fi` + +xfce4_session_settings-xfsm-client-dbus-client.o: xfsm-client-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfsm-client-dbus-client.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Tpo -c -o xfce4_session_settings-xfsm-client-dbus-client.o `test -f 'xfsm-client-dbus-client.c' || echo '$(srcdir)/'`xfsm-client-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Tpo $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfsm-client-dbus-client.c' object='xfce4_session_settings-xfsm-client-dbus-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfsm-client-dbus-client.o `test -f 'xfsm-client-dbus-client.c' || echo '$(srcdir)/'`xfsm-client-dbus-client.c + +xfce4_session_settings-xfsm-client-dbus-client.obj: xfsm-client-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfsm-client-dbus-client.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Tpo -c -o xfce4_session_settings-xfsm-client-dbus-client.obj `if test -f 'xfsm-client-dbus-client.c'; then $(CYGPATH_W) 'xfsm-client-dbus-client.c'; else $(CYGPATH_W) '$(srcdir)/xfsm-client-dbus-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Tpo $(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfsm-client-dbus-client.c' object='xfce4_session_settings-xfsm-client-dbus-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfsm-client-dbus-client.obj `if test -f 'xfsm-client-dbus-client.c'; then $(CYGPATH_W) 'xfsm-client-dbus-client.c'; else $(CYGPATH_W) '$(srcdir)/xfsm-client-dbus-client.c'; fi` + +xfce4_session_settings-xfsm-manager-dbus-client.o: xfsm-manager-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfsm-manager-dbus-client.o -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Tpo -c -o xfce4_session_settings-xfsm-manager-dbus-client.o `test -f 'xfsm-manager-dbus-client.c' || echo '$(srcdir)/'`xfsm-manager-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Tpo $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfsm-manager-dbus-client.c' object='xfce4_session_settings-xfsm-manager-dbus-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfsm-manager-dbus-client.o `test -f 'xfsm-manager-dbus-client.c' || echo '$(srcdir)/'`xfsm-manager-dbus-client.c + +xfce4_session_settings-xfsm-manager-dbus-client.obj: xfsm-manager-dbus-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -MT xfce4_session_settings-xfsm-manager-dbus-client.obj -MD -MP -MF $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Tpo -c -o xfce4_session_settings-xfsm-manager-dbus-client.obj `if test -f 'xfsm-manager-dbus-client.c'; then $(CYGPATH_W) 'xfsm-manager-dbus-client.c'; else $(CYGPATH_W) '$(srcdir)/xfsm-manager-dbus-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Tpo $(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfsm-manager-dbus-client.c' object='xfce4_session_settings-xfsm-manager-dbus-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_session_settings_CFLAGS) $(CFLAGS) -c -o xfce4_session_settings-xfsm-manager-dbus-client.obj `if test -f 'xfsm-manager-dbus-client.c'; then $(CYGPATH_W) 'xfsm-manager-dbus-client.c'; else $(CYGPATH_W) '$(srcdir)/xfsm-manager-dbus-client.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-desktopDATA: $(desktop_DATA) + @$(NORMAL_INSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(desktopdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ + done + +uninstall-desktopDATA: + @$(NORMAL_UNINSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) +install-settingsDATA: $(settings_DATA) + @$(NORMAL_INSTALL) + @list='$(settings_DATA)'; test -n "$(settingsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(settingsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(settingsdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(settingsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(settingsdir)" || exit $$?; \ + done + +uninstall-settingsDATA: + @$(NORMAL_UNINSTALL) + @list='$(settings_DATA)'; test -n "$(settingsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(settingsdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(settingsdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/xfce4_session_settings-main.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-session-editor.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-dialog.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-model.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-window.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-desktopDATA install-settingsDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/xfce4_session_settings-main.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-session-editor.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-dialog.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-model.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfae-window.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfce4-session-marshal.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfsm-client-dbus-client.Po + -rm -f ./$(DEPDIR)/xfce4_session_settings-xfsm-manager-dbus-client.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-desktopDATA \ + uninstall-settingsDATA + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-desktopDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-settingsDATA install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-desktopDATA uninstall-settingsDATA + +.PRECIOUS: Makefile + + +@INTLTOOL_DESKTOP_RULE@ + +@MAINTAINER_MODE_TRUE@xfce4-session-marshal.h: stamp-xfce4-session-marshal.h +@MAINTAINER_MODE_TRUE@ @true +@MAINTAINER_MODE_TRUE@stamp-xfce4-session-marshal.h: xfce4-session-marshal.list Makefile +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) glib-genmarshal --prefix=xfce4_session_marshal xfce4-session-marshal.list --header > xfce4-session-marshal.h +@MAINTAINER_MODE_TRUE@ echo timestamp > $(@F) +@MAINTAINER_MODE_TRUE@xfce4-session-marshal.c: xfce4-session-marshal.list Makefile +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) echo '#include "xfce4-session-marshal.h"' > $@ +@MAINTAINER_MODE_TRUE@ glib-genmarshal --prefix=xfce4_session_marshal xfce4-session-marshal.list --body >> xfce4-session-marshal.c + +@MAINTAINER_MODE_TRUE@xfce4-session-settings_ui.h: xfce4-session-settings.ui +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=xfce4_session_settings_ui $< >$@ + +@MAINTAINER_MODE_TRUE@xfsm-client-dbus-client.c xfsm-client-dbus-client.h : $(top_srcdir)/xfce4-session/xfsm-client-dbus.xml Makefile.am +@MAINTAINER_MODE_TRUE@ gdbus-codegen \ +@MAINTAINER_MODE_TRUE@ --c-namespace=Xfsm \ +@MAINTAINER_MODE_TRUE@ --interface-prefix=org.xfce.Session. \ +@MAINTAINER_MODE_TRUE@ --generate-c-code=xfsm-client-dbus-client \ +@MAINTAINER_MODE_TRUE@ $(top_srcdir)/xfce4-session/xfsm-client-dbus.xml + +@MAINTAINER_MODE_TRUE@xfsm-manager-dbus-client.c xfsm-manager-dbus-client.h : $(top_srcdir)/xfce4-session/xfsm-manager-dbus.xml Makefile.am +@MAINTAINER_MODE_TRUE@ gdbus-codegen \ +@MAINTAINER_MODE_TRUE@ --c-namespace=Xfsm \ +@MAINTAINER_MODE_TRUE@ --interface-prefix=org.xfce.Session. \ +@MAINTAINER_MODE_TRUE@ --generate-c-code=xfsm-manager-dbus-client \ +@MAINTAINER_MODE_TRUE@ $(top_srcdir)/xfce4-session/xfsm-manager-dbus.xml + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/settings/main.c b/settings/main.c new file mode 100644 index 0000000..a1433ad --- /dev/null +++ b/settings/main.c @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include <xfconf/xfconf.h> + +#include <gtk/gtk.h> +#include <gtk/gtkx.h> +#include <gdk/gdkx.h> + +#include <libxfce4util/libxfce4util.h> +#include <libxfce4ui/libxfce4ui.h> + +#include <libxfsm/xfsm-util.h> + +#include "xfae-window.h" +#include "xfce4-session-settings-common.h" +#include "xfce4-session-settings_ui.h" + + +static void xfce4_session_settings_dialog_response (GtkDialog *dialog, gint response, gpointer userdata) +{ + if (response == GTK_RESPONSE_HELP) { + xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-session", "preferences", NULL); + } + else { + gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_main_quit (); + } +} + +static void +xfce4_session_settings_show_saved_sessions (GtkBuilder *builder, + XfceRc *rc, + gboolean visible) +{ + GtkWidget *notebook = GTK_WIDGET (gtk_builder_get_object (builder, "plug-child")); + GtkWidget *sessions_treeview = GTK_WIDGET (gtk_builder_get_object (builder, "saved-sessions-list")); + GtkTreeModel *model; + GList *sessions; + + gtk_widget_set_visible (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 3), visible); + if (visible == FALSE) + return; + + settings_list_sessions_treeview_init (GTK_TREE_VIEW (sessions_treeview)); + sessions = settings_list_sessions (rc); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (sessions_treeview)); + settings_list_sessions_populate (model, sessions); +} + +int +main(int argc, + char **argv) +{ + GtkBuilder *builder; + GtkWidget *notebook; + GtkWidget *xfae_page; + GtkWidget *lbl; + GtkWidget *label_active_session; + GObject *delete_button; + GObject *treeview; + GError *error = NULL; + XfconfChannel *channel; + XfceRc *rc; + gboolean visible; + gchar *active_session; + gchar *active_session_label; + const gchar *format; + gchar *markup; + + Window opt_socket_id = 0; + gboolean opt_version = FALSE; + + GOptionEntry option_entries[] = + { + { "socket-id", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_INT, &opt_socket_id, N_("Settings manager socket"), N_("SOCKET ID") }, + { "version", 'V', 0, G_OPTION_ARG_NONE, &opt_version, N_("Version information"), NULL }, + { NULL } + }; + + xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); + + if(!gtk_init_with_args (&argc, &argv, NULL, option_entries, + GETTEXT_PACKAGE, &error)) + { + if(G_LIKELY(error)) { + g_print("%s: %s.\n", G_LOG_DOMAIN, error->message); + g_print(_("Type '%s --help' for usage."), G_LOG_DOMAIN); + g_print("\n"); + g_error_free (error); + } else + g_error("Unable to open display."); + + return EXIT_FAILURE; + } + + if(G_UNLIKELY(opt_version)) { + g_print("%s %s (Xfce %s)\n\n", G_LOG_DOMAIN, PACKAGE_VERSION, xfce_version_string ()); + g_print("%s\n", "Copyright (c) 2004-2020"); + g_print("\t%s\n\n", _("The Xfce development team. All rights reserved.")); + g_print(_("Please report bugs to <%s>."), PACKAGE_BUGREPORT); + g_print("\n"); + + return EXIT_SUCCESS; + } + + if(G_UNLIKELY(!xfconf_init(&error))) { + xfce_dialog_show_error (NULL, + error, + _("Unable to contact settings server")); + g_error_free(error); + return EXIT_FAILURE; + } + + gtk_window_set_default_icon_name("xfce4-session"); + + /* hook to make sure the libxfce4ui library is linked */ + if (xfce_titled_dialog_get_type() == 0) + return EXIT_FAILURE; + + builder = gtk_builder_new(); + gtk_builder_add_from_string(builder, + xfce4_session_settings_ui, + xfce4_session_settings_ui_length, + &error); + + if(!builder) { + if (error) { + xfce_dialog_show_error(NULL, error, + _("Unable to create user interface from embedded definition data")); + g_error_free (error); + } + return EXIT_FAILURE; + } + + session_editor_init(builder); + + channel = xfconf_channel_get (SETTINGS_CHANNEL); + + /* FIXME: someday, glade-ify this, maybe. */ + xfae_page = xfae_window_new(); + gtk_widget_show(xfae_page); + notebook = GTK_WIDGET(gtk_builder_get_object(builder, "plug-child")); + lbl = gtk_label_new_with_mnemonic(_("App_lication Autostart")); + gtk_widget_show(lbl); + gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), xfae_page, lbl, 1); + + label_active_session = GTK_WIDGET (gtk_builder_get_object (builder, "label_active_session")); + active_session = xfconf_channel_get_string (channel, "/general/SessionName", "Default"); + active_session_label = _("Currently active session:"); + format = "%s <b>%s</b>"; + markup = g_markup_printf_escaped (format, active_session_label, active_session); + gtk_label_set_markup (GTK_LABEL (label_active_session), markup); + g_free (markup); + + delete_button = gtk_builder_get_object (builder, "btn_delete_session"); + treeview = gtk_builder_get_object (builder, "saved-sessions-list"); + g_signal_connect (delete_button, "clicked", G_CALLBACK (settings_list_sessions_delete_session), GTK_TREE_VIEW (treeview)); + + /* Check if there are saved sessions and if so, show the "Saved Sessions" tab */ + rc = settings_list_sessions_open_rc (); + if (rc) + visible = TRUE; + else + visible = FALSE; + xfce4_session_settings_show_saved_sessions (builder, rc, visible); + + /* bind widgets to xfconf */ + xfconf_g_property_bind(channel, "/chooser/AlwaysDisplay", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_display_chooser"), + "active"); + xfconf_g_property_bind(channel, "/general/AutoSave", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_session_autosave"), + "active"); + xfconf_g_property_bind(channel, "/general/PromptOnLogout", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_logout_prompt"), + "active"); + xfconf_g_property_bind(channel, "/compat/LaunchGNOME", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_compat_gnome"), + "active"); + xfconf_g_property_bind(channel, "/compat/LaunchKDE", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_compat_kde"), + "active"); + xfconf_g_property_bind(channel, "/security/EnableTcp", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_enable_tcp"), + "active"); + xfconf_g_property_bind(channel, "/shutdown/LockScreen", G_TYPE_BOOLEAN, + gtk_builder_get_object(builder, "chk_lock_screen"), + "active"); + + if(G_UNLIKELY(opt_socket_id == 0)) { + GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(builder, "xfce4_session_settings_dialog")); + + g_signal_connect(dialog, "response", G_CALLBACK(xfce4_session_settings_dialog_response), NULL); + g_signal_connect(dialog, "delete-event", G_CALLBACK(gtk_main_quit), NULL); + + gtk_widget_show(dialog); + + /* To prevent the settings dialog to be saved in the session */ + gdk_x11_set_sm_client_id ("FAKE ID"); + + gtk_main(); + } else { + GtkWidget *plug; + GtkWidget *plug_child; + GtkWidget *parent; + + plug_child = GTK_WIDGET(gtk_builder_get_object(builder, "plug-child")); + plug = gtk_plug_new(opt_socket_id); + gtk_widget_show (plug); + + parent = gtk_widget_get_parent (plug_child); + if (parent) + { + g_object_ref (plug_child); + gtk_container_remove (GTK_CONTAINER (parent), plug_child); + gtk_container_add (GTK_CONTAINER (plug), plug_child); + g_object_unref (plug_child); + } + g_signal_connect(plug, "delete-event", + G_CALLBACK(gtk_main_quit), NULL); + + /* Stop startup notification */ + gdk_notify_startup_complete(); + + gtk_main(); + } + + g_object_unref(builder); + + return EXIT_SUCCESS; +} diff --git a/settings/session-editor.c b/settings/session-editor.c new file mode 100644 index 0000000..25bab9a --- /dev/null +++ b/settings/session-editor.c @@ -0,0 +1,904 @@ +/* + * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include <X11/SM/SMlib.h> + +#include <gtk/gtk.h> +#include <glib/gstdio.h> + +#include <gio/gio.h> + +#include <libxfce4util/libxfce4util.h> +#include <libxfce4ui/libxfce4ui.h> + +#include <libxfsm/xfsm-util.h> + +#include "xfce4-session-settings-common.h" +#include "xfce4-session-marshal.h" +#include "xfsm-client-dbus-client.h" +#include "xfsm-manager-dbus-client.h" + +#define GsmPriority "_GSM_Priority" +#define GsmDesktopFile "_GSM_DesktopFile" +#define TREE_ROW_REF_KEY "--tree-row-ref" + +enum +{ + COL_OBJ_PATH = 0, + COL_NAME, + COL_ICON_NAME, + COL_COMMAND, + COL_RESTART_STYLE, + COL_RESTART_STYLE_STR, + COL_PRIORITY, + COL_PID, + COL_DBUS_PROXY, + COL_HAS_DESKTOP_FILE, + N_COLS, +}; + +static const gchar *restart_styles[] = { + N_("If running"), + N_("Always"), + N_("Immediately"), + N_("Never"), + NULL, +}; + +static XfsmManager *manager_dbus_proxy = NULL; + + +static gboolean +session_editor_ensure_dbus(void) +{ + GError *error = NULL; + + TRACE("entering\n"); + + if (manager_dbus_proxy) + return TRUE; + + manager_dbus_proxy = xfsm_manager_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, + "org.xfce.SessionManager", + "/org/xfce/SessionManager", + NULL, + &error); + + if (manager_dbus_proxy == NULL) { + g_error ("error connecting to org.xfce.SessionManager, reason was: %s", error->message); + g_clear_error(&error); + return FALSE; + } + + return TRUE; +} + +static void +manager_state_changed_saving(XfsmManager *proxy, + guint old_state, + guint new_state, + gpointer user_data) +{ + if(new_state == 1) /* idle. FIXME: enum this */ + gtk_dialog_response(GTK_DIALOG(user_data), GTK_RESPONSE_ACCEPT); +} + +static gboolean +pulse_session_save_dialog(gpointer data) +{ + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(data)); + return TRUE; +} + +static void +session_editor_save_session(GtkWidget *btn, + GtkBuilder *builder) +{ + GtkWidget *dialog = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_saving")); + GtkWidget *treeview = GTK_WIDGET (gtk_builder_get_object (builder, "saved-sessions-list")); + GtkWidget *notebook = GTK_WIDGET (gtk_builder_get_object (builder, "plug-child")); + GtkWidget *btn_clear = GTK_WIDGET (gtk_builder_get_object(builder, "btn_clear_sessions")); + GtkWidget *pbar = g_object_get_data(G_OBJECT(dialog), "pbar"); + GtkTreeModel *model; + GList *sessions; + XfceRc *rc; + guint pulse_id; + guint sig_id; + GError *error = NULL; + + TRACE("entering\n"); + + gtk_widget_set_sensitive(btn, FALSE); + + if(!xfsm_manager_call_checkpoint_sync(manager_dbus_proxy, "", NULL, &error)) { + xfce_message_dialog(GTK_WINDOW(gtk_widget_get_toplevel(btn)), + _("Session Save Error"), "dialog-error", + _("Unable to save the session"), + error ? error->message : "Unknown error.", + XFCE_BUTTON_TYPE_MIXED, "window-close-symbolic", _("_Close"), GTK_RESPONSE_ACCEPT, + NULL); + gtk_widget_set_sensitive(btn, TRUE); + if (error) + g_error_free(error); + return; + } + + sig_id = g_signal_connect(manager_dbus_proxy, "state_changed", + G_CALLBACK(manager_state_changed_saving), + dialog); + pulse_id = g_timeout_add(250, pulse_session_save_dialog, pbar); + + gtk_dialog_run(GTK_DIALOG(dialog)); + + g_source_remove(pulse_id); + g_signal_handler_disconnect(manager_dbus_proxy, sig_id); + gtk_widget_hide(dialog); + gtk_widget_set_sensitive(btn, TRUE); + /* After saving the session we ensure the clear button is sensitive */ + gtk_widget_set_sensitive (btn_clear, TRUE); + /* Always make sure the "Saved Sessions" tab is visible and the treeview is populated after saving a session */ + rc = settings_list_sessions_open_rc (); + if (rc) + { + gtk_widget_show (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 3)); + sessions = settings_list_sessions (rc); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); + /* If the treeview hasn't been initialized we do it now */ + if (!GTK_IS_LIST_STORE (model)) + { + settings_list_sessions_treeview_init (GTK_TREE_VIEW (treeview)); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); + } + settings_list_sessions_populate (model, sessions); + } +} + +static void +session_editor_sel_changed_btn(GtkTreeSelection *sel, + GtkWidget *btn) +{ + GtkTreeIter iter; + gtk_widget_set_sensitive(btn, gtk_tree_selection_get_selected(sel, NULL, + &iter)); +} + +static void +session_editor_clear_sessions(GtkWidget *btn, + GtkBuilder *builder) +{ + GtkWidget *treeview = GTK_WIDGET (gtk_builder_get_object (builder, "treeview_clients")); + GtkWidget *notebook = GTK_WIDGET (gtk_builder_get_object (builder, "plug-child")); + TRACE("entering\n"); + + gtk_widget_set_sensitive(btn, FALSE); + + if(xfce_message_dialog(GTK_WINDOW(gtk_widget_get_toplevel(treeview)), + _("Clear sessions"), "dialog-question", + _("Are you sure you want to empty the session cache?"), + _("The saved states of your applications will not be restored during your next login."), + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Proceed"), GTK_RESPONSE_ACCEPT, + NULL) == GTK_RESPONSE_ACCEPT) + { + const gchar *item_name; + gchar *cache_dir_path, *item_path; + GDir *cache_dir; + GError *error = NULL; + gboolean failed = FALSE; + + cache_dir_path = g_build_path(G_DIR_SEPARATOR_S, g_get_user_cache_dir(), "sessions", NULL); + cache_dir = g_dir_open(cache_dir_path, 0, &error); + if(!cache_dir) { + g_critical("Failed to open the session cache's directory: %s", error->message); + g_error_free(error); + g_free(cache_dir_path); + gtk_widget_set_sensitive(btn, TRUE); + return; + } + + while((item_name = g_dir_read_name(cache_dir))) { + /* only clean Xfce related items */ + if(!g_str_has_prefix(item_name, "xfce4-session-") && + !g_str_has_prefix(item_name, "Thunar-") && + !g_str_has_prefix(item_name, "xfwm4-")) { + continue; + } + + item_path = g_build_filename(cache_dir_path, item_name, NULL); + if(G_UNLIKELY(g_unlink(item_path) == -1)) { + DBG("Failed to delete \"%s\" from the session cache.", item_path); + failed = TRUE; + } + g_free(item_path); + } + + if(failed){ + gchar *secondary_text; + + secondary_text = g_strdup_printf (_("You might need to delete some files manually in \"%s\"."), cache_dir_path); + xfce_dialog_show_warning(GTK_WINDOW(gtk_widget_get_toplevel(treeview)), + secondary_text, + _("All Xfce cache files could not be cleared")); + g_free(secondary_text); + } + + g_dir_close(cache_dir); + g_free(cache_dir_path); + + /* Always make sure the "Saved Sessions" tab is hidden after deleting all sessions */ + gtk_widget_hide (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 3)); + } + else { + gtk_widget_set_sensitive(btn, TRUE); + } +} + +static void +session_editor_quit_client(GtkWidget *btn, + GtkWidget *treeview) +{ + GtkTreeSelection *sel; + GtkTreeModel *model = NULL; + GtkTreeIter iter; + XfsmClient *proxy = NULL; + gchar *name = NULL; + guchar hint = SmRestartIfRunning; + gchar *primary; + + TRACE("entering\n"); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); + if(!gtk_tree_selection_get_selected(sel, &model, &iter)) + return; + + gtk_tree_model_get(model, &iter, + COL_DBUS_PROXY, &proxy, + COL_NAME, &name, + COL_RESTART_STYLE, &hint, + -1); + + primary = g_strdup_printf(_("Are you sure you want to terminate \"%s\"?"), + name); + if(xfce_message_dialog(GTK_WINDOW(gtk_widget_get_toplevel(treeview)), + _("Terminate Program"), "dialog-question", + primary, + _("The application will lose any unsaved state and will not be restarted in your next session."), + _("_Cancel"), GTK_RESPONSE_CANCEL, + XFCE_BUTTON_TYPE_MIXED, "application-exit", _("_Quit Program"), GTK_RESPONSE_ACCEPT, + NULL) == GTK_RESPONSE_ACCEPT) + { + GError *error = NULL; + + if(hint != SmRestartIfRunning) { + GVariantBuilder properties; + GVariant *variant; + + g_variant_builder_init (&properties, G_VARIANT_TYPE ("a{sv}")); + variant = g_variant_new_byte(SmRestartIfRunning); + g_variant_builder_add (&properties, "{sv}", SmRestartStyleHint, variant); + + if(!xfsm_client_call_set_sm_properties_sync(proxy, g_variant_builder_end (&properties), NULL, &error)) { + g_error("error setting 'SmRestartStyleHint', error: %s", error->message); + g_clear_error(&error); + } + } + + if(!xfsm_client_call_terminate_sync(proxy, NULL, &error)) { + xfce_message_dialog(GTK_WINDOW(gtk_widget_get_toplevel(treeview)), + _("Terminate Program"), "dialog-error", + _("Unable to terminate program."), + error->message, + XFCE_BUTTON_TYPE_MIXED, "window-close-symbolic", _("_Close"), GTK_RESPONSE_ACCEPT, + NULL); + g_error_free(error); + } + } + + g_free(primary); + g_free(name); + g_object_unref(proxy); +} + +static void +session_editor_set_from_desktop_file(GtkTreeModel *model, + GtkTreeIter *iter, + const gchar *desktop_file) +{ + XfceRc *rcfile; + const gchar *name, *icon; + GIcon *gicon; + + TRACE("entering\n"); + + rcfile = xfce_rc_simple_open(desktop_file, TRUE); + if(!rcfile) + return; + + if(!xfce_rc_has_group(rcfile, "Desktop Entry")) { + xfce_rc_close(rcfile); + return; + } + + xfce_rc_set_group(rcfile, "Desktop Entry"); + + name = xfce_rc_read_entry(rcfile, "Name", NULL); + if(!name) { + /* we require at least Name to make things simpler */ + xfce_rc_close(rcfile); + return; + } + + icon = xfce_rc_read_entry (rcfile, "Icon", NULL); + gicon = g_themed_icon_new_with_default_fallbacks (icon); + + gtk_list_store_set(GTK_LIST_STORE(model), iter, + COL_NAME, name, + COL_ICON_NAME, gicon, + COL_HAS_DESKTOP_FILE, TRUE, + -1); + + xfce_rc_close(rcfile); +} + +static void +client_sm_property_changed(XfsmClient *proxy, + const gchar *name, + const GValue *value, + gpointer user_data) +{ + GtkTreeView *treeview = user_data; + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GtkTreeRowReference *rref = g_object_get_data(G_OBJECT(proxy), + TREE_ROW_REF_KEY); + GtkTreePath *path = gtk_tree_row_reference_get_path(rref); + GtkTreeIter iter; + gboolean has_desktop_file = FALSE; + + TRACE("entering\n"); + + if(!gtk_tree_model_get_iter(model, &iter, path)) { + gtk_tree_path_free(path); + return; + } + gtk_tree_path_free(path); + + gtk_tree_model_get(model, &iter, + COL_HAS_DESKTOP_FILE, &has_desktop_file, + -1); + + if(!strcmp(name, SmProgram) && G_VALUE_HOLDS_STRING(value)) { + if(!has_desktop_file) { + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COL_NAME, g_value_get_string(value), + -1); + } + } else if(!strcmp(name, SmRestartStyleHint) && G_VALUE_HOLDS_UCHAR(value)) { + guchar hint = g_value_get_uchar(value); + + if(hint > SmRestartNever) + hint = SmRestartIfRunning; + + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COL_RESTART_STYLE, hint, + COL_RESTART_STYLE_STR, _(restart_styles[hint]), + -1); + } else if(!strcmp(name, GsmPriority) && G_VALUE_HOLDS_UCHAR(value)) { + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COL_PRIORITY, g_value_get_uchar(value), + -1); + } else if(!strcmp(name, SmProcessID) && G_VALUE_HOLDS_STRING(value)) { + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COL_PID, g_value_get_string(value), + -1); + } else if(!strcmp(name, GsmDesktopFile) && G_VALUE_HOLDS_STRING(value)) { + session_editor_set_from_desktop_file(model, &iter, + g_value_get_string(value)); + } +} + +static void +client_state_changed(XfsmClient *proxy, + guint old_state, + guint new_state, + gpointer user_data) +{ + GtkTreeView *treeview = user_data; + + TRACE("entering\n"); + + if(new_state == 7) { /* disconnected. FIXME: enum this */ + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GtkTreeRowReference *rref = g_object_get_data(G_OBJECT(proxy), + TREE_ROW_REF_KEY); + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_row_reference_get_path(rref); + if(gtk_tree_model_get_iter(model, &iter, path)) + gtk_list_store_remove(GTK_LIST_STORE(model), &iter); + + gtk_tree_path_free(path); + g_object_unref(proxy); + } +} + +static void +manager_client_registered(XfsmManager *proxy, + const gchar *object_path, + gpointer user_data) +{ + GtkTreeView *treeview = user_data; + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GtkTreePath *path; + GtkTreeIter iter; + XfsmClient *client_proxy; + const gchar *propnames[] = { + SmProgram, SmRestartStyleHint,SmProcessID, GsmPriority, + GsmDesktopFile, NULL + }; + const gchar *name = NULL, *pid = NULL, *desktop_file = NULL; + guchar hint = SmRestartIfRunning, priority = 50; + GVariant *variant, *variant_value; + GVariantIter *variant_iter; + gchar *property; + GIcon *gicon; + GError *error = NULL; + + TRACE("entering\n"); + + DBG("new client at %s", object_path); + + client_proxy = xfsm_client_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, + "org.xfce.SessionManager", + object_path, + NULL, + &error); + + if(error != NULL) + { + g_warning("Unable to connect to org.xfce.SessionManager, reason: %s", + error->message); + g_clear_error(&error); + return; + } + + if(!xfsm_client_call_get_sm_properties_sync(client_proxy, propnames, + &variant, NULL, &error)) + { + g_warning("Unable to get properties for client at %s: %s", + object_path, error->message); + g_clear_error(&error); + g_object_unref(client_proxy); + return; + } + + g_variant_get((GVariant *)variant, "a{sv}", &variant_iter); + while(g_variant_iter_next(variant_iter, "{sv}", &property, &variant_value)) + { + if(g_strcmp0(property, SmProgram) == 0) + { + name = g_variant_get_string(variant_value, 0); + DBG("name %s", name); + } + else if(g_strcmp0(property, SmRestartStyleHint) == 0) + { + hint = g_variant_get_byte(variant_value); + if(hint > SmRestartNever) + { + hint = SmRestartIfRunning; + } + DBG("hint %d", hint); + } + else if(g_strcmp0(property, GsmPriority) == 0) + { + priority = g_variant_get_byte(variant_value); + DBG("priority %d", priority); + } + else if(g_strcmp0(property, SmProcessID) == 0) + { + pid = g_variant_get_string(variant_value, 0); + DBG("pid %s", pid); + } + else if(g_strcmp0(property, GsmDesktopFile) == 0) + { + desktop_file = g_variant_get_string(variant_value, 0); + DBG("desktop_file %s", desktop_file); + } + + g_free (property); + g_variant_unref (variant_value); + } + + if(!name || !*name) + name = _("(Unknown program)"); + + DBG("adding '%s', obj path %s", name, object_path); + gtk_list_store_append(GTK_LIST_STORE(model), &iter); + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COL_DBUS_PROXY, client_proxy, + COL_OBJ_PATH, object_path, + COL_NAME, name, + COL_RESTART_STYLE, hint, + COL_RESTART_STYLE_STR, _(restart_styles[hint]), + COL_PRIORITY, priority, + COL_PID, pid, + -1); + + if (desktop_file != NULL) + { + session_editor_set_from_desktop_file (model, &iter, desktop_file); + } + else + { + gicon = xfce_gicon_from_name (name); + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COL_ICON_NAME, gicon, + -1); + } + + path = gtk_tree_model_get_path(model, &iter); + g_object_set_data_full(G_OBJECT(client_proxy), TREE_ROW_REF_KEY, + gtk_tree_row_reference_new(model, path), + (GDestroyNotify)gtk_tree_row_reference_free); + gtk_tree_path_free(path); + + g_signal_connect(client_proxy, "sm_property_changed", + G_CALLBACK(client_sm_property_changed), + treeview); + + /* proxy will live as long as the client does */ + g_signal_connect(client_proxy, "state_changed", + G_CALLBACK(client_state_changed), treeview); + + g_variant_unref(variant); +} + +static GtkTreeModel * +session_editor_create_restart_style_combo_model(void) +{ + GtkListStore *ls = gtk_list_store_new(1, G_TYPE_STRING); + GtkTreeIter iter; + gint i; + + TRACE("entering\n"); + + for(i = 0; restart_styles[i]; ++i) { + gtk_list_store_append(ls, &iter); + gtk_list_store_set(ls, &iter, 0, _(restart_styles[i]), -1); + } + + return GTK_TREE_MODEL(ls); +} + +static void +priority_changed(GtkCellRenderer *render, + const gchar *path_str, + const gchar *new_text, + gpointer user_data) +{ + GtkTreeView *treeview = user_data; + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GtkTreePath *path = gtk_tree_path_new_from_string(path_str); + GtkTreeIter iter; + + TRACE("entering\n"); + + if(gtk_tree_model_get_iter(model, &iter, path)) { + XfsmClient *proxy = NULL; + gint new_prio_i = atoi(new_text); + guchar old_prio, new_prio; + + /* FIXME: should probably inform user if value gets clamped */ + if(new_prio_i > G_MAXUINT8) + new_prio = G_MAXUINT8; + else if(new_prio_i < 0) + new_prio = 0; + else + new_prio = (guchar)new_prio_i; + + gtk_tree_model_get(model, &iter, + COL_DBUS_PROXY, &proxy, + COL_PRIORITY, &old_prio, + -1); + + DBG("old_prio %d, new_prio %d", old_prio, new_prio); + + if(old_prio != new_prio) { + GVariantBuilder properties; + GVariant *variant; + GError *error = NULL; + + g_variant_builder_init (&properties, G_VARIANT_TYPE ("a{sv}")); + variant = g_variant_new_byte(new_prio); + g_variant_builder_add (&properties, "{sv}", GsmPriority, variant); + + if(!xfsm_client_call_set_sm_properties_sync(proxy, g_variant_builder_end (&properties), NULL, &error)) { + g_error("error setting 'GsmPriority', error: %s", error->message); + g_clear_error(&error); + } + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COL_PRIORITY, new_prio, -1); + } + + g_object_unref(proxy); + } + + gtk_tree_path_free(path); +} + +static void +restart_style_hint_changed(GtkCellRenderer *render, + const gchar *path_str, + const gchar *new_text, + gpointer user_data) +{ + GtkTreeView *treeview = user_data; + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GtkTreePath *path = gtk_tree_path_new_from_string(path_str); + GtkTreeIter iter; + + TRACE("entering\n"); + + if(gtk_tree_model_get_iter(model, &iter, path)) { + gint i; + guchar old_hint = SmRestartIfRunning, hint; + XfsmClient *proxy = NULL; + + gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, + COL_DBUS_PROXY, &proxy, + COL_RESTART_STYLE, &old_hint, + -1); + hint = old_hint; + for(i = 0; restart_styles[i]; ++i) { + if(!g_utf8_collate(new_text, _(restart_styles[i]))) { + hint = i; + break; + } + } + + DBG("old_hint %d, hint %d", old_hint, hint); + + if(old_hint != hint) { + GVariantBuilder properties; + GVariant *variant; + GError *error = NULL; + + g_variant_builder_init (&properties, G_VARIANT_TYPE ("a{sv}")); + variant = g_variant_new_byte(hint); + g_variant_builder_add (&properties, "{sv}", SmRestartStyleHint, variant); + + if(!xfsm_client_call_set_sm_properties_sync(proxy, g_variant_builder_end (&properties), NULL, &error)) { + g_error("error setting 'SmRestartStyleHint', error: %s", error->message); + g_clear_error(&error); + } + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COL_RESTART_STYLE_STR, new_text, -1); + } + + g_object_unref(proxy); + } + + gtk_tree_path_free(path); +} + +static gint +session_tree_compare_iter(GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer user_data) +{ + guchar aprio = 0, bprio = 0; + + TRACE("entering\n"); + + gtk_tree_model_get(model, a, COL_PRIORITY, &aprio, -1); + gtk_tree_model_get(model, b, COL_PRIORITY, &bprio, -1); + + if(aprio < bprio) + return -1; + else if(aprio > bprio) + return 1; + else { + gint ret; + gchar *aname = NULL, *bname = NULL; + + gtk_tree_model_get(model, a, COL_NAME, &aname, -1); + gtk_tree_model_get(model, b, COL_NAME, &bname, -1); + + if(!aname && !bname) + return 0; + else if(!aname) + ret = -1; + else if(!bname) + ret = 1; + else + ret = g_utf8_collate(aname, bname); + + g_free(aname); + g_free(bname); + + return ret; + } +} + +/** + * If there are sortable and `extend`able columns, the extendable colums + * extend too much. Calling `gtk_tree_view_columns_autosize` upon TreeView- + * realization fixes the problem + **/ +static void +session_editor_correct_treeview_column_size (GtkWidget *treeview, + gpointer user_data) +{ + gtk_tree_view_columns_autosize (GTK_TREE_VIEW (treeview)); +} + +static void +session_editor_populate_treeview(GtkTreeView *treeview) +{ + GtkCellRenderer *render; + GtkTreeViewColumn *col; + GtkTreeModel *combo_model; + gchar **clients = NULL; + GtkListStore *ls; + guint i; + GError *error = NULL; + + TRACE("entering\n"); + + // fix buggy sizing behavior of gtk + g_signal_connect (treeview, "realize", G_CALLBACK(session_editor_correct_treeview_column_size), NULL); + + render = gtk_cell_renderer_text_new(); + g_object_set(render, + "editable", TRUE, + "editable-set", TRUE, + NULL); + col = gtk_tree_view_column_new_with_attributes(_("Priority"), render, + "text", COL_PRIORITY, + NULL); + gtk_tree_view_append_column(treeview, col); + gtk_tree_view_column_set_sort_column_id(col,COL_PRIORITY); + + g_signal_connect(render, "edited", + G_CALLBACK(priority_changed), treeview); + + render = gtk_cell_renderer_text_new(); + col = gtk_tree_view_column_new_with_attributes(_("PID"), render, + "text", COL_PID, + NULL); + gtk_tree_view_append_column(treeview, col); + gtk_tree_view_column_set_sort_column_id(col,COL_PID); + + col = gtk_tree_view_column_new(); + gtk_tree_view_column_set_title(col, _("Program")); + g_object_set(col, "expand", TRUE, NULL); + gtk_tree_view_append_column(treeview, col); + gtk_tree_view_column_set_sort_column_id(col,COL_NAME); + + render = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(col, render, FALSE); + gtk_tree_view_column_set_attributes(col, render, + "gicon", COL_ICON_NAME, + NULL); + + render = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, render, TRUE); + gtk_tree_view_column_set_attributes(col, render, + "text", COL_NAME, + NULL); + + render = gtk_cell_renderer_combo_new(); + combo_model = session_editor_create_restart_style_combo_model(); + g_object_set(render, + "has-entry", FALSE, + "model", combo_model, + "text-column", 0, + "editable", TRUE, + "mode", GTK_CELL_RENDERER_MODE_EDITABLE, + NULL); + col = gtk_tree_view_column_new_with_attributes(_("Restart Style"), render, + "text", COL_RESTART_STYLE_STR, + NULL); + gtk_tree_view_append_column(treeview, col); + gtk_tree_view_column_set_sort_column_id(col,COL_RESTART_STYLE_STR); + + g_object_unref(combo_model); + g_signal_connect(render, "edited", + G_CALLBACK(restart_style_hint_changed), treeview); + + if(!session_editor_ensure_dbus()) + return; + + ls = gtk_list_store_new(N_COLS, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_ICON, G_TYPE_STRING, G_TYPE_UCHAR, + G_TYPE_STRING, G_TYPE_UCHAR, G_TYPE_STRING, + G_TYPE_OBJECT, G_TYPE_BOOLEAN); + gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(ls)); + gtk_tree_sortable_set_default_sort_func(GTK_TREE_SORTABLE(ls), + session_tree_compare_iter, + NULL, NULL); + gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), + GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, + GTK_SORT_ASCENDING); + g_object_unref(ls); + + g_signal_connect(manager_dbus_proxy, "client_registered", + G_CALLBACK(manager_client_registered), + treeview); + + if(!xfsm_manager_call_list_clients_sync(manager_dbus_proxy, + &clients, NULL, &error)) + { + g_critical("Unable to query session manager for client list: %s", + error->message); + g_error_free(error); + return; + } + + for(i = 0; clients[i] != NULL; ++i) { + gchar *client_op = clients[i]; + manager_client_registered(manager_dbus_proxy, client_op, treeview); + } + + g_strfreev(clients); +} + +void +session_editor_init(GtkBuilder *builder) +{ + GObject *btn_save, *btn_clear, *btn_quit, *dlg_saving; + GtkTreeView *treeview; + GtkTreeSelection *sel; + + TRACE("entering\n"); + + treeview = GTK_TREE_VIEW(gtk_builder_get_object(builder, "treeview_clients")); + sel = gtk_tree_view_get_selection(treeview); + session_editor_populate_treeview(treeview); + + dlg_saving = gtk_builder_get_object(builder, "dialog_saving"); + g_object_set_data(dlg_saving, "pbar", + GTK_WIDGET(gtk_builder_get_object(builder, "progress_save_session"))); + + btn_save = gtk_builder_get_object(builder, "btn_save_session"); + g_signal_connect(btn_save, "clicked", + G_CALLBACK(session_editor_save_session), builder); + + btn_clear = gtk_builder_get_object(builder, "btn_clear_sessions"); + g_signal_connect(btn_clear, "clicked", + G_CALLBACK(session_editor_clear_sessions), builder); + + btn_quit = gtk_builder_get_object(builder, "btn_quit_client"); + g_signal_connect(btn_quit, "clicked", + G_CALLBACK(session_editor_quit_client), treeview); + g_signal_connect(sel, "changed", + G_CALLBACK(session_editor_sel_changed_btn), GTK_WIDGET(btn_quit)); +} diff --git a/settings/xfae-dialog.c b/settings/xfae-dialog.c new file mode 100644 index 0000000..4a426fa --- /dev/null +++ b/settings/xfae-dialog.c @@ -0,0 +1,298 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "xfae-dialog.h" + +#include <libxfce4ui/libxfce4ui.h> + +static void xfae_dialog_update (XfaeDialog *dialog); +static void xfae_dialog_browse (XfaeDialog *dialog); + + + +struct _XfaeDialogClass +{ + GtkDialogClass __parent__; +}; + +struct _XfaeDialog +{ + GtkDialog __parent__; + + GtkWidget *name_entry; + GtkWidget *descr_entry; + GtkWidget *command_entry; + GtkWidget *run_hook_combo; +}; + + + +G_DEFINE_TYPE (XfaeDialog, xfae_dialog, GTK_TYPE_DIALOG) + + + +static void +xfae_dialog_class_init (XfaeDialogClass *klass) +{ +} + + + +static void +xfae_dialog_init (XfaeDialog *dialog) +{ + GtkWidget *content_area; + GtkWidget *grid; + GtkWidget *label; + GtkWidget *hbox; + GtkWidget *button; + GtkWidget *image; + GEnumClass *klass; + GEnumValue *enum_struct; + guint i; + + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_OK"), GTK_RESPONSE_OK, + NULL); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); + gtk_window_set_title (GTK_WINDOW (dialog), _("Add application")); + + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 6); + + grid = g_object_new (GTK_TYPE_GRID, + "row-spacing", 6, + "column-spacing", 12, + NULL); + gtk_container_add (GTK_CONTAINER (content_area), grid); + gtk_container_set_border_width (GTK_CONTAINER (grid), 6); + gtk_widget_show (grid); + + label = g_object_new (GTK_TYPE_LABEL, + "label", _("Name:"), + "xalign", 0.0f, + NULL); + gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); + gtk_widget_show (label); + + dialog->name_entry = g_object_new (GTK_TYPE_ENTRY, + "activates-default", TRUE, + "hexpand", TRUE, + NULL); + + gtk_grid_attach (GTK_GRID (grid), dialog->name_entry, 1, 0, 1, 1); + gtk_widget_show (dialog->name_entry); + + label = g_object_new (GTK_TYPE_LABEL, + "label", _("Description:"), + "xalign", 0.0f, + NULL); + gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1); + gtk_widget_show (label); + + dialog->descr_entry = g_object_new (GTK_TYPE_ENTRY, + "activates-default", TRUE, + "hexpand", TRUE, + NULL); + gtk_grid_attach (GTK_GRID (grid), dialog->descr_entry, 1, 1, 1, 1); + gtk_widget_show (dialog->descr_entry); + + label = g_object_new (GTK_TYPE_LABEL, + "label", _("Command:"), + "xalign", 0.0f, + NULL); + gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1); + gtk_widget_show (label); + + hbox = g_object_new (GTK_TYPE_BOX, + "spacing", 6, + NULL); + gtk_grid_attach (GTK_GRID (grid), hbox, 1, 2, 1, 1); + gtk_widget_show (hbox); + + label = g_object_new (GTK_TYPE_LABEL, + "label", _("Trigger:"), + "xalign", 0.0f, + NULL); + gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1); + gtk_widget_show (label); + + dialog->run_hook_combo = gtk_combo_box_text_new (); + gtk_widget_set_margin_bottom (dialog->run_hook_combo, 5); + klass = g_type_class_ref (XFSM_TYPE_RUN_HOOK); + for (i = 0; i < klass->n_values; ++i) + { + enum_struct = g_enum_get_value (klass, i); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->run_hook_combo), enum_struct->value_nick); + } + g_type_class_unref (klass); + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->run_hook_combo), 0); + + gtk_grid_attach (GTK_GRID (grid), dialog->run_hook_combo, 1, 3, 1, 1); + gtk_widget_show (dialog->run_hook_combo); + + dialog->command_entry = g_object_new (GTK_TYPE_ENTRY, + "activates-default", TRUE, + "hexpand", TRUE, + NULL); + + gtk_box_pack_start (GTK_BOX (hbox), dialog->command_entry, TRUE, TRUE, 0); + gtk_widget_show (dialog->command_entry); + + g_signal_connect_swapped (G_OBJECT (dialog->name_entry), "notify::text", + G_CALLBACK (xfae_dialog_update), dialog); + g_signal_connect_swapped (G_OBJECT (dialog->command_entry), "notify::text", + G_CALLBACK (xfae_dialog_update), dialog); + + button = g_object_new (GTK_TYPE_BUTTON, + "can-default", FALSE, + NULL); + g_signal_connect_swapped (G_OBJECT (button), "clicked", + G_CALLBACK (xfae_dialog_browse), dialog); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + image = gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_BUTTON); + gtk_container_add (GTK_CONTAINER (button), image); + gtk_widget_show (image); +} + + + +static void +xfae_dialog_update (XfaeDialog *dialog) +{ + const gchar *command; + const gchar *name; + + command = gtk_entry_get_text (GTK_ENTRY (dialog->command_entry)); + name = gtk_entry_get_text (GTK_ENTRY (dialog->name_entry)); + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + *command && *name); +} + + + +static void +xfae_dialog_browse (XfaeDialog *dialog) +{ + const gchar *command; + GtkWidget *chooser; + gchar *filename; + + chooser = gtk_file_chooser_dialog_new (_("Select a command"), + GTK_WINDOW (dialog), + GTK_FILE_CHOOSER_ACTION_OPEN, + _("Cancel"), GTK_RESPONSE_CANCEL, + _("OK"), GTK_RESPONSE_ACCEPT, + NULL); + + gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), TRUE); + + command = gtk_entry_get_text (GTK_ENTRY (dialog->command_entry)); + if (G_UNLIKELY (*command == '/')) + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (chooser), command); + + if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + gtk_entry_set_text (GTK_ENTRY (dialog->command_entry), filename); + g_free (filename); + } + + gtk_widget_destroy (chooser); +} + + + +/** + * xfae_dialog_new: + * @name : initial name or %NULL. + * @descr : initial description or %NULL.. + * @command : initial command or %NULL.. + * + * Allocates a new #XfaeDialog instance. + * + * Return value: the newly allocated #XfaeDialog. + **/ +GtkWidget* +xfae_dialog_new (const gchar *name, + const gchar *descr, + const gchar *command, + XfsmRunHook run_hook) +{ + XfaeDialog *dialog = g_object_new (XFAE_TYPE_DIALOG, NULL); + + if (name) + gtk_entry_set_text (GTK_ENTRY (dialog->name_entry), name); + if (descr) + gtk_entry_set_text (GTK_ENTRY (dialog->descr_entry), descr ); + if (command) + gtk_entry_set_text (GTK_ENTRY (dialog->command_entry), command); + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->run_hook_combo), run_hook); + if (name != NULL || descr != NULL || command != NULL) + gtk_window_set_title (GTK_WINDOW (dialog), _("Edit application")); + + return GTK_WIDGET (dialog); +} + + + +/** + * xfae_dialog_get: + * @dialog : a #XfaeDialog. + * @name : return location for the name. + * @descr : return location for the description. + * @command : return location for the command. + * + * Extracts the parameters selected by the user + * from the @dialog. + **/ +void +xfae_dialog_get (XfaeDialog *dialog, + gchar **name, + gchar **descr, + gchar **command, + XfsmRunHook *run_hook) +{ + g_return_if_fail (XFAE_IS_DIALOG (dialog)); + g_return_if_fail (name != NULL); + g_return_if_fail (descr != NULL); + g_return_if_fail (command != NULL); + g_return_if_fail (run_hook != NULL); + + *name = gtk_editable_get_chars (GTK_EDITABLE (dialog->name_entry), 0, -1); + *descr = gtk_editable_get_chars (GTK_EDITABLE (dialog->descr_entry), 0, -1); + *command = gtk_editable_get_chars (GTK_EDITABLE (dialog->command_entry), 0, -1); + *run_hook = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->run_hook_combo)); + + g_strstrip (*name); + g_strstrip (*descr); + g_strstrip (*command); +} diff --git a/settings/xfae-dialog.h b/settings/xfae-dialog.h new file mode 100644 index 0000000..801e437 --- /dev/null +++ b/settings/xfae-dialog.h @@ -0,0 +1,55 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifndef __XFAE_DIALOG_H__ +#define __XFAE_DIALOG_H__ + +#include <gtk/gtk.h> +#include "xfae-model.h" /* Type XfsmRunHook */ + +G_BEGIN_DECLS; + +typedef struct _XfaeDialogClass XfaeDialogClass; +typedef struct _XfaeDialog XfaeDialog; + +#define XFAE_TYPE_DIALOG (xfae_dialog_get_type ()) +#define XFAE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFAE_TYPE_DIALOG, XfaeDialog)) +#define XFAE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFAE_TYPE_DIALOG, XfaeDialogClass)) +#define XFAE_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFAE_TYPE_DIALOG)) +#define XFAE_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFAE_TYPE_DIALOG)) +#define XFAE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFAE_TYPE_DIALOG, XfaeDialogClass)) + +GType xfae_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *xfae_dialog_new (const gchar *name, + const gchar *descr, + const gchar *command, + XfsmRunHook trigger); + +void xfae_dialog_get (XfaeDialog *dialog, + gchar **name, + gchar **descr, + gchar **command, + XfsmRunHook *trigger); + +G_END_DECLS; + +#endif /* !__XFAE_DIALOG_H__ */ diff --git a/settings/xfae-model.c b/settings/xfae-model.c new file mode 100644 index 0000000..ca8fa1a --- /dev/null +++ b/settings/xfae-model.c @@ -0,0 +1,1282 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include "xfae-model.h" + +#include <libxfce4ui/libxfce4ui.h> + +typedef struct _XfaeItem XfaeItem; + + + +static void xfae_model_tree_model_init (GtkTreeModelIface *iface); +static void xfae_model_tree_sortable_init (GtkTreeSortableIface *iface); +static void xfae_model_finalize (GObject *object); +static GtkTreeModelFlags xfae_model_get_flags (GtkTreeModel *tree_model); +static gint xfae_model_get_n_columns (GtkTreeModel *tree_model); +static GType xfae_model_get_column_type (GtkTreeModel *tree_model, + gint index_); +static gboolean xfae_model_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path); +static GtkTreePath *xfae_model_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static void xfae_model_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value); +static gboolean xfae_model_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean xfae_model_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent); +static gboolean xfae_model_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gint xfae_model_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean xfae_model_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n); +static gboolean xfae_model_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child); +static gboolean xfae_model_get_sort_column_id (GtkTreeSortable *sortable, + int *sort_column_id, + GtkSortType *sort_order); +static void xfae_model_set_sort_column_id (GtkTreeSortable *sortable, + int sort_column_id, + GtkSortType order); +static void xfae_model_set_sort_func (GtkTreeSortable *sortable, + int sort_column_id, + GtkTreeIterCompareFunc func, + gpointer data, + GDestroyNotify destroy); +static void xfae_model_set_default_sort_func (GtkTreeSortable *sortable, + GtkTreeIterCompareFunc func, + gpointer data, + GDestroyNotify destroy); +static gboolean xfae_model_has_default_sort_func (GtkTreeSortable *sortable); +static void xfae_model_sort (XfaeModel *model); + + +static XfaeItem *xfae_item_new (const gchar *relpath); +static void xfae_item_free (XfaeItem *item); +static gboolean xfae_item_is_removable (XfaeItem *item); +static gboolean xfae_item_is_enabled (const XfaeItem *item); +static gint xfae_item_sort_default (gconstpointer a, + gconstpointer b); +static gint xfae_item_sort_name (gconstpointer a, + gconstpointer b); +static gint xfae_item_sort_enabled (gconstpointer a, + gconstpointer b); +static gint xfae_item_sort_hook (gconstpointer a, + gconstpointer b); + +GType +xfsm_run_hook_get_type (void) +{ + static GType type = G_TYPE_INVALID; + + if (G_UNLIKELY (type == G_TYPE_INVALID)) + { + static const GEnumValue values[] = + { + { XFSM_RUN_HOOK_LOGIN, "XFSM_RUN_HOOK_LOGIN", N_ ("on login"), }, + { XFSM_RUN_HOOK_LOGOUT, "XFSM_RUN_HOOK_LOGOUT", N_ ("on logout"), }, + { XFSM_RUN_HOOK_SHUTDOWN, "XFSM_RUN_HOOK_SHUTDOWN", N_ ("on shutdown"), }, + { XFSM_RUN_HOOK_RESTART, "XFSM_RUN_HOOK_RESTART", N_ ("on restart"), }, + { XFSM_RUN_HOOK_SUSPEND, "XFSM_RUN_HOOK_SUSPEND", N_ ("on suspend"), }, + { XFSM_RUN_HOOK_HIBERNATE, "XFSM_RUN_HOOK_HIBERNATE", N_ ("on hibernate"), }, + { XFSM_RUN_HOOK_HYBRID_SLEEP, "XFSM_RUN_HOOK_HYBRID_SLEEP", N_ ("on hybrid sleep"), }, + { XFSM_RUN_HOOK_SWITCH_USER, "XFSM_RUN_HOOK_SWITCH_USER", N_ ("on switch user"), }, + { 0, NULL, NULL, }, + }; + type = g_enum_register_static ("XfsmRunHook", values); + } + return type; +} + +struct _XfaeModelClass +{ + GObjectClass __parent__; +}; + +struct _XfaeModel +{ + GObject __parent__; + + gint stamp; + GList *items; + int sort_column_id; + GtkSortType sort_order; +}; + +struct _XfaeItem +{ + gchar *name; + GdkPixbuf *icon; + gchar *comment; + gchar *relpath; + gboolean hidden; + gchar *tooltip; + XfsmRunHook run_hook; + + gboolean show_in_xfce; + gboolean show_in_override; +}; + + + +G_DEFINE_TYPE_WITH_CODE (XfaeModel, + xfae_model, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, + xfae_model_tree_model_init); + G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_SORTABLE, + xfae_model_tree_sortable_init)); + + + +static void +xfae_model_class_init (XfaeModelClass *klass) +{ + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = xfae_model_finalize; +} + + + +static void +xfae_model_init (XfaeModel *model) +{ + XfaeItem *item; + gchar **files; + guint n; + + model->sort_column_id = GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID; + model->sort_order = GTK_SORT_DESCENDING; + + model->stamp = g_random_int (); + + files = xfce_resource_match (XFCE_RESOURCE_CONFIG, "autostart/*.desktop", TRUE); + for (n = 0; files[n] != NULL; ++n) + { + item = xfae_item_new (files[n]); + if (G_LIKELY (item != NULL)) + model->items = g_list_prepend (model->items, item); + } + g_strfreev (files); + + model->items = g_list_sort (model->items, xfae_item_sort_default); +} + + + +static gboolean +xfae_model_get_sort_column_id (GtkTreeSortable *sortable, + int *sort_column_id, + GtkSortType *sort_order) +{ + XfaeModel * model = XFAE_MODEL (sortable); + if (sort_column_id) + *sort_column_id = model->sort_column_id; + if (sort_order) + *sort_order = model->sort_order; + + if (model->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID || + model->sort_column_id == GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID) + { + return FALSE; + } + + return TRUE; +} + + + +static void +xfae_model_set_sort_column_id (GtkTreeSortable *sortable, + int sort_column_id, + GtkSortType order) +{ + XfaeModel *model = XFAE_MODEL (sortable); + + if ((model->sort_column_id == sort_column_id) && + (model->sort_order == order)) + return; + + if ((GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID == sort_column_id) || + (GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID == sort_column_id)) + { + // This path is probably never hit + return; + } + + model->sort_column_id = sort_column_id; + model->sort_order = order; + + xfae_model_sort (model); + + gtk_tree_sortable_sort_column_changed (sortable); +} + + + +static void +xfae_model_set_sort_func (GtkTreeSortable *sortable, + int sort_column_id, + GtkTreeIterCompareFunc func, + gpointer data, + GDestroyNotify destroy) +{ + g_printerr ("xfae_model_set_sort_func not supported\n"); + return; +} + + + +static void +xfae_model_set_default_sort_func (GtkTreeSortable *sortable, + GtkTreeIterCompareFunc func, + gpointer data, + GDestroyNotify destroy) +{ + g_printerr ("xfae_model_set_default_sort_func not supported\n"); + return; +} + + + +static gboolean +xfae_model_has_default_sort_func (GtkTreeSortable *sortable) +{ + return FALSE; +} + + + +static void +xfae_model_sort (XfaeModel *model) +{ + // sort ASC + switch (model->sort_column_id) + { + case XFAE_MODEL_COLUMN_NAME: + model->items = g_list_sort (model->items, xfae_item_sort_name); + break; + case XFAE_MODEL_COLUMN_ENABLED: + model->items = g_list_sort (model->items, xfae_item_sort_enabled); + break; + case XFAE_MODEL_RUN_HOOK: + model->items = g_list_sort (model->items, xfae_item_sort_hook); + break; + default: + return; + } + + // If necessary, reverse so we have DESC. + // This implementation is inefficient, but this is only rarely called. + if (GTK_SORT_DESCENDING == model->sort_order) + { + model->items = g_list_reverse (model->items); + } + +} + + + +static void +xfae_model_tree_sortable_init (GtkTreeSortableIface *iface) +{ + iface->get_sort_column_id = xfae_model_get_sort_column_id; + iface->set_sort_column_id = xfae_model_set_sort_column_id; + iface->set_sort_func = xfae_model_set_sort_func; + iface->set_default_sort_func = xfae_model_set_default_sort_func; + iface->has_default_sort_func = xfae_model_has_default_sort_func; +} + + + +static void +xfae_model_tree_model_init (GtkTreeModelIface *iface) +{ + iface->get_flags = xfae_model_get_flags; + iface->get_n_columns = xfae_model_get_n_columns; + iface->get_column_type = xfae_model_get_column_type; + iface->get_iter = xfae_model_get_iter; + iface->get_path = xfae_model_get_path; + iface->get_value = xfae_model_get_value; + iface->iter_next = xfae_model_iter_next; + iface->iter_children = xfae_model_iter_children; + iface->iter_has_child = xfae_model_iter_has_child; + iface->iter_n_children = xfae_model_iter_n_children; + iface->iter_nth_child = xfae_model_iter_nth_child; + iface->iter_parent = xfae_model_iter_parent; +} + + + +static void +xfae_model_finalize (GObject *object) +{ + XfaeModel *model = XFAE_MODEL (object); + + /* free all items */ + g_list_foreach (model->items, (GFunc) G_CALLBACK(xfae_item_free), NULL); + g_list_free (model->items); + + G_OBJECT_CLASS (xfae_model_parent_class)->finalize (object); +} + + + +static GtkTreeModelFlags +xfae_model_get_flags (GtkTreeModel *tree_model) +{ + return GTK_TREE_MODEL_ITERS_PERSIST | GTK_TREE_MODEL_LIST_ONLY; +} + + + +static gint +xfae_model_get_n_columns (GtkTreeModel *tree_model) +{ + return XFAE_MODEL_N_COLUMNS; +} + + + +static GType +xfae_model_get_column_type (GtkTreeModel *tree_model, + gint index_) +{ + switch (index_) + { + case XFAE_MODEL_COLUMN_NAME: + case XFAE_MODEL_COLUMN_TOOLTIP: + case XFAE_MODEL_RUN_HOOK: + return G_TYPE_STRING; + + case XFAE_MODEL_COLUMN_ICON: + return GDK_TYPE_PIXBUF; + + case XFAE_MODEL_COLUMN_ENABLED: + case XFAE_MODEL_COLUMN_REMOVABLE: + return G_TYPE_BOOLEAN; + } + + g_assert_not_reached (); + return G_TYPE_INVALID; +} + + + +static gboolean +xfae_model_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + guint index_; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE); + + index_ = gtk_tree_path_get_indices (path)[0]; + if (G_UNLIKELY (index_ >= g_list_length (model->items))) + return FALSE; + + iter->stamp = model->stamp; + iter->user_data = g_list_nth (model->items, index_); + + return TRUE; +} + + + +static GtkTreePath* +xfae_model_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + gint index_; + + g_return_val_if_fail (XFAE_IS_MODEL (model), NULL); + g_return_val_if_fail (model->stamp == iter->stamp, NULL); + + index_ = g_list_position (model->items, iter->user_data); + if (G_UNLIKELY (index_ < 0)) + return NULL; + + return gtk_tree_path_new_from_indices (index_, -1); +} + + + +gboolean +xfae_model_set_run_hook (GtkTreeModel *tree_model, + GtkTreePath *path, + GtkTreeIter *iter, + XfsmRunHook run_hook, + GError **error) +{ + XfaeItem *item = ((GList *) iter->user_data)->data; + XfceRc *rc; + + /* try to open the resource config */ + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, item->relpath, FALSE); + if (G_UNLIKELY (rc == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to open %s for writing"), item->relpath); + return FALSE; + } + + xfce_rc_set_group (rc, "Desktop Entry"); + item->run_hook = run_hook; + xfce_rc_write_int_entry (rc, "RunHook", item->run_hook); + xfce_rc_close (rc); + + /* tell the view that we have most probably a new state */ + gtk_tree_model_row_changed (tree_model, path, iter); + + return TRUE; +} + + + +static void +xfae_model_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + XfaeItem *item = ((GList *) iter->user_data)->data; + gchar *name; + gchar *cursive; + GEnumClass *klass; + GEnumValue *enum_struct; + + g_return_if_fail (XFAE_IS_MODEL (model)); + g_return_if_fail (iter->stamp == model->stamp); + + switch (column) + { + case XFAE_MODEL_COLUMN_NAME: + g_value_init (value, G_TYPE_STRING); + if (G_LIKELY (item->comment != NULL && *item->comment != '\0')) + name = g_markup_printf_escaped ("%s (%s)", item->name, item->comment); + else + name = g_markup_printf_escaped ("%s", item->name); + + if (!item->show_in_xfce) + { + cursive = g_strdup_printf ("<i>%s</i>", name); + g_free (name); + name = cursive; + } + + g_value_take_string (value, name); + break; + + case XFAE_MODEL_COLUMN_ICON: + g_value_init (value, GDK_TYPE_PIXBUF); + g_value_set_object (value, item->icon); + break; + + case XFAE_MODEL_COLUMN_ENABLED: + g_value_init (value, G_TYPE_BOOLEAN); + g_value_set_boolean (value, xfae_item_is_enabled (item)); + break; + + case XFAE_MODEL_COLUMN_REMOVABLE: + g_value_init (value, G_TYPE_BOOLEAN); + g_value_set_boolean (value, xfae_item_is_removable (item)); + break; + + case XFAE_MODEL_COLUMN_TOOLTIP: + g_value_init (value, G_TYPE_STRING); + g_value_set_static_string (value, item->tooltip); + break; + + case XFAE_MODEL_RUN_HOOK: + g_value_init (value, G_TYPE_STRING); + klass = g_type_class_ref (XFSM_TYPE_RUN_HOOK); + enum_struct = g_enum_get_value (klass, item->run_hook); + g_type_class_unref (klass); + g_value_set_static_string (value, enum_struct->value_nick); + break; + + default: + g_assert_not_reached (); + } +} + + + +static gboolean +xfae_model_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (model->stamp == iter->stamp, FALSE); + + iter->user_data = ((GList *) iter->user_data)->next; + + return (iter->user_data != NULL); +} + + + +static gboolean +xfae_model_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + + if (G_LIKELY (parent == NULL && model->items != NULL)) + { + iter->stamp = model->stamp; + iter->user_data = model->items; + return TRUE; + } + + return FALSE; +} + + + +static gboolean +xfae_model_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + return FALSE; +} + + + +static gint +xfae_model_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + + g_return_val_if_fail (XFAE_IS_MODEL (model), 0); + + return (iter == NULL) ? g_list_length (model->items) : 0; +} + + + +static gboolean +xfae_model_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) +{ + XfaeModel *model = XFAE_MODEL (tree_model); + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + + if (G_UNLIKELY (parent == NULL && n < (gint)g_list_length (model->items))) + { + iter->stamp = model->stamp; + iter->user_data = g_list_nth (model->items, n); + return TRUE; + } + + return FALSE; +} + + + +static gboolean +xfae_model_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child) +{ + return FALSE; +} + + + +static XfaeItem* +xfae_item_new (const gchar *relpath) +{ + const gchar *value; + XfaeItem *item = NULL; + gboolean skip = FALSE; + XfceRc *rc; + gchar **only_show_in; + gchar **not_show_in; + gchar **args; + gint m; + GtkIconTheme *icon_theme; + gchar *command; + + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, relpath, TRUE); + if (G_LIKELY (rc != NULL)) + { + xfce_rc_set_group (rc, "Desktop Entry"); + + /* verify that we have an application here */ + value = xfce_rc_read_entry (rc, "Type", NULL); + if (G_LIKELY (value != NULL + && g_ascii_strcasecmp (value, "Application") == 0)) + { + icon_theme = gtk_icon_theme_get_default (); + + item = g_new0 (XfaeItem, 1); + item->relpath = g_strdup (relpath); + + value = xfce_rc_read_entry (rc, "Name", NULL); + if (G_LIKELY (value != NULL)) + item->name = g_strdup (value); + + value = xfce_rc_read_entry (rc, "Icon", "application-x-executable"); + if (G_UNLIKELY (value != NULL)) + { + item->icon = gtk_icon_theme_load_icon (icon_theme, value, 16, + GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_FORCE_SIZE, NULL); + } + + value = xfce_rc_read_entry (rc, "Comment", NULL); + if (G_LIKELY (value != NULL)) + item->comment = g_strdup (value); + + value = xfce_rc_read_entry (rc, "Exec", NULL); + if (G_LIKELY (value != NULL)) + item->tooltip = g_markup_printf_escaped ("<b>%s</b> %s", _("Command:"), value); + + item->run_hook = xfce_rc_read_int_entry (rc, "RunHook", XFSM_RUN_HOOK_LOGIN); + item->hidden = xfce_rc_read_bool_entry (rc, "Hidden", FALSE); + } + else + { + return NULL; + } + + item->show_in_override = xfce_rc_read_bool_entry (rc, "X-XFCE-Autostart-Override", FALSE); + + /* check the NotShowIn setting */ + not_show_in = xfce_rc_read_list_entry (rc, "NotShowIn", ";"); + if (G_UNLIKELY (not_show_in != NULL)) + { + /* check if "XFCE" is specified */ + for (m = 0; not_show_in[m] != NULL; ++m) + if (g_ascii_strcasecmp (not_show_in[m], "XFCE") == 0) + { + skip = TRUE; + break; + } + + g_strfreev (not_show_in); + } + + /* check the OnlyShowIn setting */ + only_show_in = xfce_rc_read_list_entry (rc, "OnlyShowIn", ";"); + if (G_UNLIKELY (only_show_in != NULL)) + { + /* check if "XFCE" is specified */ + for (m = 0; only_show_in[m] != NULL; ++m) + if (g_ascii_strcasecmp (only_show_in[m], "XFCE") == 0) + { + item->show_in_xfce = TRUE; + break; + } + + g_strfreev (only_show_in); + } + else + { + /* no OnlyShowIn, treat it like a normal application */ + item->show_in_xfce = TRUE; + } + + value = xfce_rc_read_entry (rc, "TryExec", NULL); + if (value != NULL && g_shell_parse_argv (value, NULL, &args, NULL)) + { + if (!g_file_test (args[0], G_FILE_TEST_EXISTS)) + { + command = g_find_program_in_path (args[0]); + if (command == NULL) + skip = TRUE; + g_free (command); + } + + g_strfreev (args); + } + + xfce_rc_close (rc); + + /* check if we should skip the item */ + if (G_UNLIKELY (skip)) + { + xfae_item_free (item); + item = NULL; + } + } + + return item; +} + + + +static void +xfae_item_free (XfaeItem *item) +{ + if (G_UNLIKELY (item == NULL)) + return; + + if (item->icon != NULL) + g_object_unref (G_OBJECT (item->icon)); + + g_free (item->relpath); + g_free (item->comment); + g_free (item->name); + g_free (item->tooltip); + g_free (item); +} + + + +static gboolean +xfae_item_is_removable (XfaeItem *item) +{ + gboolean removable = TRUE; + gchar **files; + gchar *dir; + guint n; + + /* check whether all of the containing directories are writable */ + files = xfce_resource_lookup_all (XFCE_RESOURCE_CONFIG, item->relpath); + for (n = 0; files[n] != NULL; ++n) + { + dir = g_path_get_dirname (files[n]); + if (access (dir, R_OK | W_OK | X_OK) < 0) + removable = FALSE; + g_free (dir); + } + g_strfreev (files); + + return removable; +} + + + +static gboolean +xfae_item_remove (XfaeItem *item, + GError **error) +{ + gboolean succeed = TRUE; + gchar **files; + guint n; + + /* remove all files that belong to this item */ + files = xfce_resource_lookup_all (XFCE_RESOURCE_CONFIG, item->relpath); + for (n = 0; files[n] != NULL; ++n) + { + if (unlink (files[n]) < 0 && errno != ENOENT) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), + _("Failed to unlink %s: %s"), files[n], g_strerror (errno)); + succeed = FALSE; + break; + } + } + g_strfreev (files); + + return succeed; +} + + + +/** + * Essentially determines, if the "toggle" value in the treeview + * is true or false + **/ +static gboolean +xfae_item_is_enabled (const XfaeItem * item) +{ + if (item->show_in_xfce) + return !item->hidden; + + return !item->hidden && item->show_in_override; +} + + + +/** + * Initial sorting given, when list is created first + **/ +static gint +xfae_item_sort_default (gconstpointer a, + gconstpointer b) +{ + const XfaeItem *item_a = a; + const XfaeItem *item_b = b; + + /* sort non-xfce items below */ + if (item_a->show_in_xfce != item_b->show_in_xfce) + return item_a->show_in_xfce ? -1 : 1; + + return g_utf8_collate (item_a->name, item_b->name); +} + + + +static gint +xfae_item_sort_name (gconstpointer a, + gconstpointer b) +{ + const XfaeItem *item_a = a; + const XfaeItem *item_b = b; + + return g_utf8_collate (item_a->name, item_b->name); +} + + + +static gint +xfae_item_sort_enabled (gconstpointer a, + gconstpointer b) +{ + const XfaeItem *item_a = a; + const XfaeItem *item_b = b; + + /* Ordering: ASC = true,false; DESC = false,true */ + return (xfae_item_is_enabled (item_b) - xfae_item_is_enabled (item_a)); +} + + + +static gint +xfae_item_sort_hook (gconstpointer a, + gconstpointer b) +{ + const XfaeItem *item_a = a; + const XfaeItem *item_b = b; + + return (item_a->run_hook - item_b->run_hook); +} + + + +/** + * xfae_model_new: + * + * Allocates a new #XfaeModel instance. + * + * Return value: the newly allocated #XfaeModel instance. + **/ +GtkTreeModel* +xfae_model_new (void) +{ + return g_object_new (XFAE_TYPE_MODEL, NULL); +} + + + +/** + * xfae_model_add: + * @model : a #XfaeModel. + * @name : the user visible name of the new item. + * @description : the description for the new item. + * @command : the command for the new item. + * @run_hook : hook/trigger on which the command should be executed. + * @error : return locations for errors or %NULL. + * + * Attempts to add a new item with the given parameters + * to @model. + * + * Return value: %TRUE if successfull, else %FALSE. + **/ +gboolean +xfae_model_add (XfaeModel *model, + const gchar *name, + const gchar *description, + const gchar *command, + XfsmRunHook run_hook, + GError **error) +{ + GtkTreePath *path; + GtkTreeIter iter; + XfaeItem *item; + XfceRc *rc; + gchar *file; + gchar *dir; + gchar relpath[4096]; + guint n; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (name != NULL, FALSE); + g_return_val_if_fail (description != NULL, FALSE); + g_return_val_if_fail (command != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + dir = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, "autostart/", TRUE); + + /* generate a unique file name */ + for (n = 0;; ++n) + { + file = (n == 0) + ? g_strdup_printf ("%s.desktop", name) + : g_strdup_printf ("%s-%u.desktop", name, n); + file = g_strdelimit (file, G_DIR_SEPARATOR_S, '-'); /* not a copy */ + + g_snprintf (relpath, 4096, "%s%s", dir, file); + if (!g_file_test (relpath, G_FILE_TEST_IS_REGULAR)) + break; + + g_free (file); + } + + /* generate the file spec */ + g_snprintf (relpath, 4096, "autostart/%s", file); + g_free (file); + g_free (dir); + + /* generate the .desktop file */ + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, relpath, FALSE); + if (G_UNLIKELY (rc == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to create file %s"), relpath); + return FALSE; + } + + /* write the content */ + xfce_rc_set_group (rc, "Desktop Entry"); + xfce_rc_write_entry (rc, "Encoding", "UTF-8"); + xfce_rc_write_entry (rc, "Version", "0.9.4"); + xfce_rc_write_entry (rc, "Type", "Application"); + xfce_rc_write_entry (rc, "Name", name); + xfce_rc_write_entry (rc, "Comment", description); + xfce_rc_write_entry (rc, "Exec", command); + xfce_rc_write_entry (rc, "OnlyShowIn", "XFCE;"); + xfce_rc_write_int_entry (rc, "RunHook", run_hook); + xfce_rc_write_bool_entry (rc, "StartupNotify", FALSE); + xfce_rc_write_bool_entry (rc, "Terminal", FALSE); + xfce_rc_write_bool_entry (rc, "Hidden", FALSE); + xfce_rc_close (rc); + + /* now load the matching item for the list */ + item = xfae_item_new (relpath); + if (G_UNLIKELY (item == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to write file %s"), relpath); + return FALSE; + } + + /* append it to our list */ + model->items = g_list_append (model->items, item); + + /* generate the iter for the newly appended item */ + iter.stamp = model->stamp; + iter.user_data = g_list_last (model->items); + + /* tell the view about it */ + path = gtk_tree_path_new_from_indices (g_list_length (model->items) - 1, -1); + gtk_tree_model_row_inserted (GTK_TREE_MODEL (model), path, &iter); + gtk_tree_path_free (path); + + return TRUE; +} + + + +/** + * xfae_model_get: + * @model : a #XfaeModel. + * @name : the user visible name of the new item. + * @description : the description for the new item. + * @command : the command for the new item. + * @error : return locations for errors or %NULL. + * + * Attempts to add a new item with the given parameters + * to @model. + * + * Return value: %TRUE if successfull, else %FALSE. + **/ +gboolean +xfae_model_get (XfaeModel *model, + GtkTreeIter *iter, + gchar **name, + gchar **description, + gchar **command, + XfsmRunHook *run_hook, + GError **error) +{ + XfaeItem *item; + GList *lp; + XfceRc *rc; + const gchar *value; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (iter->stamp == model->stamp, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + lp = iter->user_data; + item = lp->data; + + /* try to open the resource config */ + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, item->relpath, FALSE); + if (G_UNLIKELY (rc == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to open %s for reading"), item->relpath); + return FALSE; + } + + xfce_rc_set_group (rc, "Desktop Entry"); + + /* read the resource config */ + value = xfce_rc_read_entry (rc, "Name", NULL); + if (name != NULL) + *name = g_strdup (value); + + value = xfce_rc_read_entry (rc, "Comment", NULL); + if (description != NULL) + *description = g_strdup (value); + + value = xfce_rc_read_entry (rc, "Exec", NULL); + if (command != NULL) + *command = g_strdup (value); + + if (run_hook != NULL) + *run_hook = xfce_rc_read_int_entry (rc, "RunHook", XFSM_RUN_HOOK_LOGIN); + + xfce_rc_close (rc); + + return TRUE; +} + + + +/** + * xfae_model_remove: + * @model : a #XfaeModel. + * @iter : the #GtkTreeIter referring to the item that should be removed. + * @error : return location for errors or %NULL. + * + * Tries to remove the item referred to by @iter from @model. + * + * Return value: %TRUE if the removal was successful. + **/ +gboolean +xfae_model_remove (XfaeModel *model, + GtkTreeIter *iter, + GError **error) +{ + GtkTreePath *path; + XfaeItem *item; + GList *lp; + gint index_; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (iter->stamp == model->stamp, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + lp = iter->user_data; + item = lp->data; + + /* try to unlink the item from disk */ + if (!xfae_item_remove (item, error)) + return FALSE; + + /* unlink the item from the list */ + index_ = g_list_position (model->items, lp); + model->items = g_list_delete_link (model->items, lp); + xfae_item_free (item); + + /* tell the view that we have just removed one item */ + path = gtk_tree_path_new_from_indices (index_, -1); + gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path); + gtk_tree_path_free (path); + + return TRUE; +} + + + +/** + * xfae_model_edit: + * @model : a #XfaeModel. + * @iter : the #GtkTreeIter referring to the item that should be removed. + * @name : the user visible name of the new item. + * @description : the description for the new item. + * @command : the command for the new item. + * @run_hook : hook/trigger on which the command should be executed. + * @error : return locations for errors or %NULL. + * + * Attempts to edit an item with the given parameters + * to @model. + * + * Return value: %TRUE if successfull, else %FALSE. + **/ +gboolean +xfae_model_edit (XfaeModel *model, + GtkTreeIter *iter, + const gchar *name, + const gchar *description, + const gchar *command, + XfsmRunHook run_hook, + GError **error) +{ + GtkTreePath *path; + XfaeItem *item; + XfceRc *rc; + GList *lp; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (iter->stamp == model->stamp, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + lp = iter->user_data; + item = lp->data; + + /* try to open the resource config */ + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, item->relpath, FALSE); + if (G_UNLIKELY (rc == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to open %s for writing"), item->relpath); + return FALSE; + } + + item->name = g_strdup (name); + item->comment = g_strdup (description); + + /* write the result */ + xfce_rc_set_group (rc, "Desktop Entry"); + xfce_rc_write_entry (rc, "Name", name); + xfce_rc_write_entry (rc, "Comment", description); + xfce_rc_write_entry (rc, "Exec", command); + xfce_rc_write_int_entry (rc, "RunHook", run_hook); + xfce_rc_close (rc); + + /* tell the view that we have most probably a new state */ + path = gtk_tree_path_new_from_indices (g_list_position (model->items, lp), -1); + gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, iter); + gtk_tree_path_free (path); + + return TRUE; +} + + + + +/** + * xfae_model_toggle: + * @model : a #XfaeModel. + * @iter : the #GtkTreeIter referring to the item that should be toggled. + * @error : return location for errors or %NULL. + * + * Attempts to toggle the state of the item referrred to by @iter. + * + * Return value: %TRUE on success, else %FALSE. + **/ +gboolean +xfae_model_toggle (XfaeModel *model, + GtkTreeIter *iter, + GError **error) +{ + GtkTreePath *path; + XfaeItem *item; + XfceRc *rc; + GList *lp; + + g_return_val_if_fail (XFAE_IS_MODEL (model), FALSE); + g_return_val_if_fail (iter->stamp == model->stamp, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + lp = iter->user_data; + item = lp->data; + + /* try to open the resource config */ + rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, item->relpath, FALSE); + if (G_UNLIKELY (rc == NULL)) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (EIO), + _("Failed to open %s for writing"), item->relpath); + return FALSE; + } + + xfce_rc_set_group (rc, "Desktop Entry"); + + if (item->show_in_xfce) + { + /* This is an application with no OnlyShowIn categories or with + * XFCE in it. In this case, toggle the Hidden flag */ + + item->hidden = !item->hidden; + xfce_rc_write_bool_entry (rc, "Hidden", item->hidden); + } + else + { + /* Normally a non-Xfce autostart application, toggle the override + * boolean so we don't hide the service in other desktops */ + + item->show_in_override = !item->show_in_override; + xfce_rc_write_bool_entry (rc, "X-XFCE-Autostart-Override", item->show_in_override); + + /* if we override, but the item is still hidden, toggle that as well then */ + if (item->hidden && item->show_in_override) + { + item->hidden = !item->hidden; + xfce_rc_write_bool_entry (rc, "Hidden", item->hidden); + } + } + + xfce_rc_close (rc); + + /* tell the view that we have most probably a new state */ + path = gtk_tree_path_new_from_indices (g_list_position (model->items, lp), -1); + gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, iter); + gtk_tree_path_free (path); + + return TRUE; +} + + + + diff --git a/settings/xfae-model.h b/settings/xfae-model.h new file mode 100644 index 0000000..74ac144 --- /dev/null +++ b/settings/xfae-model.h @@ -0,0 +1,119 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifndef __XFAE_MODEL_H__ +#define __XFAE_MODEL_H__ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS; + +typedef struct _XfaeModelClass XfaeModelClass; +typedef struct _XfaeModel XfaeModel; + +#define XFAE_TYPE_MODEL (xfae_model_get_type ()) +#define XFAE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFAE_TYPE_MODEL, XfaeModel)) +#define XFAE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFAE_TYPE_MODEL, XfaeModelClass)) +#define XFAE_IS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFAE_TYPE_MODEL)) +#define XFAE_IS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFAE_TYPE_MODEL)) +#define XFAE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFAE_TYPE_MODEL, XfaeModelClass)) + +#define XFSM_TYPE_RUN_HOOK (xfsm_run_hook_get_type ()) + +/** + * XfsmRunHook: + * The trigger / hook on which a specific command should be executed + **/ +typedef enum +{ + XFSM_RUN_HOOK_LOGIN, + XFSM_RUN_HOOK_LOGOUT, + XFSM_RUN_HOOK_SHUTDOWN, + XFSM_RUN_HOOK_RESTART, + XFSM_RUN_HOOK_SUSPEND, + XFSM_RUN_HOOK_HIBERNATE, + XFSM_RUN_HOOK_HYBRID_SLEEP, + XFSM_RUN_HOOK_SWITCH_USER, +} XfsmRunHook; + +GType xfsm_run_hook_get_type (void) G_GNUC_CONST; + +/** + * XfaeModelColumn: + * + * Columns exported by the #XfaeModelColumn using + * the #GtkTreeModel interface. + **/ +typedef enum +{ + XFAE_MODEL_COLUMN_ICON, + XFAE_MODEL_COLUMN_NAME, + XFAE_MODEL_COLUMN_ENABLED, + XFAE_MODEL_COLUMN_REMOVABLE, + XFAE_MODEL_COLUMN_TOOLTIP, + XFAE_MODEL_RUN_HOOK, + XFAE_MODEL_N_COLUMNS, +} XfaeModelColumn; + +GType xfae_model_get_type (void) G_GNUC_CONST; + +GtkTreeModel *xfae_model_new (void); + +gboolean xfae_model_add (XfaeModel *model, + const gchar *name, + const gchar *description, + const gchar *command, + XfsmRunHook run_hook, + GError **error); + +gboolean xfae_model_get (XfaeModel *model, + GtkTreeIter *iter, + gchar **name, + gchar **description, + gchar **command, + XfsmRunHook *run_hook, + GError **error); + +gboolean xfae_model_remove (XfaeModel *model, + GtkTreeIter *iter, + GError **error); + +gboolean xfae_model_edit (XfaeModel *model, + GtkTreeIter *iter, + const gchar *name, + const gchar *description, + const gchar *command, + XfsmRunHook run_hook, + GError **error); + +gboolean xfae_model_toggle (XfaeModel *model, + GtkTreeIter *iter, + GError **error); + +gboolean xfae_model_set_run_hook (GtkTreeModel *tree_model, + GtkTreePath *path, + GtkTreeIter *iter, + XfsmRunHook run_hook, + GError **error); + +G_END_DECLS; + +#endif /* !__XFAE_MODEL_H__ */ diff --git a/settings/xfae-window.c b/settings/xfae-window.c new file mode 100644 index 0000000..a9ebd37 --- /dev/null +++ b/settings/xfae-window.c @@ -0,0 +1,548 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2008 Jannis Pohlmann <jannis@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "xfae-window.h" +#include "xfae-dialog.h" +#include "xfae-model.h" + +#include <xfce4-session/xfsm-global.h> +#include <libxfce4ui/libxfce4ui.h> + +static void xfae_window_add (XfaeWindow *window); +static void xfae_window_remove (XfaeWindow *window); +static void xfae_window_edit (XfaeWindow *window); +static gboolean xfae_window_button_press_event (GtkWidget *treeview, + GdkEventButton *event, + XfaeWindow *window); +static void xfae_window_item_toggled (XfaeWindow *window, + gchar *path_string); +static void xfae_window_selection_changed (GtkTreeSelection *selection, + GtkWidget *remove_button); +static void xfae_window_correct_treeview_column_size (GtkWidget *treeview, + gpointer user_data); +static GtkTreeModel* xfae_window_create_run_hooks_combo_model (void); + + + + + +struct _XfaeWindowClass +{ + GtkBoxClass __parent__; +}; + +struct _XfaeWindow +{ + GtkBox __parent__; + + GtkTreeSelection *selection; + + GtkWidget *treeview; +}; + + + +G_DEFINE_TYPE (XfaeWindow, xfae_window, GTK_TYPE_BOX); + + + +static void +xfae_window_class_init (XfaeWindowClass *klass) +{ +} + + + +static void +run_hook_changed (GtkCellRenderer *render, + const gchar *path_str, + const gchar *new_text, + gpointer user_data) +{ + GEnumClass *klass; + GEnumValue *enum_struct; + GtkTreeView *treeview = user_data; + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkTreePath *path = gtk_tree_path_new_from_string (path_str); + GtkTreeIter iter; + GError *error = NULL; + + if (gtk_tree_model_get_iter (model, &iter, path)) + { + klass = g_type_class_ref (XFSM_TYPE_RUN_HOOK); + enum_struct = g_enum_get_value_by_nick (klass, new_text); + g_type_class_unref (klass); + if (!xfae_model_set_run_hook (model, path, &iter, enum_struct->value, &error)) + { + xfce_dialog_show_error (NULL, error, _("Failed to set run hook")); + g_error_free (error); + } + } + gtk_tree_path_free (path); +} + + + +static void +xfae_window_correct_treeview_column_size (GtkWidget *treeview, + gpointer user_data) +{ + gtk_tree_view_columns_autosize (GTK_TREE_VIEW (treeview)); +} + + + +static void +xfae_window_init (XfaeWindow *window) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer; + GtkTreeModel *model; + GtkWidget *vbox; + GtkWidget *img; + GtkWidget *swin; + GtkWidget *bbox; + GtkWidget *button; + + vbox = GTK_WIDGET (window); + gtk_orientable_set_orientation (GTK_ORIENTABLE (vbox), + GTK_ORIENTATION_VERTICAL); + gtk_box_set_spacing (GTK_BOX (vbox), 0); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); + + swin = g_object_new (GTK_TYPE_SCROLLED_WINDOW, + "hadjustment", NULL, + "vadjustment", NULL, + "shadow-type", GTK_SHADOW_IN, + "vscrollbar-policy", GTK_POLICY_AUTOMATIC, + "hscrollbar-policy", GTK_POLICY_AUTOMATIC, + NULL); + gtk_box_pack_start (GTK_BOX (vbox), swin, TRUE, TRUE, 0); + gtk_widget_show (swin); + + window->treeview = g_object_new (GTK_TYPE_TREE_VIEW, + "headers-visible", FALSE, + "hadjustment", NULL, + "vadjustment", NULL, + NULL); + g_signal_connect (G_OBJECT (window->treeview), "button-press-event", + G_CALLBACK (xfae_window_button_press_event), window); + // fix buggy sizing behavior of gtk + g_signal_connect (G_OBJECT (window->treeview), "realize", + G_CALLBACK(xfae_window_correct_treeview_column_size), NULL); + + gtk_container_add (GTK_CONTAINER (swin), window->treeview); + gtk_widget_show (window->treeview); + + model = xfae_model_new (); + gtk_tree_view_set_model (GTK_TREE_VIEW (window->treeview), model); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (window->treeview), TRUE); + gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (window->treeview), XFAE_MODEL_COLUMN_TOOLTIP); + g_object_unref (G_OBJECT (model)); + + window->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (window->treeview)); + gtk_tree_selection_set_mode (window->selection, GTK_SELECTION_SINGLE); + + // Column "toggled" + column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, + "reorderable", FALSE, + "resizable", FALSE, + NULL); + renderer = gtk_cell_renderer_toggle_new (); + g_signal_connect_swapped (G_OBJECT (renderer), "toggled", + G_CALLBACK (xfae_window_item_toggled), window); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_set_attributes (column, renderer, + "active", XFAE_MODEL_COLUMN_ENABLED, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (window->treeview), column); + gtk_tree_view_column_set_sort_column_id(column, XFAE_MODEL_COLUMN_ENABLED); + + // Column "Program" + column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, + "reorderable", FALSE, + "resizable", FALSE, + "expand", TRUE, + NULL); + gtk_tree_view_column_set_title (column, _("Program")); + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_set_attributes (column, renderer, + "pixbuf", XFAE_MODEL_COLUMN_ICON, + NULL); + renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, + "ellipsize", PANGO_ELLIPSIZE_END, + NULL); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + gtk_tree_view_column_set_attributes (column, renderer, + "markup", XFAE_MODEL_COLUMN_NAME, + NULL); + + gtk_tree_view_column_set_sort_column_id(column, XFAE_MODEL_COLUMN_NAME); + + gtk_tree_view_append_column (GTK_TREE_VIEW (window->treeview), column); + + + // Column "Trigger" + column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, + "reorderable", FALSE, + "resizable", FALSE, + NULL); + gtk_tree_view_column_set_title (column, _("Trigger")); + renderer = gtk_cell_renderer_combo_new (); + model = xfae_window_create_run_hooks_combo_model (); + g_object_set (renderer, + "has-entry", FALSE, + "model", model, + "text-column", 0, + "editable", TRUE, + "mode", GTK_CELL_RENDERER_MODE_EDITABLE, + NULL); + g_signal_connect (renderer, "edited", G_CALLBACK (run_hook_changed), window->treeview); + + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_set_attributes (column, renderer, + "text", XFAE_MODEL_RUN_HOOK, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (window->treeview), column); + gtk_tree_view_column_set_sort_column_id(column, XFAE_MODEL_RUN_HOOK); + + g_object_unref (model); + + bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, TRUE, 0); + gtk_style_context_add_class (gtk_widget_get_style_context (bbox), "inline-toolbar"); + gtk_widget_show (bbox); + + button = gtk_button_new (); + img = gtk_image_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (button), img); + gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Add application")); + g_signal_connect_swapped (G_OBJECT (button), "clicked", + G_CALLBACK (xfae_window_add), window); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new (); + img = gtk_image_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (button), img); + gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Remove application")); + g_signal_connect_swapped (G_OBJECT (button), "clicked", + G_CALLBACK (xfae_window_remove), window); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + g_signal_connect (G_OBJECT (window->selection), "changed", + G_CALLBACK (xfae_window_selection_changed), button); + xfae_window_selection_changed (window->selection, button); + + button = gtk_button_new (); + img = gtk_image_new_from_icon_name ("document-edit-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (button), img); + gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Edit application")); + g_signal_connect_swapped (G_OBJECT (button), "clicked", + G_CALLBACK (xfae_window_edit), window); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + g_signal_connect (G_OBJECT (window->selection), "changed", + G_CALLBACK (xfae_window_selection_changed), button); + xfae_window_selection_changed (window->selection, button); +} + + + +static GtkTreeModel * +xfae_window_create_run_hooks_combo_model (void) +{ + GtkListStore *ls = gtk_list_store_new (1, G_TYPE_STRING); + GEnumClass *klass; + GEnumValue *enum_struct; + GtkTreeIter iter; + guint i; + + klass = g_type_class_ref (XFSM_TYPE_RUN_HOOK); + for (i = 0; i < klass->n_values; ++i) + { + gtk_list_store_append (ls, &iter); + enum_struct = g_enum_get_value (klass, i); + gtk_list_store_set (ls, &iter, 0, enum_struct->value_nick, -1); + } + g_type_class_unref (klass); + return GTK_TREE_MODEL (ls); +} + + + +static gboolean +xfae_window_button_press_event (GtkWidget *treeview, + GdkEventButton *event, + XfaeWindow *window) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + GMainLoop *loop; + GtkWidget *menu; + GtkWidget *item; + gboolean removable = FALSE; + + if (event->button == 3 && event->type == GDK_BUTTON_PRESS) + { + if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview), + event->x, event->y, + &path, NULL, NULL, NULL)) + { + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + gtk_tree_selection_select_path (selection, path); + gtk_tree_path_free (path); + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + gtk_tree_model_get (model, &iter, XFAE_MODEL_COLUMN_REMOVABLE, &removable, -1); + + menu = gtk_menu_new (); + + item = gtk_menu_item_new_with_label (_("Add")); + g_signal_connect_swapped (G_OBJECT (item), "activate", + G_CALLBACK (xfae_window_add), window); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_widget_show (item); + + item = gtk_menu_item_new_with_label (_("Remove")); + g_signal_connect_swapped (G_OBJECT (item), "activate", + G_CALLBACK (xfae_window_remove), window); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_widget_set_sensitive (item, removable); + gtk_widget_show (item); + + gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (treeview)); + + loop = g_main_loop_new (NULL, FALSE); + g_signal_connect_swapped (G_OBJECT (menu), "deactivate", + G_CALLBACK (g_main_loop_quit), loop); + gtk_grab_add (menu); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, + NULL, event->button, event->time); + g_main_loop_run (loop); + g_main_loop_unref (loop); + gtk_grab_remove (menu); + + g_object_ref_sink (menu); + + return TRUE; + } + } + + return FALSE; +} + + + +static void +xfae_window_add (XfaeWindow *window) +{ + GtkTreeModel *model; + GtkWidget *parent; + GtkWidget *dialog; + GError *error = NULL; + gchar *name; + gchar *descr; + gchar *command; + XfsmRunHook run_hook; + + dialog = xfae_dialog_new (NULL, NULL, NULL, XFSM_RUN_HOOK_LOGIN); + parent = gtk_widget_get_toplevel (GTK_WIDGET (window)); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + { + gtk_widget_hide (dialog); + + xfae_dialog_get (XFAE_DIALOG (dialog), &name, &descr, &command, &run_hook); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (window->treeview)); + if (!xfae_model_add (XFAE_MODEL (model), name, descr, command, run_hook, &error)) + { + xfce_dialog_show_error (GTK_WINDOW (parent), error, _("Failed adding \"%s\""), name); + g_error_free (error); + } + + g_free (command); + g_free (descr); + g_free (name); + } + gtk_widget_destroy (dialog); +} + + + +static void +xfae_window_remove (XfaeWindow *window) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + GError *error = NULL; + GtkWidget *parent; + gchar *name; + gboolean remove_item; + + parent = gtk_widget_get_toplevel (GTK_WIDGET (window)); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (window->treeview)); + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + { + if (!xfae_model_get (XFAE_MODEL (model), &iter, &name, NULL, NULL, NULL, &error)) + { + xfce_dialog_show_error (GTK_WINDOW (parent), error, _("Failed to remove item")); + g_error_free (error); + return; + } + remove_item = TRUE; +/* remove_item = xfce_dialog_confirm (GTK_WINDOW (parent), GTK_STOCK_REMOVE, NULL, + _("This will permanently remove the application " + "from the list of automatically started applications"), + _("Are you sure you want to remove \"%s\""), name); +*/ + g_free (name); + + if (remove_item && !xfae_model_remove (XFAE_MODEL (model), &iter, &error)) + { + xfce_dialog_show_error (GTK_WINDOW (parent), error, _("Failed to remove item")); + g_error_free (error); + } + } +} + + + +static void +xfae_window_edit (XfaeWindow *window) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + GError *error = NULL; + gchar *name; + gchar *descr; + gchar *command; + XfsmRunHook run_hook; + GtkWidget *parent; + GtkWidget *dialog; + + parent = gtk_widget_get_toplevel (GTK_WIDGET (window)); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (window->treeview)); + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + { + if (!xfae_model_get (XFAE_MODEL (model), &iter, &name, &descr, &command, &run_hook, &error)) + { + xfce_dialog_show_error (GTK_WINDOW (parent), error, _("Failed to edit item")); + g_error_free (error); + return; + } + + dialog = xfae_dialog_new (name, descr, command, run_hook); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); + + g_free (command); + g_free (descr); + g_free (name); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + { + gtk_widget_hide (dialog); + + xfae_dialog_get (XFAE_DIALOG (dialog), &name, &descr, &command, &run_hook); + + if (!xfae_model_edit (XFAE_MODEL (model), &iter, name, descr, command, run_hook, &error)) + { + xfce_dialog_show_error (GTK_WINDOW (parent), error, _("Failed to edit item \"%s\""), name); + g_error_free (error); + } + + g_free (command); + g_free (descr); + g_free (name); + } + gtk_widget_destroy (dialog); + } +} + + +static void +xfae_window_item_toggled (XfaeWindow *window, + gchar *path_string) +{ + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + GError *error = NULL; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (window->treeview)); + path = gtk_tree_path_new_from_string (path_string); + if (gtk_tree_model_get_iter (model, &iter, path)) + { + if (!xfae_model_toggle (XFAE_MODEL (model), &iter, &error)) + { + xfce_dialog_show_error (NULL, error, _("Failed to toggle item")); + g_error_free (error); + } + } + gtk_tree_path_free (path); +} + + + +static void +xfae_window_selection_changed (GtkTreeSelection *selection, + GtkWidget *remove_button) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gboolean removable = FALSE; + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + gtk_tree_model_get (model, &iter, XFAE_MODEL_COLUMN_REMOVABLE, &removable, -1); + + gtk_widget_set_sensitive (remove_button, removable); +} + + + +/** + * xfae_window_new: + * + * Allocates a new #XfaeWindow instance. + * + * Return value: the newly allocated #XfaeWindow instance. + **/ +GtkWidget* +xfae_window_new (void) +{ + return g_object_new (XFAE_TYPE_WINDOW, NULL); +} diff --git a/settings/xfae-window.h b/settings/xfae-window.h new file mode 100644 index 0000000..099e909 --- /dev/null +++ b/settings/xfae-window.h @@ -0,0 +1,46 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2008 Jannis Pohlmann <jannis@xfce.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifndef __XFAE_WINDOW_H__ +#define __XFAE_WINDOW_H__ + +#include "xfae-model.h" + +G_BEGIN_DECLS; + +typedef struct _XfaeWindowClass XfaeWindowClass; +typedef struct _XfaeWindow XfaeWindow; + +#define XFAE_TYPE_WINDOW (xfae_window_get_type ()) +#define XFAE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFAE_TYPE_WINDOW, XfaeWindow)) +#define XFAE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFAE_TYPE_WINDOW, XfaeWindow)) +#define XFAE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFAE_TYPE_WINDOW)) +#define XFAE_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFAE_TYPE_WINDOW)) +#define XFAE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFAE_TYPE_WINDOW, XfaeWindowClass)) + +GType xfae_window_get_type (void) G_GNUC_CONST; + +GtkWidget *xfae_window_new (void) G_GNUC_MALLOC; + +G_END_DECLS; + +#endif /* !__XFAE_WINDOW_H__ */ diff --git a/settings/xfce-session-settings.desktop.in b/settings/xfce-session-settings.desktop.in new file mode 100644 index 0000000..cf9d8be --- /dev/null +++ b/settings/xfce-session-settings.desktop.in @@ -0,0 +1,14 @@ +[Desktop Entry] +_Name=Session and Startup +_Comment=Customize desktop startup +Exec=xfce4-session-settings +Icon=org.xfce.session +Terminal=false +StartupNotify=true +Type=Application +Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; +_Keywords=session;settings;preferences;manager;startup;login;logout;shutdown;lock screen;application;autostart;launch;services;daemon;agent; +OnlyShowIn=XFCE; +X-XfcePluggable=true +X-XfceHelpComponent=xfce4-session +X-XfceHelpPage=preferences diff --git a/settings/xfce4-session-marshal.c b/settings/xfce4-session-marshal.c new file mode 100644 index 0000000..1afe9db --- /dev/null +++ b/settings/xfce4-session-marshal.c @@ -0,0 +1,124 @@ +#include "xfce4-session-marshal.h" +/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ +#include <glib-object.h> + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_schar (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + +/* VOID:UINT,UINT (xfce4-session-marshal.list:1) */ +void +xfce4_session_marshal_VOID__UINT_UINT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1, + guint arg1, + guint arg2, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__UINT_UINT callback; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_uint (param_values + 1), + g_marshal_value_peek_uint (param_values + 2), + data2); +} + +/* VOID:STRING,BOXED (xfce4-session-marshal.list:2) */ +void +xfce4_session_marshal_VOID__STRING_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_BOXED) (gpointer data1, + gpointer arg1, + gpointer arg2, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__STRING_BOXED callback; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_boxed (param_values + 2), + data2); +} + diff --git a/settings/xfce4-session-marshal.h b/settings/xfce4-session-marshal.h new file mode 100644 index 0000000..049c833 --- /dev/null +++ b/settings/xfce4-session-marshal.h @@ -0,0 +1,30 @@ +/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ +#ifndef __XFCE4_SESSION_MARSHAL_MARSHAL_H__ +#define __XFCE4_SESSION_MARSHAL_MARSHAL_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +/* VOID:UINT,UINT (xfce4-session-marshal.list:1) */ +extern +void xfce4_session_marshal_VOID__UINT_UINT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING,BOXED (xfce4-session-marshal.list:2) */ +extern +void xfce4_session_marshal_VOID__STRING_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + + +G_END_DECLS + +#endif /* __XFCE4_SESSION_MARSHAL_MARSHAL_H__ */ diff --git a/settings/xfce4-session-settings-common.h b/settings/xfce4-session-settings-common.h new file mode 100644 index 0000000..3c1a11d --- /dev/null +++ b/settings/xfce4-session-settings-common.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#ifndef __XFCE4_SESSION_SETTINGS_COMMON_H__ +#define __XFCE4_SESSION_SETTINGS_COMMON_H__ + +#define SETTINGS_CHANNEL "xfce4-session" + +void session_editor_init(GtkBuilder *builder); + +#endif diff --git a/settings/xfce4-session-settings.ui b/settings/xfce4-session-settings.ui new file mode 100644 index 0000000..a397c52 --- /dev/null +++ b/settings/xfce4-session-settings.ui @@ -0,0 +1,902 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> +<interface> + <requires lib="gtk+" version="3.12"/> + <requires lib="libxfce4ui-2" version="4.12"/> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-clear-symbolic</property> + </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">document-save-symbolic</property> + </object> + <object class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">list-remove-symbolic</property> + </object> + <object class="GtkImage" id="image4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">list-remove-symbolic</property> + </object> + <object class="GtkImage" id="image5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">window-close-symbolic</property> + </object> + <object class="GtkImage" id="image7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">help-browser</property> + </object> + <object class="GtkImage" id="image8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">help-browser</property> + </object> + <object class="GtkPopover" id="session-info"> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="margin_right">12</property> + <property name="margin_top">12</property> + <property name="margin_bottom">12</property> + <property name="label" translatable="yes">These applications are a part of the currently-running session, +and can be saved now or when you log out. +Changes below will only take effect when the session is saved.</property> + <property name="use_markup">True</property> + <property name="xalign">0</property> + </object> + </child> + </object> + <object class="XfceTitledDialog" id="xfce4_session_settings_dialog"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">Session and Startup</property> + <property name="window_position">center-on-parent</property> + <property name="default_width">600</property> + <property name="default_height">500</property> + <property name="icon_name">org.xfce.session</property> + <property name="type_hint">normal</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkButton" id="button1"> + <property name="label" translatable="yes">_Help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image7</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button2"> + <property name="label" translatable="yes">_Close</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image5</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="plug-child"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="border_width">6</property> + <child> + <object class="GtkBox" id="vbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="border_width">12</property> + <property name="orientation">vertical</property> + <property name="spacing">18</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="chk_display_chooser"> + <property name="label" translatable="yes">_Display chooser on login</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Display the session chooser every time Xfce starts</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Session Chooser</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="vbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="chk_session_autosave"> + <property name="label" translatable="yes">Automatically save session on logo_ut</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Always save the session when logging out</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="chk_logout_prompt"> + <property name="label" translatable="yes">Pro_mpt on logout</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Prompt for confirmation when logging out</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Logout Settings</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="vbox6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="chk_lock_screen"> + <property name="label" translatable="yes">Lock screen be_fore sleep</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Run xflock4 before suspending or hibernating the system</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Shutdown</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_General</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox" id="vbox8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkInfoBar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="btn_save_session"> + <property name="label" translatable="yes">Save Sess_ion</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="valign">center</property> + <property name="image">image2</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkMenuButton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="popover">session-info</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">dialog-information-symbolic</property> + </object> + </child> + <style> + <class name="circular"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">1</property> + <property name="non_homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child internal-child="content_area"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="label_active_session"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Currently active session: <b>Default</b></property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">etched-in</property> + <child> + <object class="GtkTreeView" id="treeview_clients"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection2"/> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkBox" id="hbox7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <placeholder/> + </child> + <child> + <object class="GtkButton" id="btn_quit_client"> + <property name="label" translatable="yes">_Quit Program</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image3</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <style> + <class name="inline-toolbar"/> + </style> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Current Sessio_n</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkScrolledWindow" id="saved-sessions"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="saved-sessions-list"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkButton" id="btn_delete_session"> + <property name="label" translatable="yes">_Remove</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Delete the selected session</property> + <property name="image">image4</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkButton" id="btn_clear_sessions"> + <property name="label" translatable="yes">Clear Save_d Sessions</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">end</property> + <property name="valign">center</property> + <property name="image">image1</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> + <style> + <class name="inline-toolbar"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Saved _Sessions</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox" id="vbox3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="orientation">vertical</property> + <property name="spacing">18</property> + <child> + <object class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="vbox4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="chk_compat_gnome"> + <property name="label" translatable="yes">Launch GN_OME services on startup</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Start GNOME services, such as gnome-keyring</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="chk_compat_kde"> + <property name="label" translatable="yes">Launch _KDE services on startup</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Start KDE services, such as kdeinit</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Compatibility</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="chk_enable_tcp"> + <property name="label" translatable="yes">Manage _remote applications</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Manage remote applications over the network (this may be a security risk)</property> + <property name="use_underline">True</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Security</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Ad_vanced</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-11">button1</action-widget> + <action-widget response="-7">button2</action-widget> + </action-widgets> + </object> + <object class="GtkDialog" id="dialog_saving"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Saving Session</property> + <property name="resizable">False</property> + <property name="window_position">center-on-parent</property> + <property name="destroy_with_parent">True</property> + <property name="icon_name">xfce4-session</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="skip_pager_hint">True</property> + <property name="transient_for">xfce4_session_settings_dialog</property> + <child> + <placeholder/> + </child> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="button3"> + <property name="label">_Close</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image8</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="vbox5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="hbox8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="image6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">dialog-information</property> + <property name="icon_size">6</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Your session is being saved. If you do not wish to wait, you may close this window.</property> + <property name="wrap">True</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkProgressBar" id="progress_save_session"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">button3</action-widget> + </action-widgets> + </object> +</interface> diff --git a/settings/xfce4-session-settings_ui.h b/settings/xfce4-session-settings_ui.h new file mode 100644 index 0000000..1ef8ccc --- /dev/null +++ b/settings/xfce4-session-settings_ui.h @@ -0,0 +1,435 @@ +/* automatically generated from xfce4-session-settings.ui */ +#ifdef __SUNPRO_C +#pragma align 4 (xfce4_session_settings_ui) +#endif +#ifdef __GNUC__ +static const char xfce4_session_settings_ui[] __attribute__ ((__aligned__ (4))) = +#else +static const char xfce4_session_settings_ui[] = +#endif +{ + "<?xml version=\"1.0\" encoding=\"UTF-8\"?><interface><requires lib=\"gt" + "k+\" version=\"3.12\"/><requires lib=\"libxfce4ui-2\" version=\"4.12\"/" + "><object class=\"GtkImage\" id=\"image1\"><property name=\"visible\">Tr" + "ue</property><property name=\"can_focus\">False</property><property nam" + "e=\"icon_name\">edit-clear-symbolic</property></object><object class=\"" + "GtkImage\" id=\"image2\"><property name=\"visible\">True</property><pro" + "perty name=\"can_focus\">False</property><property name=\"icon_name\">d" + "ocument-save-symbolic</property></object><object class=\"GtkImage\" id=" + "\"image3\"><property name=\"visible\">True</property><property name=\"c" + "an_focus\">False</property><property name=\"icon_name\">list-remove-sym" + "bolic</property></object><object class=\"GtkImage\" id=\"image4\"><prop" + "erty name=\"visible\">True</property><property name=\"can_focus\">False" + "</property><property name=\"icon_name\">list-remove-symbolic</property>" + "</object><object class=\"GtkImage\" id=\"image5\"><property name=\"visi" + "ble\">True</property><property name=\"can_focus\">False</property><prop" + "erty name=\"icon_name\">window-close-symbolic</property></object><objec" + "t class=\"GtkImage\" id=\"image7\"><property name=\"visible\">True</pro" + "perty><property name=\"can_focus\">False</property><property name=\"ico" + "n_name\">help-browser</property></object><object class=\"GtkImage\" id=" + "\"image8\"><property name=\"visible\">True</property><property name=\"c" + "an_focus\">False</property><property name=\"icon_name\">help-browser</p" + "roperty></object><object class=\"GtkPopover\" id=\"session-info\"><prop" + "erty name=\"can_focus\">False</property><child><object class=\"GtkLabel" + "\"><property name=\"visible\">True</property><property name=\"can_focus" + "\">False</property><property name=\"margin_left\">12</property><propert" + "y name=\"margin_right\">12</property><property name=\"margin_top\">12</" + "property><property name=\"margin_bottom\">12</property><property name=\"" + "label\" translatable=\"yes\">These applications are a part of the curre" + "ntly-running session,\nand can be saved now or when you log out.\nChang" + "es below will only take effect when the session is saved.</property><pr" + "operty name=\"use_markup\">True</property><property name=\"xalign\">0</" + "property></object></child></object><object class=\"XfceTitledDialog\" i" + "d=\"xfce4_session_settings_dialog\"><property name=\"can_focus\">False<" + "/property><property name=\"title\" translatable=\"yes\">Session and Sta" + "rtup</property><property name=\"window_position\">center-on-parent</pro" + "perty><property name=\"default_width\">600</property><property name=\"d" + "efault_height\">500</property><property name=\"icon_name\">org.xfce.ses" + "sion</property><property name=\"type_hint\">normal</property><child int" + "ernal-child=\"vbox\"><object class=\"GtkBox\" id=\"dialog-vbox1\"><prop" + "erty name=\"visible\">True</property><property name=\"can_focus\">False" + "</property><property name=\"orientation\">vertical</property><property " + "name=\"spacing\">2</property><child internal-child=\"action_area\"><obj" + "ect class=\"GtkButtonBox\" id=\"dialog-action_area1\"><property name=\"" + "visible\">True</property><property name=\"can_focus\">False</property><" + "child><object class=\"GtkButton\" id=\"button1\"><property name=\"label" + "\" translatable=\"yes\">_Help</property><property name=\"use_action_app" + "earance\">False</property><property name=\"visible\">True</property><pr" + "operty name=\"can_focus\">True</property><property name=\"receives_defa" + "ult\">True</property><property name=\"image\">image7</property><propert" + "y name=\"use_underline\">True</property></object><packing><property nam" + "e=\"expand\">False</property><property name=\"fill\">False</property><p" + "roperty name=\"position\">0</property></packing></child><child><object " + "class=\"GtkButton\" id=\"button2\"><property name=\"label\" translatabl" + "e=\"yes\">_Close</property><property name=\"use_action_appearance\">Fal" + "se</property><property name=\"visible\">True</property><property name=\"" + "can_focus\">True</property><property name=\"receives_default\">True</pr" + "operty><property name=\"image\">image5</property><property name=\"use_u" + "nderline\">True</property></object><packing><property name=\"expand\">F" + "alse</property><property name=\"fill\">False</property><property name=\"" + "position\">1</property></packing></child></object><packing><property na" + "me=\"expand\">False</property><property name=\"fill\">True</property><p" + "roperty name=\"pack_type\">end</property><property name=\"position\">1<" + "/property></packing></child><child><object class=\"GtkNotebook\" id=\"p" + "lug-child\"><property name=\"visible\">True</property><property name=\"" + "can_focus\">True</property><property name=\"border_width\">6</property>" + "<child><object class=\"GtkBox\" id=\"vbox1\"><property name=\"visible\"" + ">True</property><property name=\"can_focus\">False</property><property " + "name=\"valign\">start</property><property name=\"border_width\">12</pro" + "perty><property name=\"orientation\">vertical</property><property name=" + "\"spacing\">18</property><child><object class=\"GtkFrame\" id=\"frame1\"" + "><property name=\"visible\">True</property><property name=\"can_focus\"" + ">False</property><property name=\"label_xalign\">0</property><property " + "name=\"shadow_type\">none</property><child><object class=\"GtkAlignment" + "\" id=\"alignment2\"><property name=\"visible\">True</property><propert" + "y name=\"can_focus\">False</property><property name=\"top_padding\">6</" + "property><property name=\"left_padding\">12</property><child><object cl" + "ass=\"GtkCheckButton\" id=\"chk_display_chooser\"><property name=\"labe" + "l\" translatable=\"yes\">_Display chooser on login</property><property " + "name=\"use_action_appearance\">False</property><property name=\"visible" + "\">True</property><property name=\"can_focus\">True</property><property" + " name=\"receives_default\">False</property><property name=\"tooltip_tex" + "t\" translatable=\"yes\">Display the session chooser every time Xfce st" + "arts</property><property name=\"use_underline\">True</property><propert" + "y name=\"xalign\">0.5</property><property name=\"draw_indicator\">True<" + "/property></object></child></object></child><child type=\"label\"><obje" + "ct class=\"GtkLabel\" id=\"label6\"><property name=\"visible\">True</pr" + "operty><property name=\"can_focus\">False</property><property name=\"la" + "bel\" translatable=\"yes\"><b>Session Chooser</b></property" + "><property name=\"use_markup\">True</property></object></child></object" + "><packing><property name=\"expand\">False</property><property name=\"fi" + "ll\">True</property><property name=\"position\">0</property></packing><" + "/child><child><object class=\"GtkFrame\" id=\"frame2\"><property name=\"" + "visible\">True</property><property name=\"can_focus\">False</property><" + "property name=\"label_xalign\">0</property><property name=\"shadow_type" + "\">none</property><child><object class=\"GtkAlignment\" id=\"alignment3" + "\"><property name=\"visible\">True</property><property name=\"can_focus" + "\">False</property><property name=\"top_padding\">6</property><property" + " name=\"left_padding\">12</property><child><object class=\"GtkBox\" id=" + "\"vbox2\"><property name=\"visible\">True</property><property name=\"ca" + "n_focus\">False</property><property name=\"orientation\">vertical</prop" + "erty><property name=\"spacing\">6</property><child><object class=\"GtkC" + "heckButton\" id=\"chk_session_autosave\"><property name=\"label\" trans" + "latable=\"yes\">Automatically save session on logo_ut</property><proper" + "ty name=\"use_action_appearance\">False</property><property name=\"visi" + "ble\">True</property><property name=\"can_focus\">True</property><prope" + "rty name=\"receives_default\">False</property><property name=\"tooltip_" + "text\" translatable=\"yes\">Always save the session when logging out</p" + "roperty><property name=\"use_underline\">True</property><property name=" + "\"xalign\">0.5</property><property name=\"draw_indicator\">True</proper" + "ty></object><packing><property name=\"expand\">False</property><propert" + "y name=\"fill\">True</property><property name=\"position\">0</property>" + "</packing></child><child><object class=\"GtkCheckButton\" id=\"chk_logo" + "ut_prompt\"><property name=\"label\" translatable=\"yes\">Pro_mpt on lo" + "gout</property><property name=\"use_action_appearance\">False</property" + "><property name=\"visible\">True</property><property name=\"can_focus\"" + ">True</property><property name=\"receives_default\">False</property><pr" + "operty name=\"tooltip_text\" translatable=\"yes\">Prompt for confirmati" + "on when logging out</property><property name=\"use_underline\">True</pr" + "operty><property name=\"xalign\">0.5</property><property name=\"active\"" + ">True</property><property name=\"draw_indicator\">True</property></obje" + "ct><packing><property name=\"expand\">False</property><property name=\"" + "fill\">True</property><property name=\"position\">1</property></packing" + "></child></object></child></object></child><child type=\"label\"><objec" + "t class=\"GtkLabel\" id=\"label7\"><property name=\"visible\">True</pro" + "perty><property name=\"can_focus\">False</property><property name=\"lab" + "el\" translatable=\"yes\"><b>Logout Settings</b></property>" + "<property name=\"use_markup\">True</property></object></child></object>" + "<packing><property name=\"expand\">True</property><property name=\"fill" + "\">True</property><property name=\"position\">1</property></packing></c" + "hild><child><object class=\"GtkFrame\" id=\"frame5\"><property name=\"v" + "isible\">True</property><property name=\"can_focus\">False</property><p" + "roperty name=\"label_xalign\">0</property><property name=\"shadow_type\"" + ">none</property><child><object class=\"GtkAlignment\" id=\"alignment1\"" + "><property name=\"visible\">True</property><property name=\"can_focus\"" + ">False</property><property name=\"top_padding\">6</property><property n" + "ame=\"left_padding\">12</property><child><object class=\"GtkBox\" id=\"" + "vbox6\"><property name=\"visible\">True</property><property name=\"can_" + "focus\">False</property><property name=\"orientation\">vertical</proper" + "ty><property name=\"spacing\">6</property><child><object class=\"GtkChe" + "ckButton\" id=\"chk_lock_screen\"><property name=\"label\" translatable" + "=\"yes\">Lock screen be_fore sleep</property><property name=\"use_actio" + "n_appearance\">False</property><property name=\"visible\">True</propert" + "y><property name=\"can_focus\">True</property><property name=\"receives" + "_default\">False</property><property name=\"tooltip_text\" translatable" + "=\"yes\">Run xflock4 before suspending or hibernating the system</prope" + "rty><property name=\"use_underline\">True</property><property name=\"xa" + "lign\">0</property><property name=\"draw_indicator\">True</property></o" + "bject><packing><property name=\"expand\">False</property><property name" + "=\"fill\">True</property><property name=\"position\">0</property></pack" + "ing></child></object></child></object></child><child type=\"label\"><ob" + "ject class=\"GtkLabel\" id=\"label25\"><property name=\"visible\">True<" + "/property><property name=\"can_focus\">False</property><property name=\"" + "label\" translatable=\"yes\"><b>Shutdown</b></property><pro" + "perty name=\"use_markup\">True</property></object></child></object><pac" + "king><property name=\"expand\">True</property><property name=\"fill\">T" + "rue</property><property name=\"position\">2</property></packing></child" + "></object></child><child type=\"tab\"><object class=\"GtkLabel\" id=\"l" + "abel1\"><property name=\"visible\">True</property><property name=\"can_" + "focus\">False</property><property name=\"label\" translatable=\"yes\">_" + "General</property><property name=\"use_underline\">True</property></obj" + "ect><packing><property name=\"tab_fill\">False</property></packing></ch" + "ild><child><object class=\"GtkBox\" id=\"vbox8\"><property name=\"visib" + "le\">True</property><property name=\"can_focus\">False</property><prope" + "rty name=\"border_width\">12</property><property name=\"orientation\">v" + "ertical</property><child><object class=\"GtkInfoBar\"><property name=\"" + "visible\">True</property><property name=\"can_focus\">False</property><" + "child internal-child=\"action_area\"><object class=\"GtkButtonBox\"><pr" + "operty name=\"can_focus\">False</property><property name=\"spacing\">6<" + "/property><property name=\"layout_style\">end</property><child><object " + "class=\"GtkButton\" id=\"btn_save_session\"><property name=\"label\" tr" + "anslatable=\"yes\">Save Sess_ion</property><property name=\"visible\">T" + "rue</property><property name=\"can_focus\">True</property><property nam" + "e=\"receives_default\">True</property><property name=\"valign\">center<" + "/property><property name=\"image\">image2</property><property name=\"us" + "e_underline\">True</property></object><packing><property name=\"expand\"" + ">False</property><property name=\"fill\">True</property><property name=" + "\"pack_type\">end</property><property name=\"position\">0</property></p" + "acking></child><child><object class=\"GtkMenuButton\"><property name=\"" + "visible\">True</property><property name=\"can_focus\">True</property><p" + "roperty name=\"receives_default\">True</property><property name=\"popov" + "er\">session-info</property><child><object class=\"GtkImage\"><property" + " name=\"visible\">True</property><property name=\"can_focus\">False</pr" + "operty><property name=\"icon_name\">dialog-information-symbolic</proper" + "ty></object></child><style><class name=\"circular\"/></style></object><" + "packing><property name=\"expand\">False</property><property name=\"fill" + "\">True</property><property name=\"pack_type\">end</property><property " + "name=\"position\">1</property><property name=\"non_homogeneous\">True</" + "property></packing></child></object><packing><property name=\"expand\">" + "False</property><property name=\"fill\">False</property><property name=" + "\"position\">0</property></packing></child><child internal-child=\"cont" + "ent_area\"><object class=\"GtkBox\"><property name=\"can_focus\">False<" + "/property><child><object class=\"GtkLabel\" id=\"label_active_session\"" + "><property name=\"visible\">True</property><property name=\"can_focus\"" + ">False</property><property name=\"label\" translatable=\"yes\">Currentl" + "y active session: <b>Default</b></property><property name=\"" + "use_markup\">True</property></object><packing><property name=\"expand\"" + ">False</property><property name=\"fill\">True</property><property name=" + "\"position\">0</property></packing></child></object><packing><property " + "name=\"expand\">False</property><property name=\"fill\">False</property" + "><property name=\"position\">0</property></packing></child><child><plac" + "eholder/></child></object><packing><property name=\"expand\">False</pro" + "perty><property name=\"fill\">True</property><property name=\"position\"" + ">1</property></packing></child><child><object class=\"GtkScrolledWindow" + "\" id=\"scrolledwindow4\"><property name=\"visible\">True</property><pr" + "operty name=\"can_focus\">True</property><property name=\"shadow_type\"" + ">etched-in</property><child><object class=\"GtkTreeView\" id=\"treeview" + "_clients\"><property name=\"visible\">True</property><property name=\"c" + "an_focus\">True</property><child internal-child=\"selection\"><object c" + "lass=\"GtkTreeSelection\" id=\"treeview-selection2\"/></child></object>" + "</child></object><packing><property name=\"expand\">True</property><pro" + "perty name=\"fill\">True</property><property name=\"position\">2</prope" + "rty></packing></child><child><object class=\"GtkBox\" id=\"hbox7\"><pro" + "perty name=\"visible\">True</property><property name=\"can_focus\">Fals" + "e</property><property name=\"spacing\">6</property><child><object class" + "=\"GtkBox\"><property name=\"visible\">True</property><property name=\"" + "can_focus\">False</property><child><placeholder/></child><child><object" + " class=\"GtkButton\" id=\"btn_quit_client\"><property name=\"label\" tr" + "anslatable=\"yes\">_Quit Program</property><property name=\"visible\">T" + "rue</property><property name=\"can_focus\">True</property><property nam" + "e=\"receives_default\">True</property><property name=\"image\">image3</" + "property><property name=\"use_underline\">True</property></object><pack" + "ing><property name=\"expand\">False</property><property name=\"fill\">T" + "rue</property><property name=\"position\">1</property></packing></child" + "><style><class name=\"inline-toolbar\"/></style></object><packing><prop" + "erty name=\"expand\">True</property><property name=\"fill\">True</prope" + "rty><property name=\"pack_type\">end</property><property name=\"positio" + "n\">3</property></packing></child></object><packing><property name=\"ex" + "pand\">False</property><property name=\"fill\">True</property><property" + " name=\"position\">3</property></packing></child></object><packing><pro" + "perty name=\"position\">1</property></packing></child><child type=\"tab" + "\"><object class=\"GtkLabel\" id=\"label3\"><property name=\"visible\">" + "True</property><property name=\"can_focus\">False</property><property n" + "ame=\"label\" translatable=\"yes\">Current Sessio_n</property><property" + " name=\"use_underline\">True</property></object><packing><property name" + "=\"position\">1</property><property name=\"tab_fill\">False</property><" + "/packing></child><child><object class=\"GtkBox\"><property name=\"visib" + "le\">True</property><property name=\"can_focus\">False</property><prope" + "rty name=\"border_width\">12</property><property name=\"orientation\">v" + "ertical</property><child><object class=\"GtkBox\"><property name=\"visi" + "ble\">True</property><property name=\"can_focus\">False</property><prop" + "erty name=\"orientation\">vertical</property><child><object class=\"Gtk" + "ScrolledWindow\" id=\"saved-sessions\"><property name=\"visible\">True<" + "/property><property name=\"can_focus\">True</property><property name=\"" + "shadow_type\">in</property><child><object class=\"GtkTreeView\" id=\"sa" + "ved-sessions-list\"><property name=\"visible\">True</property><property" + " name=\"can_focus\">True</property><child internal-child=\"selection\">" + "<object class=\"GtkTreeSelection\"/></child></object></child></object><" + "packing><property name=\"expand\">True</property><property name=\"fill\"" + ">True</property><property name=\"position\">0</property></packing></chi" + "ld><child><object class=\"GtkBox\"><property name=\"visible\">True</pro" + "perty><property name=\"can_focus\">False</property><child><object class" + "=\"GtkBox\"><property name=\"visible\">True</property><property name=\"" + "can_focus\">False</property><property name=\"orientation\">vertical</pr" + "operty><child><object class=\"GtkButton\" id=\"btn_delete_session\"><pr" + "operty name=\"label\" translatable=\"yes\">_Remove</property><property " + "name=\"visible\">True</property><property name=\"can_focus\">True</prop" + "erty><property name=\"receives_default\">True</property><property name=" + "\"tooltip_text\" translatable=\"yes\">Delete the selected session</prop" + "erty><property name=\"image\">image4</property><property name=\"use_und" + "erline\">True</property></object><packing><property name=\"expand\">Fal" + "se</property><property name=\"fill\">True</property><property name=\"po" + "sition\">0</property></packing></child></object><packing><property name" + "=\"expand\">False</property><property name=\"fill\">True</property><pro" + "perty name=\"position\">0</property></packing></child><child><object cl" + "ass=\"GtkBox\"><property name=\"visible\">True</property><property name" + "=\"can_focus\">False</property><property name=\"orientation\">vertical<" + "/property><child><object class=\"GtkButton\" id=\"btn_clear_sessions\">" + "<property name=\"label\" translatable=\"yes\">Clear Save_d Sessions</pr" + "operty><property name=\"visible\">True</property><property name=\"can_f" + "ocus\">True</property><property name=\"receives_default\">True</propert" + "y><property name=\"halign\">end</property><property name=\"valign\">cen" + "ter</property><property name=\"image\">image1</property><property name=" + "\"use_underline\">True</property><property name=\"always_show_image\">T" + "rue</property></object><packing><property name=\"expand\">False</proper" + "ty><property name=\"fill\">True</property><property name=\"position\">0" + "</property></packing></child></object><packing><property name=\"expand\"" + ">False</property><property name=\"fill\">False</property><property name" + "=\"pack_type\">end</property><property name=\"position\">1</property></" + "packing></child><style><class name=\"inline-toolbar\"/></style></object" + "><packing><property name=\"expand\">False</property><property name=\"fi" + "ll\">True</property><property name=\"position\">1</property></packing><" + "/child></object><packing><property name=\"expand\">True</property><prop" + "erty name=\"fill\">True</property><property name=\"position\">0</proper" + "ty></packing></child></object><packing><property name=\"position\">3</p" + "roperty></packing></child><child type=\"tab\"><object class=\"GtkLabel\"" + "><property name=\"visible\">True</property><property name=\"can_focus\"" + ">False</property><property name=\"label\" translatable=\"yes\">Saved _S" + "essions</property><property name=\"use_underline\">True</property></obj" + "ect><packing><property name=\"position\">1</property><property name=\"t" + "ab_fill\">False</property></packing></child><child><object class=\"GtkB" + "ox\" id=\"vbox3\"><property name=\"visible\">True</property><property n" + "ame=\"can_focus\">False</property><property name=\"border_width\">12</p" + "roperty><property name=\"orientation\">vertical</property><property nam" + "e=\"spacing\">18</property><child><object class=\"GtkFrame\" id=\"frame" + "3\"><property name=\"visible\">True</property><property name=\"can_focu" + "s\">False</property><property name=\"label_xalign\">0</property><proper" + "ty name=\"shadow_type\">none</property><child><object class=\"GtkAlignm" + "ent\" id=\"alignment4\"><property name=\"visible\">True</property><prop" + "erty name=\"can_focus\">False</property><property name=\"top_padding\">" + "6</property><property name=\"left_padding\">12</property><child><object" + " class=\"GtkBox\" id=\"vbox4\"><property name=\"visible\">True</propert" + "y><property name=\"can_focus\">False</property><property name=\"orienta" + "tion\">vertical</property><property name=\"spacing\">6</property><child" + "><object class=\"GtkCheckButton\" id=\"chk_compat_gnome\"><property nam" + "e=\"label\" translatable=\"yes\">Launch GN_OME services on startup</pro" + "perty><property name=\"use_action_appearance\">False</property><propert" + "y name=\"visible\">True</property><property name=\"can_focus\">True</pr" + "operty><property name=\"receives_default\">False</property><property na" + "me=\"tooltip_text\" translatable=\"yes\">Start GNOME services, such as " + "gnome-keyring</property><property name=\"use_underline\">True</property" + "><property name=\"xalign\">0.5</property><property name=\"draw_indicato" + "r\">True</property></object><packing><property name=\"expand\">False</p" + "roperty><property name=\"fill\">True</property><property name=\"positio" + "n\">0</property></packing></child><child><object class=\"GtkCheckButton" + "\" id=\"chk_compat_kde\"><property name=\"label\" translatable=\"yes\">" + "Launch _KDE services on startup</property><property name=\"use_action_a" + "ppearance\">False</property><property name=\"visible\">True</property><" + "property name=\"can_focus\">True</property><property name=\"receives_de" + "fault\">False</property><property name=\"tooltip_text\" translatable=\"" + "yes\">Start KDE services, such as kdeinit</property><property name=\"us" + "e_underline\">True</property><property name=\"xalign\">0.5</property><p" + "roperty name=\"draw_indicator\">True</property></object><packing><prope" + "rty name=\"expand\">False</property><property name=\"fill\">True</prope" + "rty><property name=\"position\">1</property></packing></child></object>" + "</child></object></child><child type=\"label\"><object class=\"GtkLabel" + "\" id=\"label8\"><property name=\"visible\">True</property><property na" + "me=\"can_focus\">False</property><property name=\"label\" translatable=" + "\"yes\"><b>Compatibility</b></property><property name=\"use" + "_markup\">True</property></object></child></object><packing><property n" + "ame=\"expand\">False</property><property name=\"fill\">True</property><" + "property name=\"position\">0</property></packing></child><child><object" + " class=\"GtkFrame\" id=\"frame4\"><property name=\"visible\">True</prop" + "erty><property name=\"can_focus\">False</property><property name=\"labe" + "l_xalign\">0</property><property name=\"shadow_type\">none</property><c" + "hild><object class=\"GtkAlignment\" id=\"alignment5\"><property name=\"" + "visible\">True</property><property name=\"can_focus\">False</property><" + "property name=\"top_padding\">6</property><property name=\"left_padding" + "\">12</property><child><object class=\"GtkCheckButton\" id=\"chk_enable" + "_tcp\"><property name=\"label\" translatable=\"yes\">Manage _remote app" + "lications</property><property name=\"use_action_appearance\">False</pro" + "perty><property name=\"visible\">True</property><property name=\"can_fo" + "cus\">True</property><property name=\"receives_default\">False</propert" + "y><property name=\"tooltip_text\" translatable=\"yes\">Manage remote ap" + "plications over the network (this may be a security risk)</property><pr" + "operty name=\"use_underline\">True</property><property name=\"xalign\">" + "0.5</property><property name=\"draw_indicator\">True</property></object" + "></child></object></child><child type=\"label\"><object class=\"GtkLabe" + "l\" id=\"label9\"><property name=\"visible\">True</property><property n" + "ame=\"can_focus\">False</property><property name=\"label\" translatable" + "=\"yes\"><b>Security</b></property><property name=\"use_mar" + "kup\">True</property></object></child></object><packing><property name=" + "\"expand\">False</property><property name=\"fill\">True</property><prop" + "erty name=\"position\">1</property></packing></child></object><packing>" + "<property name=\"position\">3</property></packing></child><child type=\"" + "tab\"><object class=\"GtkLabel\" id=\"label4\"><property name=\"visible" + "\">True</property><property name=\"can_focus\">False</property><propert" + "y name=\"label\" translatable=\"yes\">Ad_vanced</property><property nam" + "e=\"use_underline\">True</property></object><packing><property name=\"p" + "osition\">3</property><property name=\"tab_fill\">False</property></pac" + "king></child><child><placeholder/></child><child type=\"tab\"><placehol" + "der/></child></object><packing><property name=\"expand\">True</property" + "><property name=\"fill\">True</property><property name=\"position\">0</" + "property></packing></child></object></child><action-widgets><action-wid" + "get response=\"-11\">button1</action-widget><action-widget response=\"-" + "7\">button2</action-widget></action-widgets></object><object class=\"Gt" + "kDialog\" id=\"dialog_saving\"><property name=\"can_focus\">False</prop" + "erty><property name=\"border_width\">5</property><property name=\"title" + "\" translatable=\"yes\">Saving Session</property><property name=\"resiz" + "able\">False</property><property name=\"window_position\">center-on-par" + "ent</property><property name=\"destroy_with_parent\">True</property><pr" + "operty name=\"icon_name\">xfce4-session</property><property name=\"type" + "_hint\">dialog</property><property name=\"skip_taskbar_hint\">True</pro" + "perty><property name=\"skip_pager_hint\">True</property><property name=" + "\"transient_for\">xfce4_session_settings_dialog</property><child><place" + "holder/></child><child internal-child=\"vbox\"><object class=\"GtkBox\"" + " id=\"dialog-vbox2\"><property name=\"visible\">True</property><propert" + "y name=\"can_focus\">False</property><property name=\"orientation\">ver" + "tical</property><property name=\"spacing\">2</property><child internal-" + "child=\"action_area\"><object class=\"GtkButtonBox\" id=\"dialog-action" + "_area2\"><property name=\"visible\">True</property><property name=\"can" + "_focus\">False</property><property name=\"layout_style\">end</property>" + "<child><object class=\"GtkButton\" id=\"button3\"><property name=\"labe" + "l\">_Close</property><property name=\"use_action_appearance\">False</pr" + "operty><property name=\"visible\">True</property><property name=\"can_f" + "ocus\">True</property><property name=\"receives_default\">True</propert" + "y><property name=\"image\">image8</property><property name=\"use_underl" + "ine\">True</property></object><packing><property name=\"expand\">False<" + "/property><property name=\"fill\">False</property><property name=\"posi" + "tion\">0</property></packing></child></object><packing><property name=\"" + "expand\">False</property><property name=\"fill\">True</property><proper" + "ty name=\"pack_type\">end</property><property name=\"position\">0</prop" + "erty></packing></child><child><object class=\"GtkBox\" id=\"vbox5\"><pr" + "operty name=\"visible\">True</property><property name=\"can_focus\">Fal" + "se</property><property name=\"border_width\">6</property><property name" + "=\"orientation\">vertical</property><property name=\"spacing\">6</prope" + "rty><child><object class=\"GtkBox\" id=\"hbox8\"><property name=\"visib" + "le\">True</property><property name=\"can_focus\">False</property><prope" + "rty name=\"spacing\">12</property><child><object class=\"GtkImage\" id=" + "\"image6\"><property name=\"visible\">True</property><property name=\"c" + "an_focus\">False</property><property name=\"icon_name\">dialog-informat" + "ion</property><property name=\"icon_size\">6</property></object><packin" + "g><property name=\"expand\">False</property><property name=\"fill\">Tru" + "e</property><property name=\"position\">0</property></packing></child><" + "child><object class=\"GtkLabel\" id=\"label10\"><property name=\"visibl" + "e\">True</property><property name=\"can_focus\">False</property><proper" + "ty name=\"label\" translatable=\"yes\">Your session is being saved. If" + " you do not wish to wait, you may close this window.</property><propert" + "y name=\"wrap\">True</property><property name=\"xalign\">0</property></" + "object><packing><property name=\"expand\">True</property><property name" + "=\"fill\">True</property><property name=\"position\">1</property></pack" + "ing></child></object><packing><property name=\"expand\">False</property" + "><property name=\"fill\">True</property><property name=\"position\">0</" + "property></packing></child><child><object class=\"GtkProgressBar\" id=\"" + "progress_save_session\"><property name=\"visible\">True</property><prop" + "erty name=\"can_focus\">False</property></object><packing><property nam" + "e=\"expand\">False</property><property name=\"fill\">True</property><pr" + "operty name=\"position\">1</property></packing></child></object><packin" + "g><property name=\"expand\">False</property><property name=\"fill\">Tru" + "e</property><property name=\"position\">1</property></packing></child><" + "/object></child><action-widgets><action-widget response=\"0\">button3</" + "action-widget></action-widgets></object></interface>" +}; + +static const unsigned xfce4_session_settings_ui_length = 28511u; + diff --git a/settings/xfce4-session.xml b/settings/xfce4-session.xml new file mode 100644 index 0000000..66d28df --- /dev/null +++ b/settings/xfce4-session.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-session" version="1.0"> + <property name="general" type="empty"> + <property name="FailsafeSessionName" type="string" value="Failsafe"/> + <property name="LockCommand" type="string" value=""/> + </property> + <property name="sessions" type="empty"> + <property name="Failsafe" type="empty"> + <property name="IsFailsafe" type="bool" value="true"/> + <property name="Count" type="int" value="5"/> + <property name="Client0_Command" type="array"> + <value type="string" value="xfwm4"/> + </property> + <property name="Client0_Priority" type="int" value="15"/> + <property name="Client0_PerScreen" type="bool" value="false"/> + <property name="Client1_Command" type="array"> + <value type="string" value="xfsettingsd"/> + </property> + <property name="Client1_Priority" type="int" value="20"/> + <property name="Client1_PerScreen" type="bool" value="false"/> + <property name="Client2_Command" type="array"> + <value type="string" value="xfce4-panel"/> + </property> + <property name="Client2_Priority" type="int" value="25"/> + <property name="Client2_PerScreen" type="bool" value="false"/> + <property name="Client3_Command" type="array"> + <value type="string" value="Thunar"/> + <value type="string" value="--daemon"/> + </property> + <property name="Client3_Priority" type="int" value="30"/> + <property name="Client3_PerScreen" type="bool" value="false"/> + <property name="Client4_Command" type="array"> + <value type="string" value="xfdesktop"/> + </property> + <property name="Client4_Priority" type="int" value="35"/> + <property name="Client4_PerScreen" type="bool" value="false"/> + </property> + </property> +</channel> diff --git a/settings/xfsm-client-dbus-client.c b/settings/xfsm-client-dbus-client.c new file mode 100644 index 0000000..f9405c1 --- /dev/null +++ b/settings/xfsm-client-dbus-client.c @@ -0,0 +1,2905 @@ +/* + * Generated by gdbus-codegen 2.62.4 from xfsm-client-dbus.xml. DO NOT EDIT. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "xfsm-client-dbus-client.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + guint use_gvariant : 1; + guint emits_changed_signal : 1; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.xfce.Session.Client + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:XfsmClient + * @title: XfsmClient + * @short_description: Generated C code for the org.xfce.Session.Client D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.xfce.Session.Client ---- */ + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_get_id_OUT_ARG_id = +{ + { + -1, + (gchar *) "id", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_get_id_OUT_ARG_pointers[] = +{ + &_xfsm_client_method_info_get_id_OUT_ARG_id.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_get_id = +{ + { + -1, + (gchar *) "GetID", + NULL, + (GDBusArgInfo **) &_xfsm_client_method_info_get_id_OUT_ARG_pointers, + NULL + }, + "handle-get-id", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_get_state_OUT_ARG_state = +{ + { + -1, + (gchar *) "state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_get_state_OUT_ARG_pointers[] = +{ + &_xfsm_client_method_info_get_state_OUT_ARG_state.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_get_state = +{ + { + -1, + (gchar *) "GetState", + NULL, + (GDBusArgInfo **) &_xfsm_client_method_info_get_state_OUT_ARG_pointers, + NULL + }, + "handle-get-state", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_get_all_sm_properties_OUT_ARG_properties = +{ + { + -1, + (gchar *) "properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_get_all_sm_properties_OUT_ARG_pointers[] = +{ + &_xfsm_client_method_info_get_all_sm_properties_OUT_ARG_properties.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_get_all_sm_properties = +{ + { + -1, + (gchar *) "GetAllSmProperties", + NULL, + (GDBusArgInfo **) &_xfsm_client_method_info_get_all_sm_properties_OUT_ARG_pointers, + NULL + }, + "handle-get-all-sm-properties", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_get_sm_properties_IN_ARG_names = +{ + { + -1, + (gchar *) "names", + (gchar *) "as", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_get_sm_properties_IN_ARG_pointers[] = +{ + &_xfsm_client_method_info_get_sm_properties_IN_ARG_names.parent_struct, + NULL +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_get_sm_properties_OUT_ARG_values = +{ + { + -1, + (gchar *) "values", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_get_sm_properties_OUT_ARG_pointers[] = +{ + &_xfsm_client_method_info_get_sm_properties_OUT_ARG_values.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_get_sm_properties = +{ + { + -1, + (gchar *) "GetSmProperties", + (GDBusArgInfo **) &_xfsm_client_method_info_get_sm_properties_IN_ARG_pointers, + (GDBusArgInfo **) &_xfsm_client_method_info_get_sm_properties_OUT_ARG_pointers, + NULL + }, + "handle-get-sm-properties", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_set_sm_properties_IN_ARG_properties = +{ + { + -1, + (gchar *) "properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_set_sm_properties_IN_ARG_pointers[] = +{ + &_xfsm_client_method_info_set_sm_properties_IN_ARG_properties.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_set_sm_properties = +{ + { + -1, + (gchar *) "SetSmProperties", + (GDBusArgInfo **) &_xfsm_client_method_info_set_sm_properties_IN_ARG_pointers, + NULL, + NULL + }, + "handle-set-sm-properties", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_delete_sm_properties_IN_ARG_names = +{ + { + -1, + (gchar *) "names", + (gchar *) "as", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_delete_sm_properties_IN_ARG_pointers[] = +{ + &_xfsm_client_method_info_delete_sm_properties_IN_ARG_names.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_delete_sm_properties = +{ + { + -1, + (gchar *) "DeleteSmProperties", + (GDBusArgInfo **) &_xfsm_client_method_info_delete_sm_properties_IN_ARG_pointers, + NULL, + NULL + }, + "handle-delete-sm-properties", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_terminate = +{ + { + -1, + (gchar *) "Terminate", + NULL, + NULL, + NULL + }, + "handle-terminate", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_end_session_response_IN_ARG_is_ok = +{ + { + -1, + (gchar *) "is_ok", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_method_info_end_session_response_IN_ARG_reason = +{ + { + -1, + (gchar *) "reason", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_method_info_end_session_response_IN_ARG_pointers[] = +{ + &_xfsm_client_method_info_end_session_response_IN_ARG_is_ok.parent_struct, + &_xfsm_client_method_info_end_session_response_IN_ARG_reason.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_client_method_info_end_session_response = +{ + { + -1, + (gchar *) "EndSessionResponse", + (GDBusArgInfo **) &_xfsm_client_method_info_end_session_response_IN_ARG_pointers, + NULL, + NULL + }, + "handle-end-session-response", + FALSE +}; + +static const GDBusMethodInfo * const _xfsm_client_method_info_pointers[] = +{ + &_xfsm_client_method_info_get_id.parent_struct, + &_xfsm_client_method_info_get_state.parent_struct, + &_xfsm_client_method_info_get_all_sm_properties.parent_struct, + &_xfsm_client_method_info_get_sm_properties.parent_struct, + &_xfsm_client_method_info_set_sm_properties.parent_struct, + &_xfsm_client_method_info_delete_sm_properties.parent_struct, + &_xfsm_client_method_info_terminate.parent_struct, + &_xfsm_client_method_info_end_session_response.parent_struct, + NULL +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_state_changed_ARG_old_state = +{ + { + -1, + (gchar *) "old_state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_state_changed_ARG_new_state = +{ + { + -1, + (gchar *) "new_state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_signal_info_state_changed_ARG_pointers[] = +{ + &_xfsm_client_signal_info_state_changed_ARG_old_state.parent_struct, + &_xfsm_client_signal_info_state_changed_ARG_new_state.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_state_changed = +{ + { + -1, + (gchar *) "StateChanged", + (GDBusArgInfo **) &_xfsm_client_signal_info_state_changed_ARG_pointers, + NULL + }, + "state-changed" +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_sm_property_changed_ARG_name = +{ + { + -1, + (gchar *) "name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_sm_property_changed_ARG_value = +{ + { + -1, + (gchar *) "value", + (gchar *) "v", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_signal_info_sm_property_changed_ARG_pointers[] = +{ + &_xfsm_client_signal_info_sm_property_changed_ARG_name.parent_struct, + &_xfsm_client_signal_info_sm_property_changed_ARG_value.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_sm_property_changed = +{ + { + -1, + (gchar *) "SmPropertyChanged", + (GDBusArgInfo **) &_xfsm_client_signal_info_sm_property_changed_ARG_pointers, + NULL + }, + "sm-property-changed" +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_sm_property_deleted_ARG_name = +{ + { + -1, + (gchar *) "name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_signal_info_sm_property_deleted_ARG_pointers[] = +{ + &_xfsm_client_signal_info_sm_property_deleted_ARG_name.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_sm_property_deleted = +{ + { + -1, + (gchar *) "SmPropertyDeleted", + (GDBusArgInfo **) &_xfsm_client_signal_info_sm_property_deleted_ARG_pointers, + NULL + }, + "sm-property-deleted" +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_query_end_session_ARG_flags = +{ + { + -1, + (gchar *) "flags", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_signal_info_query_end_session_ARG_pointers[] = +{ + &_xfsm_client_signal_info_query_end_session_ARG_flags.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_query_end_session = +{ + { + -1, + (gchar *) "QueryEndSession", + (GDBusArgInfo **) &_xfsm_client_signal_info_query_end_session_ARG_pointers, + NULL + }, + "query-end-session" +}; + +static const _ExtendedGDBusArgInfo _xfsm_client_signal_info_end_session_ARG_flags = +{ + { + -1, + (gchar *) "flags", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_client_signal_info_end_session_ARG_pointers[] = +{ + &_xfsm_client_signal_info_end_session_ARG_flags.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_end_session = +{ + { + -1, + (gchar *) "EndSession", + (GDBusArgInfo **) &_xfsm_client_signal_info_end_session_ARG_pointers, + NULL + }, + "end-session" +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_cancel_end_session = +{ + { + -1, + (gchar *) "CancelEndSession", + NULL, + NULL + }, + "cancel-end-session" +}; + +static const _ExtendedGDBusSignalInfo _xfsm_client_signal_info_stop = +{ + { + -1, + (gchar *) "Stop", + NULL, + NULL + }, + "stop" +}; + +static const GDBusSignalInfo * const _xfsm_client_signal_info_pointers[] = +{ + &_xfsm_client_signal_info_state_changed.parent_struct, + &_xfsm_client_signal_info_sm_property_changed.parent_struct, + &_xfsm_client_signal_info_sm_property_deleted.parent_struct, + &_xfsm_client_signal_info_query_end_session.parent_struct, + &_xfsm_client_signal_info_end_session.parent_struct, + &_xfsm_client_signal_info_cancel_end_session.parent_struct, + &_xfsm_client_signal_info_stop.parent_struct, + NULL +}; + +static const GDBusAnnotationInfo _xfsm_client_annotation_info_0 = +{ + -1, + (gchar *) "org.freedesktop.DBus.GLib.CSymbol", + (gchar *) "xfsm_client_dbus", + NULL +}; + +static const GDBusAnnotationInfo _xfsm_client_annotation_info_1 = +{ + -1, + (gchar *) "org.freedesktop.DBus.GLib.ClientCSymbol", + (gchar *) "xfsm_client_dbus_client", + NULL +}; + +static const GDBusAnnotationInfo * const _xfsm_client_annotation_info_pointers[] = +{ + &_xfsm_client_annotation_info_0, + &_xfsm_client_annotation_info_1, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _xfsm_client_interface_info = +{ + { + -1, + (gchar *) "org.xfce.Session.Client", + (GDBusMethodInfo **) &_xfsm_client_method_info_pointers, + (GDBusSignalInfo **) &_xfsm_client_signal_info_pointers, + NULL, + (GDBusAnnotationInfo **) &_xfsm_client_annotation_info_pointers + }, + "client", +}; + + +/** + * xfsm_client_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +xfsm_client_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct; +} + +/** + * xfsm_client_override_properties: + * @klass: The class structure for a #GObject derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #XfsmClient interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +xfsm_client_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * XfsmClient: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link>. + */ + +/** + * XfsmClientIface: + * @parent_iface: The parent interface. + * @handle_delete_sm_properties: Handler for the #XfsmClient::handle-delete-sm-properties signal. + * @handle_end_session_response: Handler for the #XfsmClient::handle-end-session-response signal. + * @handle_get_all_sm_properties: Handler for the #XfsmClient::handle-get-all-sm-properties signal. + * @handle_get_id: Handler for the #XfsmClient::handle-get-id signal. + * @handle_get_sm_properties: Handler for the #XfsmClient::handle-get-sm-properties signal. + * @handle_get_state: Handler for the #XfsmClient::handle-get-state signal. + * @handle_set_sm_properties: Handler for the #XfsmClient::handle-set-sm-properties signal. + * @handle_terminate: Handler for the #XfsmClient::handle-terminate signal. + * @cancel_end_session: Handler for the #XfsmClient::cancel-end-session signal. + * @end_session: Handler for the #XfsmClient::end-session signal. + * @query_end_session: Handler for the #XfsmClient::query-end-session signal. + * @sm_property_changed: Handler for the #XfsmClient::sm-property-changed signal. + * @sm_property_deleted: Handler for the #XfsmClient::sm-property-deleted signal. + * @state_changed: Handler for the #XfsmClient::state-changed signal. + * @stop: Handler for the #XfsmClient::stop signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link>. + */ + +typedef XfsmClientIface XfsmClientInterface; +G_DEFINE_INTERFACE (XfsmClient, xfsm_client, G_TYPE_OBJECT) + +static void +xfsm_client_default_init (XfsmClientIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * XfsmClient::handle-get-id: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.GetID">GetID()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-id", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_get_id), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmClient::handle-get-state: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.GetState">GetState()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_get_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-state", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_get_state), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmClient::handle-get-all-sm-properties: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.GetAllSmProperties">GetAllSmProperties()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_get_all_sm_properties() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-all-sm-properties", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_get_all_sm_properties), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmClient::handle-get-sm-properties: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * @arg_names: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.GetSmProperties">GetSmProperties()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_get_sm_properties() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-sm-properties", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_get_sm_properties), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV); + + /** + * XfsmClient::handle-set-sm-properties: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * @arg_properties: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.SetSmProperties">SetSmProperties()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_set_sm_properties() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-set-sm-properties", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_set_sm_properties), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * XfsmClient::handle-delete-sm-properties: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * @arg_names: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.DeleteSmProperties">DeleteSmProperties()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_delete_sm_properties() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-delete-sm-properties", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_delete_sm_properties), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV); + + /** + * XfsmClient::handle-terminate: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.Terminate">Terminate()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_terminate() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-terminate", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_terminate), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmClient::handle-end-session-response: + * @object: A #XfsmClient. + * @invocation: A #GDBusMethodInvocation. + * @arg_is_ok: Argument passed by remote caller. + * @arg_reason: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Client.EndSessionResponse">EndSessionResponse()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_client_complete_end_session_response() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-end-session-response", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, handle_end_session_response), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * XfsmClient::state-changed: + * @object: A #XfsmClient. + * @arg_old_state: Argument. + * @arg_new_state: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.StateChanged">"StateChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_UINT, G_TYPE_UINT); + + /** + * XfsmClient::sm-property-changed: + * @object: A #XfsmClient. + * @arg_name: Argument. + * @arg_value: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.SmPropertyChanged">"SmPropertyChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("sm-property-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, sm_property_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_STRING, G_TYPE_VARIANT); + + /** + * XfsmClient::sm-property-deleted: + * @object: A #XfsmClient. + * @arg_name: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.SmPropertyDeleted">"SmPropertyDeleted"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("sm-property-deleted", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, sm_property_deleted), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_STRING); + + /** + * XfsmClient::query-end-session: + * @object: A #XfsmClient. + * @arg_flags: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.QueryEndSession">"QueryEndSession"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("query-end-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, query_end_session), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_UINT); + + /** + * XfsmClient::end-session: + * @object: A #XfsmClient. + * @arg_flags: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.EndSession">"EndSession"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("end-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, end_session), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_UINT); + + /** + * XfsmClient::cancel-end-session: + * @object: A #XfsmClient. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.CancelEndSession">"CancelEndSession"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("cancel-end-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, cancel_end_session), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + + /** + * XfsmClient::stop: + * @object: A #XfsmClient. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Client.Stop">"Stop"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("stop", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmClientIface, stop), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + +} + +/** + * xfsm_client_emit_state_changed: + * @object: A #XfsmClient. + * @arg_old_state: Argument to pass with the signal. + * @arg_new_state: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.StateChanged">"StateChanged"</link> D-Bus signal. + */ +void +xfsm_client_emit_state_changed ( + XfsmClient *object, + guint arg_old_state, + guint arg_new_state) +{ + g_signal_emit_by_name (object, "state-changed", arg_old_state, arg_new_state); +} + +/** + * xfsm_client_emit_sm_property_changed: + * @object: A #XfsmClient. + * @arg_name: Argument to pass with the signal. + * @arg_value: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.SmPropertyChanged">"SmPropertyChanged"</link> D-Bus signal. + */ +void +xfsm_client_emit_sm_property_changed ( + XfsmClient *object, + const gchar *arg_name, + GVariant *arg_value) +{ + g_signal_emit_by_name (object, "sm-property-changed", arg_name, arg_value); +} + +/** + * xfsm_client_emit_sm_property_deleted: + * @object: A #XfsmClient. + * @arg_name: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.SmPropertyDeleted">"SmPropertyDeleted"</link> D-Bus signal. + */ +void +xfsm_client_emit_sm_property_deleted ( + XfsmClient *object, + const gchar *arg_name) +{ + g_signal_emit_by_name (object, "sm-property-deleted", arg_name); +} + +/** + * xfsm_client_emit_query_end_session: + * @object: A #XfsmClient. + * @arg_flags: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.QueryEndSession">"QueryEndSession"</link> D-Bus signal. + */ +void +xfsm_client_emit_query_end_session ( + XfsmClient *object, + guint arg_flags) +{ + g_signal_emit_by_name (object, "query-end-session", arg_flags); +} + +/** + * xfsm_client_emit_end_session: + * @object: A #XfsmClient. + * @arg_flags: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.EndSession">"EndSession"</link> D-Bus signal. + */ +void +xfsm_client_emit_end_session ( + XfsmClient *object, + guint arg_flags) +{ + g_signal_emit_by_name (object, "end-session", arg_flags); +} + +/** + * xfsm_client_emit_cancel_end_session: + * @object: A #XfsmClient. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.CancelEndSession">"CancelEndSession"</link> D-Bus signal. + */ +void +xfsm_client_emit_cancel_end_session ( + XfsmClient *object) +{ + g_signal_emit_by_name (object, "cancel-end-session"); +} + +/** + * xfsm_client_emit_stop: + * @object: A #XfsmClient. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Client.Stop">"Stop"</link> D-Bus signal. + */ +void +xfsm_client_emit_stop ( + XfsmClient *object) +{ + g_signal_emit_by_name (object, "stop"); +} + +/** + * xfsm_client_call_get_id: + * @proxy: A #XfsmClientProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetID">GetID()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_get_id_finish() to get the result of the operation. + * + * See xfsm_client_call_get_id_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_get_id ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetID", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_get_id_finish: + * @proxy: A #XfsmClientProxy. + * @out_id: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_get_id(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_get_id(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_id_finish ( + XfsmClient *proxy, + gchar **out_id, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s)", + out_id); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_id_sync: + * @proxy: A #XfsmClientProxy. + * @out_id: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetID">GetID()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_get_id() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_id_sync ( + XfsmClient *proxy, + gchar **out_id, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetID", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s)", + out_id); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_state: + * @proxy: A #XfsmClientProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetState">GetState()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_get_state_finish() to get the result of the operation. + * + * See xfsm_client_call_get_state_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_get_state ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetState", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_get_state_finish: + * @proxy: A #XfsmClientProxy. + * @out_state: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_get_state(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_get_state(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_state_finish ( + XfsmClient *proxy, + guint *out_state, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_state); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_state_sync: + * @proxy: A #XfsmClientProxy. + * @out_state: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetState">GetState()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_get_state() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_state_sync ( + XfsmClient *proxy, + guint *out_state, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetState", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_state); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_all_sm_properties: + * @proxy: A #XfsmClientProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetAllSmProperties">GetAllSmProperties()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_get_all_sm_properties_finish() to get the result of the operation. + * + * See xfsm_client_call_get_all_sm_properties_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_get_all_sm_properties ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetAllSmProperties", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_get_all_sm_properties_finish: + * @proxy: A #XfsmClientProxy. + * @out_properties: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_get_all_sm_properties(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_get_all_sm_properties(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_all_sm_properties_finish ( + XfsmClient *proxy, + GVariant **out_properties, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_all_sm_properties_sync: + * @proxy: A #XfsmClientProxy. + * @out_properties: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetAllSmProperties">GetAllSmProperties()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_get_all_sm_properties() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_all_sm_properties_sync ( + XfsmClient *proxy, + GVariant **out_properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetAllSmProperties", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_sm_properties: + * @proxy: A #XfsmClientProxy. + * @arg_names: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetSmProperties">GetSmProperties()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_get_sm_properties_finish() to get the result of the operation. + * + * See xfsm_client_call_get_sm_properties_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_get_sm_properties ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetSmProperties", + g_variant_new ("(^as)", + arg_names), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_get_sm_properties_finish: + * @proxy: A #XfsmClientProxy. + * @out_values: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_get_sm_properties(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_get_sm_properties(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_sm_properties_finish ( + XfsmClient *proxy, + GVariant **out_values, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_values); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_get_sm_properties_sync: + * @proxy: A #XfsmClientProxy. + * @arg_names: Argument to pass with the method invocation. + * @out_values: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.GetSmProperties">GetSmProperties()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_get_sm_properties() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_get_sm_properties_sync ( + XfsmClient *proxy, + const gchar *const *arg_names, + GVariant **out_values, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetSmProperties", + g_variant_new ("(^as)", + arg_names), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_values); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_set_sm_properties: + * @proxy: A #XfsmClientProxy. + * @arg_properties: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.SetSmProperties">SetSmProperties()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_set_sm_properties_finish() to get the result of the operation. + * + * See xfsm_client_call_set_sm_properties_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_set_sm_properties ( + XfsmClient *proxy, + GVariant *arg_properties, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "SetSmProperties", + g_variant_new ("(@a{sv})", + arg_properties), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_set_sm_properties_finish: + * @proxy: A #XfsmClientProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_set_sm_properties(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_set_sm_properties(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_set_sm_properties_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_set_sm_properties_sync: + * @proxy: A #XfsmClientProxy. + * @arg_properties: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.SetSmProperties">SetSmProperties()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_set_sm_properties() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_set_sm_properties_sync ( + XfsmClient *proxy, + GVariant *arg_properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "SetSmProperties", + g_variant_new ("(@a{sv})", + arg_properties), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_delete_sm_properties: + * @proxy: A #XfsmClientProxy. + * @arg_names: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.DeleteSmProperties">DeleteSmProperties()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_delete_sm_properties_finish() to get the result of the operation. + * + * See xfsm_client_call_delete_sm_properties_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_delete_sm_properties ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "DeleteSmProperties", + g_variant_new ("(^as)", + arg_names), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_delete_sm_properties_finish: + * @proxy: A #XfsmClientProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_delete_sm_properties(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_delete_sm_properties(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_delete_sm_properties_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_delete_sm_properties_sync: + * @proxy: A #XfsmClientProxy. + * @arg_names: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.DeleteSmProperties">DeleteSmProperties()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_delete_sm_properties() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_delete_sm_properties_sync ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "DeleteSmProperties", + g_variant_new ("(^as)", + arg_names), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_terminate: + * @proxy: A #XfsmClientProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.Terminate">Terminate()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_terminate_finish() to get the result of the operation. + * + * See xfsm_client_call_terminate_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_terminate ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Terminate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_terminate_finish: + * @proxy: A #XfsmClientProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_terminate(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_terminate(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_terminate_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_terminate_sync: + * @proxy: A #XfsmClientProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.Terminate">Terminate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_terminate() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_terminate_sync ( + XfsmClient *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Terminate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_end_session_response: + * @proxy: A #XfsmClientProxy. + * @arg_is_ok: Argument to pass with the method invocation. + * @arg_reason: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.EndSessionResponse">EndSessionResponse()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_call_end_session_response_finish() to get the result of the operation. + * + * See xfsm_client_call_end_session_response_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_client_call_end_session_response ( + XfsmClient *proxy, + gboolean arg_is_ok, + const gchar *arg_reason, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "EndSessionResponse", + g_variant_new ("(bs)", + arg_is_ok, + arg_reason), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_client_call_end_session_response_finish: + * @proxy: A #XfsmClientProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_call_end_session_response(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_client_call_end_session_response(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_end_session_response_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_call_end_session_response_sync: + * @proxy: A #XfsmClientProxy. + * @arg_is_ok: Argument to pass with the method invocation. + * @arg_reason: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Client.EndSessionResponse">EndSessionResponse()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_client_call_end_session_response() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_client_call_end_session_response_sync ( + XfsmClient *proxy, + gboolean arg_is_ok, + const gchar *arg_reason, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "EndSessionResponse", + g_variant_new ("(bs)", + arg_is_ok, + arg_reason), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_client_complete_get_id: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @id: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.GetID">GetID()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_get_id ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + const gchar *id) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", + id)); +} + +/** + * xfsm_client_complete_get_state: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @state: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.GetState">GetState()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_get_state ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + guint state) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + state)); +} + +/** + * xfsm_client_complete_get_all_sm_properties: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @properties: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.GetAllSmProperties">GetAllSmProperties()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_get_all_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + GVariant *properties) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + properties)); +} + +/** + * xfsm_client_complete_get_sm_properties: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @values: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.GetSmProperties">GetSmProperties()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_get_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + GVariant *values) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + values)); +} + +/** + * xfsm_client_complete_set_sm_properties: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.SetSmProperties">SetSmProperties()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_set_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_client_complete_delete_sm_properties: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.DeleteSmProperties">DeleteSmProperties()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_delete_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_client_complete_terminate: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.Terminate">Terminate()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_terminate ( + XfsmClient *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_client_complete_end_session_response: + * @object: A #XfsmClient. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Client.EndSessionResponse">EndSessionResponse()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_client_complete_end_session_response ( + XfsmClient *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * XfsmClientProxy: + * + * The #XfsmClientProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * XfsmClientProxyClass: + * @parent_class: The parent class. + * + * Class structure for #XfsmClientProxy. + */ + +struct _XfsmClientProxyPrivate +{ + GData *qdata; +}; + +static void xfsm_client_proxy_iface_init (XfsmClientIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (XfsmClientProxy, xfsm_client_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (XfsmClientProxy) + G_IMPLEMENT_INTERFACE (XFSM_TYPE_CLIENT, xfsm_client_proxy_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (XfsmClientProxy, xfsm_client_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (XFSM_TYPE_CLIENT, xfsm_client_proxy_iface_init)) + +#endif +static void +xfsm_client_proxy_finalize (GObject *object) +{ + XfsmClientProxy *proxy = XFSM_CLIENT_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (xfsm_client_proxy_parent_class)->finalize (object); +} + +static void +xfsm_client_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +xfsm_client_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +xfsm_client_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + gsize num_params; + gsize n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], XFSM_TYPE_CLIENT); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, XFSM_TYPE_CLIENT); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +xfsm_client_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + XfsmClientProxy *proxy = XFSM_CLIENT_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +xfsm_client_proxy_init (XfsmClientProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = xfsm_client_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XFSM_TYPE_CLIENT_PROXY, XfsmClientProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xfsm_client_interface_info ()); +} + +static void +xfsm_client_proxy_class_init (XfsmClientProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = xfsm_client_proxy_finalize; + gobject_class->get_property = xfsm_client_proxy_get_property; + gobject_class->set_property = xfsm_client_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = xfsm_client_proxy_g_signal; + proxy_class->g_properties_changed = xfsm_client_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (XfsmClientProxyPrivate)); +#endif +} + +static void +xfsm_client_proxy_iface_init (XfsmClientIface *iface) +{ +} + +/** + * xfsm_client_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_proxy_new_finish() to get the result of the operation. + * + * See xfsm_client_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +xfsm_client_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (XFSM_TYPE_CLIENT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Client", NULL); +} + +/** + * xfsm_client_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with xfsm_client_proxy_new(). + * + * Returns: (transfer full) (type XfsmClientProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmClient * +xfsm_client_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return XFSM_CLIENT (ret); + else + return NULL; +} + +/** + * xfsm_client_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See xfsm_client_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type XfsmClientProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmClient * +xfsm_client_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (XFSM_TYPE_CLIENT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Client", NULL); + if (ret != NULL) + return XFSM_CLIENT (ret); + else + return NULL; +} + + +/** + * xfsm_client_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like xfsm_client_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_client_proxy_new_for_bus_finish() to get the result of the operation. + * + * See xfsm_client_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +xfsm_client_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (XFSM_TYPE_CLIENT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Client", NULL); +} + +/** + * xfsm_client_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_client_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with xfsm_client_proxy_new_for_bus(). + * + * Returns: (transfer full) (type XfsmClientProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmClient * +xfsm_client_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return XFSM_CLIENT (ret); + else + return NULL; +} + +/** + * xfsm_client_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like xfsm_client_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See xfsm_client_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type XfsmClientProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmClient * +xfsm_client_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (XFSM_TYPE_CLIENT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Client", NULL); + if (ret != NULL) + return XFSM_CLIENT (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * XfsmClientSkeleton: + * + * The #XfsmClientSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * XfsmClientSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #XfsmClientSkeleton. + */ + +struct _XfsmClientSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_xfsm_client_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + gsize num_params; + guint num_extra; + gsize n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], XFSM_TYPE_CLIENT); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, XFSM_TYPE_CLIENT); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_xfsm_client_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_xfsm_client_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_client_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _xfsm_client_skeleton_vtable = +{ + _xfsm_client_skeleton_handle_method_call, + _xfsm_client_skeleton_handle_get_property, + _xfsm_client_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +xfsm_client_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return xfsm_client_interface_info (); +} + +static GDBusInterfaceVTable * +xfsm_client_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_xfsm_client_skeleton_vtable; +} + +static GVariant * +xfsm_client_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_xfsm_client_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _xfsm_client_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _xfsm_client_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _xfsm_client_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +xfsm_client_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_xfsm_client_on_signal_state_changed ( + XfsmClient *object, + guint arg_old_state, + guint arg_new_state) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(uu)", + arg_old_state, + arg_new_state)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "StateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_sm_property_changed ( + XfsmClient *object, + const gchar *arg_name, + GVariant *arg_value) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(s@v)", + arg_name, + arg_value)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "SmPropertyChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_sm_property_deleted ( + XfsmClient *object, + const gchar *arg_name) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(s)", + arg_name)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "SmPropertyDeleted", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_query_end_session ( + XfsmClient *object, + guint arg_flags) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(u)", + arg_flags)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "QueryEndSession", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_end_session ( + XfsmClient *object, + guint arg_flags) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(u)", + arg_flags)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "EndSession", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_cancel_end_session ( + XfsmClient *object) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "CancelEndSession", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_client_on_signal_stop ( + XfsmClient *object) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Client", "Stop", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void xfsm_client_skeleton_iface_init (XfsmClientIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (XfsmClientSkeleton, xfsm_client_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (XfsmClientSkeleton) + G_IMPLEMENT_INTERFACE (XFSM_TYPE_CLIENT, xfsm_client_skeleton_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (XfsmClientSkeleton, xfsm_client_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (XFSM_TYPE_CLIENT, xfsm_client_skeleton_iface_init)) + +#endif +static void +xfsm_client_skeleton_finalize (GObject *object) +{ + XfsmClientSkeleton *skeleton = XFSM_CLIENT_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (xfsm_client_skeleton_parent_class)->finalize (object); +} + +static void +xfsm_client_skeleton_init (XfsmClientSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = xfsm_client_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XFSM_TYPE_CLIENT_SKELETON, XfsmClientSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +xfsm_client_skeleton_class_init (XfsmClientSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = xfsm_client_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = xfsm_client_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = xfsm_client_skeleton_dbus_interface_get_properties; + skeleton_class->flush = xfsm_client_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = xfsm_client_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (XfsmClientSkeletonPrivate)); +#endif +} + +static void +xfsm_client_skeleton_iface_init (XfsmClientIface *iface) +{ + iface->state_changed = _xfsm_client_on_signal_state_changed; + iface->sm_property_changed = _xfsm_client_on_signal_sm_property_changed; + iface->sm_property_deleted = _xfsm_client_on_signal_sm_property_deleted; + iface->query_end_session = _xfsm_client_on_signal_query_end_session; + iface->end_session = _xfsm_client_on_signal_end_session; + iface->cancel_end_session = _xfsm_client_on_signal_cancel_end_session; + iface->stop = _xfsm_client_on_signal_stop; +} + +/** + * xfsm_client_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Client.top_of_page">org.xfce.Session.Client</link>. + * + * Returns: (transfer full) (type XfsmClientSkeleton): The skeleton object. + */ +XfsmClient * +xfsm_client_skeleton_new (void) +{ + return XFSM_CLIENT (g_object_new (XFSM_TYPE_CLIENT_SKELETON, NULL)); +} + diff --git a/settings/xfsm-client-dbus-client.h b/settings/xfsm-client-dbus-client.h new file mode 100644 index 0000000..04667ed --- /dev/null +++ b/settings/xfsm-client-dbus-client.h @@ -0,0 +1,431 @@ +/* + * Generated by gdbus-codegen 2.62.4 from xfsm-client-dbus.xml. DO NOT EDIT. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. + */ + +#ifndef __XFSM_CLIENT_DBUS_CLIENT_H__ +#define __XFSM_CLIENT_DBUS_CLIENT_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.xfce.Session.Client */ + +#define XFSM_TYPE_CLIENT (xfsm_client_get_type ()) +#define XFSM_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_CLIENT, XfsmClient)) +#define XFSM_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_CLIENT)) +#define XFSM_CLIENT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), XFSM_TYPE_CLIENT, XfsmClientIface)) + +struct _XfsmClient; +typedef struct _XfsmClient XfsmClient; +typedef struct _XfsmClientIface XfsmClientIface; + +struct _XfsmClientIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_delete_sm_properties) ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + const gchar *const *arg_names); + + gboolean (*handle_end_session_response) ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + gboolean arg_is_ok, + const gchar *arg_reason); + + gboolean (*handle_get_all_sm_properties) ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_id) ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_sm_properties) ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + const gchar *const *arg_names); + + gboolean (*handle_get_state) ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_set_sm_properties) ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + GVariant *arg_properties); + + gboolean (*handle_terminate) ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + + void (*cancel_end_session) ( + XfsmClient *object); + + void (*end_session) ( + XfsmClient *object, + guint arg_flags); + + void (*query_end_session) ( + XfsmClient *object, + guint arg_flags); + + void (*sm_property_changed) ( + XfsmClient *object, + const gchar *arg_name, + GVariant *arg_value); + + void (*sm_property_deleted) ( + XfsmClient *object, + const gchar *arg_name); + + void (*state_changed) ( + XfsmClient *object, + guint arg_old_state, + guint arg_new_state); + + void (*stop) ( + XfsmClient *object); + +}; + +GType xfsm_client_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *xfsm_client_interface_info (void); +guint xfsm_client_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void xfsm_client_complete_get_id ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + const gchar *id); + +void xfsm_client_complete_get_state ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + guint state); + +void xfsm_client_complete_get_all_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + GVariant *properties); + +void xfsm_client_complete_get_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation, + GVariant *values); + +void xfsm_client_complete_set_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + +void xfsm_client_complete_delete_sm_properties ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + +void xfsm_client_complete_terminate ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + +void xfsm_client_complete_end_session_response ( + XfsmClient *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void xfsm_client_emit_state_changed ( + XfsmClient *object, + guint arg_old_state, + guint arg_new_state); + +void xfsm_client_emit_sm_property_changed ( + XfsmClient *object, + const gchar *arg_name, + GVariant *arg_value); + +void xfsm_client_emit_sm_property_deleted ( + XfsmClient *object, + const gchar *arg_name); + +void xfsm_client_emit_query_end_session ( + XfsmClient *object, + guint arg_flags); + +void xfsm_client_emit_end_session ( + XfsmClient *object, + guint arg_flags); + +void xfsm_client_emit_cancel_end_session ( + XfsmClient *object); + +void xfsm_client_emit_stop ( + XfsmClient *object); + + + +/* D-Bus method calls: */ +void xfsm_client_call_get_id ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_get_id_finish ( + XfsmClient *proxy, + gchar **out_id, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_get_id_sync ( + XfsmClient *proxy, + gchar **out_id, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_get_state ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_get_state_finish ( + XfsmClient *proxy, + guint *out_state, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_get_state_sync ( + XfsmClient *proxy, + guint *out_state, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_get_all_sm_properties ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_get_all_sm_properties_finish ( + XfsmClient *proxy, + GVariant **out_properties, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_get_all_sm_properties_sync ( + XfsmClient *proxy, + GVariant **out_properties, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_get_sm_properties ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_get_sm_properties_finish ( + XfsmClient *proxy, + GVariant **out_values, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_get_sm_properties_sync ( + XfsmClient *proxy, + const gchar *const *arg_names, + GVariant **out_values, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_set_sm_properties ( + XfsmClient *proxy, + GVariant *arg_properties, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_set_sm_properties_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_set_sm_properties_sync ( + XfsmClient *proxy, + GVariant *arg_properties, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_delete_sm_properties ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_delete_sm_properties_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_delete_sm_properties_sync ( + XfsmClient *proxy, + const gchar *const *arg_names, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_terminate ( + XfsmClient *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_terminate_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_terminate_sync ( + XfsmClient *proxy, + GCancellable *cancellable, + GError **error); + +void xfsm_client_call_end_session_response ( + XfsmClient *proxy, + gboolean arg_is_ok, + const gchar *arg_reason, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_client_call_end_session_response_finish ( + XfsmClient *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_client_call_end_session_response_sync ( + XfsmClient *proxy, + gboolean arg_is_ok, + const gchar *arg_reason, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define XFSM_TYPE_CLIENT_PROXY (xfsm_client_proxy_get_type ()) +#define XFSM_CLIENT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_CLIENT_PROXY, XfsmClientProxy)) +#define XFSM_CLIENT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), XFSM_TYPE_CLIENT_PROXY, XfsmClientProxyClass)) +#define XFSM_CLIENT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFSM_TYPE_CLIENT_PROXY, XfsmClientProxyClass)) +#define XFSM_IS_CLIENT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_CLIENT_PROXY)) +#define XFSM_IS_CLIENT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFSM_TYPE_CLIENT_PROXY)) + +typedef struct _XfsmClientProxy XfsmClientProxy; +typedef struct _XfsmClientProxyClass XfsmClientProxyClass; +typedef struct _XfsmClientProxyPrivate XfsmClientProxyPrivate; + +struct _XfsmClientProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + XfsmClientProxyPrivate *priv; +}; + +struct _XfsmClientProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType xfsm_client_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XfsmClientProxy, g_object_unref) +#endif + +void xfsm_client_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +XfsmClient *xfsm_client_proxy_new_finish ( + GAsyncResult *res, + GError **error); +XfsmClient *xfsm_client_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void xfsm_client_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +XfsmClient *xfsm_client_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +XfsmClient *xfsm_client_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define XFSM_TYPE_CLIENT_SKELETON (xfsm_client_skeleton_get_type ()) +#define XFSM_CLIENT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_CLIENT_SKELETON, XfsmClientSkeleton)) +#define XFSM_CLIENT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), XFSM_TYPE_CLIENT_SKELETON, XfsmClientSkeletonClass)) +#define XFSM_CLIENT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFSM_TYPE_CLIENT_SKELETON, XfsmClientSkeletonClass)) +#define XFSM_IS_CLIENT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_CLIENT_SKELETON)) +#define XFSM_IS_CLIENT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFSM_TYPE_CLIENT_SKELETON)) + +typedef struct _XfsmClientSkeleton XfsmClientSkeleton; +typedef struct _XfsmClientSkeletonClass XfsmClientSkeletonClass; +typedef struct _XfsmClientSkeletonPrivate XfsmClientSkeletonPrivate; + +struct _XfsmClientSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + XfsmClientSkeletonPrivate *priv; +}; + +struct _XfsmClientSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType xfsm_client_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XfsmClientSkeleton, g_object_unref) +#endif + +XfsmClient *xfsm_client_skeleton_new (void); + + +G_END_DECLS + +#endif /* __XFSM_CLIENT_DBUS_CLIENT_H__ */ diff --git a/settings/xfsm-manager-dbus-client.c b/settings/xfsm-manager-dbus-client.c new file mode 100644 index 0000000..269905f --- /dev/null +++ b/settings/xfsm-manager-dbus-client.c @@ -0,0 +1,4263 @@ +/* + * Generated by gdbus-codegen 2.62.4 from xfsm-manager-dbus.xml. DO NOT EDIT. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "xfsm-manager-dbus-client.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + guint use_gvariant : 1; + guint emits_changed_signal : 1; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.xfce.Session.Manager + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:XfsmManager + * @title: XfsmManager + * @short_description: Generated C code for the org.xfce.Session.Manager D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.xfce.Session.Manager ---- */ + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_get_info_OUT_ARG_name = +{ + { + -1, + (gchar *) "name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_get_info_OUT_ARG_version = +{ + { + -1, + (gchar *) "version", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_get_info_OUT_ARG_vendor = +{ + { + -1, + (gchar *) "vendor", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_get_info_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_get_info_OUT_ARG_name.parent_struct, + &_xfsm_manager_method_info_get_info_OUT_ARG_version.parent_struct, + &_xfsm_manager_method_info_get_info_OUT_ARG_vendor.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_get_info = +{ + { + -1, + (gchar *) "GetInfo", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_get_info_OUT_ARG_pointers, + NULL + }, + "handle-get-info", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_list_clients_OUT_ARG_clients = +{ + { + -1, + (gchar *) "clients", + (gchar *) "ao", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_list_clients_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_list_clients_OUT_ARG_clients.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_list_clients = +{ + { + -1, + (gchar *) "ListClients", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_list_clients_OUT_ARG_pointers, + NULL + }, + "handle-list-clients", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_get_state_OUT_ARG_state = +{ + { + -1, + (gchar *) "state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_get_state_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_get_state_OUT_ARG_state.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_get_state = +{ + { + -1, + (gchar *) "GetState", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_get_state_OUT_ARG_pointers, + NULL + }, + "handle-get-state", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_checkpoint_IN_ARG_session_name = +{ + { + -1, + (gchar *) "session_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_checkpoint_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_checkpoint_IN_ARG_session_name.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_checkpoint = +{ + { + -1, + (gchar *) "Checkpoint", + (GDBusArgInfo **) &_xfsm_manager_method_info_checkpoint_IN_ARG_pointers, + NULL, + NULL + }, + "handle-checkpoint", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_logout_IN_ARG_show_dialog = +{ + { + -1, + (gchar *) "show_dialog", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_logout_IN_ARG_allow_save = +{ + { + -1, + (gchar *) "allow_save", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_logout_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_logout_IN_ARG_show_dialog.parent_struct, + &_xfsm_manager_method_info_logout_IN_ARG_allow_save.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_logout = +{ + { + -1, + (gchar *) "Logout", + (GDBusArgInfo **) &_xfsm_manager_method_info_logout_IN_ARG_pointers, + NULL, + NULL + }, + "handle-logout", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_shutdown_IN_ARG_allow_save = +{ + { + -1, + (gchar *) "allow_save", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_shutdown_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_shutdown_IN_ARG_allow_save.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_shutdown = +{ + { + -1, + (gchar *) "Shutdown", + (GDBusArgInfo **) &_xfsm_manager_method_info_shutdown_IN_ARG_pointers, + NULL, + NULL + }, + "handle-shutdown", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_can_shutdown_OUT_ARG_can_shutdown = +{ + { + -1, + (gchar *) "can_shutdown", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_can_shutdown_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_can_shutdown_OUT_ARG_can_shutdown.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_can_shutdown = +{ + { + -1, + (gchar *) "CanShutdown", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_can_shutdown_OUT_ARG_pointers, + NULL + }, + "handle-can-shutdown", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_restart_IN_ARG_allow_save = +{ + { + -1, + (gchar *) "allow_save", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_restart_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_restart_IN_ARG_allow_save.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_restart = +{ + { + -1, + (gchar *) "Restart", + (GDBusArgInfo **) &_xfsm_manager_method_info_restart_IN_ARG_pointers, + NULL, + NULL + }, + "handle-restart", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_can_restart_OUT_ARG_can_restart = +{ + { + -1, + (gchar *) "can_restart", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_can_restart_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_can_restart_OUT_ARG_can_restart.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_can_restart = +{ + { + -1, + (gchar *) "CanRestart", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_can_restart_OUT_ARG_pointers, + NULL + }, + "handle-can-restart", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_suspend = +{ + { + -1, + (gchar *) "Suspend", + NULL, + NULL, + NULL + }, + "handle-suspend", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_can_suspend_OUT_ARG_can_suspend = +{ + { + -1, + (gchar *) "can_suspend", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_can_suspend_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_can_suspend_OUT_ARG_can_suspend.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_can_suspend = +{ + { + -1, + (gchar *) "CanSuspend", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_can_suspend_OUT_ARG_pointers, + NULL + }, + "handle-can-suspend", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_hibernate = +{ + { + -1, + (gchar *) "Hibernate", + NULL, + NULL, + NULL + }, + "handle-hibernate", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_can_hibernate_OUT_ARG_can_hibernate = +{ + { + -1, + (gchar *) "can_hibernate", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_can_hibernate_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_can_hibernate_OUT_ARG_can_hibernate.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_can_hibernate = +{ + { + -1, + (gchar *) "CanHibernate", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_can_hibernate_OUT_ARG_pointers, + NULL + }, + "handle-can-hibernate", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_hybrid_sleep = +{ + { + -1, + (gchar *) "HybridSleep", + NULL, + NULL, + NULL + }, + "handle-hybrid-sleep", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_can_hybrid_sleep_OUT_ARG_can_hybrid_sleep = +{ + { + -1, + (gchar *) "can_hybrid_sleep", + (gchar *) "b", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_can_hybrid_sleep_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_can_hybrid_sleep_OUT_ARG_can_hybrid_sleep.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_can_hybrid_sleep = +{ + { + -1, + (gchar *) "CanHybridSleep", + NULL, + (GDBusArgInfo **) &_xfsm_manager_method_info_can_hybrid_sleep_OUT_ARG_pointers, + NULL + }, + "handle-can-hybrid-sleep", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_switch_user = +{ + { + -1, + (gchar *) "SwitchUser", + NULL, + NULL, + NULL + }, + "handle-switch-user", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_register_client_IN_ARG_app_id = +{ + { + -1, + (gchar *) "app_id", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_register_client_IN_ARG_client_startup_id = +{ + { + -1, + (gchar *) "client_startup_id", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_register_client_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_register_client_IN_ARG_app_id.parent_struct, + &_xfsm_manager_method_info_register_client_IN_ARG_client_startup_id.parent_struct, + NULL +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_register_client_OUT_ARG_client_id = +{ + { + -1, + (gchar *) "client_id", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_register_client_OUT_ARG_pointers[] = +{ + &_xfsm_manager_method_info_register_client_OUT_ARG_client_id.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_register_client = +{ + { + -1, + (gchar *) "RegisterClient", + (GDBusArgInfo **) &_xfsm_manager_method_info_register_client_IN_ARG_pointers, + (GDBusArgInfo **) &_xfsm_manager_method_info_register_client_OUT_ARG_pointers, + NULL + }, + "handle-register-client", + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_method_info_unregister_client_IN_ARG_client_id = +{ + { + -1, + (gchar *) "client_id", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_method_info_unregister_client_IN_ARG_pointers[] = +{ + &_xfsm_manager_method_info_unregister_client_IN_ARG_client_id.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _xfsm_manager_method_info_unregister_client = +{ + { + -1, + (gchar *) "UnregisterClient", + (GDBusArgInfo **) &_xfsm_manager_method_info_unregister_client_IN_ARG_pointers, + NULL, + NULL + }, + "handle-unregister-client", + FALSE +}; + +static const GDBusMethodInfo * const _xfsm_manager_method_info_pointers[] = +{ + &_xfsm_manager_method_info_get_info.parent_struct, + &_xfsm_manager_method_info_list_clients.parent_struct, + &_xfsm_manager_method_info_get_state.parent_struct, + &_xfsm_manager_method_info_checkpoint.parent_struct, + &_xfsm_manager_method_info_logout.parent_struct, + &_xfsm_manager_method_info_shutdown.parent_struct, + &_xfsm_manager_method_info_can_shutdown.parent_struct, + &_xfsm_manager_method_info_restart.parent_struct, + &_xfsm_manager_method_info_can_restart.parent_struct, + &_xfsm_manager_method_info_suspend.parent_struct, + &_xfsm_manager_method_info_can_suspend.parent_struct, + &_xfsm_manager_method_info_hibernate.parent_struct, + &_xfsm_manager_method_info_can_hibernate.parent_struct, + &_xfsm_manager_method_info_hybrid_sleep.parent_struct, + &_xfsm_manager_method_info_can_hybrid_sleep.parent_struct, + &_xfsm_manager_method_info_switch_user.parent_struct, + &_xfsm_manager_method_info_register_client.parent_struct, + &_xfsm_manager_method_info_unregister_client.parent_struct, + NULL +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_signal_info_state_changed_ARG_old_state = +{ + { + -1, + (gchar *) "old_state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_signal_info_state_changed_ARG_new_state = +{ + { + -1, + (gchar *) "new_state", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_signal_info_state_changed_ARG_pointers[] = +{ + &_xfsm_manager_signal_info_state_changed_ARG_old_state.parent_struct, + &_xfsm_manager_signal_info_state_changed_ARG_new_state.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_manager_signal_info_state_changed = +{ + { + -1, + (gchar *) "StateChanged", + (GDBusArgInfo **) &_xfsm_manager_signal_info_state_changed_ARG_pointers, + NULL + }, + "state-changed" +}; + +static const _ExtendedGDBusArgInfo _xfsm_manager_signal_info_client_registered_ARG_client = +{ + { + -1, + (gchar *) "client", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _xfsm_manager_signal_info_client_registered_ARG_pointers[] = +{ + &_xfsm_manager_signal_info_client_registered_ARG_client.parent_struct, + NULL +}; + +static const _ExtendedGDBusSignalInfo _xfsm_manager_signal_info_client_registered = +{ + { + -1, + (gchar *) "ClientRegistered", + (GDBusArgInfo **) &_xfsm_manager_signal_info_client_registered_ARG_pointers, + NULL + }, + "client-registered" +}; + +static const _ExtendedGDBusSignalInfo _xfsm_manager_signal_info_shutdown_cancelled = +{ + { + -1, + (gchar *) "ShutdownCancelled", + NULL, + NULL + }, + "shutdown-cancelled" +}; + +static const GDBusSignalInfo * const _xfsm_manager_signal_info_pointers[] = +{ + &_xfsm_manager_signal_info_state_changed.parent_struct, + &_xfsm_manager_signal_info_client_registered.parent_struct, + &_xfsm_manager_signal_info_shutdown_cancelled.parent_struct, + NULL +}; + +static const GDBusAnnotationInfo _xfsm_manager_annotation_info_0 = +{ + -1, + (gchar *) "org.freedesktop.DBus.GLib.CSymbol", + (gchar *) "xfsm_manager_dbus", + NULL +}; + +static const GDBusAnnotationInfo _xfsm_manager_annotation_info_1 = +{ + -1, + (gchar *) "org.freedesktop.DBus.GLib.ClientCSymbol", + (gchar *) "xfsm_manager_dbus_client", + NULL +}; + +static const GDBusAnnotationInfo * const _xfsm_manager_annotation_info_pointers[] = +{ + &_xfsm_manager_annotation_info_0, + &_xfsm_manager_annotation_info_1, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _xfsm_manager_interface_info = +{ + { + -1, + (gchar *) "org.xfce.Session.Manager", + (GDBusMethodInfo **) &_xfsm_manager_method_info_pointers, + (GDBusSignalInfo **) &_xfsm_manager_signal_info_pointers, + NULL, + (GDBusAnnotationInfo **) &_xfsm_manager_annotation_info_pointers + }, + "manager", +}; + + +/** + * xfsm_manager_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +xfsm_manager_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct; +} + +/** + * xfsm_manager_override_properties: + * @klass: The class structure for a #GObject derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #XfsmManager interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +xfsm_manager_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * XfsmManager: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link>. + */ + +/** + * XfsmManagerIface: + * @parent_iface: The parent interface. + * @handle_can_hibernate: Handler for the #XfsmManager::handle-can-hibernate signal. + * @handle_can_hybrid_sleep: Handler for the #XfsmManager::handle-can-hybrid-sleep signal. + * @handle_can_restart: Handler for the #XfsmManager::handle-can-restart signal. + * @handle_can_shutdown: Handler for the #XfsmManager::handle-can-shutdown signal. + * @handle_can_suspend: Handler for the #XfsmManager::handle-can-suspend signal. + * @handle_checkpoint: Handler for the #XfsmManager::handle-checkpoint signal. + * @handle_get_info: Handler for the #XfsmManager::handle-get-info signal. + * @handle_get_state: Handler for the #XfsmManager::handle-get-state signal. + * @handle_hibernate: Handler for the #XfsmManager::handle-hibernate signal. + * @handle_hybrid_sleep: Handler for the #XfsmManager::handle-hybrid-sleep signal. + * @handle_list_clients: Handler for the #XfsmManager::handle-list-clients signal. + * @handle_logout: Handler for the #XfsmManager::handle-logout signal. + * @handle_register_client: Handler for the #XfsmManager::handle-register-client signal. + * @handle_restart: Handler for the #XfsmManager::handle-restart signal. + * @handle_shutdown: Handler for the #XfsmManager::handle-shutdown signal. + * @handle_suspend: Handler for the #XfsmManager::handle-suspend signal. + * @handle_switch_user: Handler for the #XfsmManager::handle-switch-user signal. + * @handle_unregister_client: Handler for the #XfsmManager::handle-unregister-client signal. + * @client_registered: Handler for the #XfsmManager::client-registered signal. + * @shutdown_cancelled: Handler for the #XfsmManager::shutdown-cancelled signal. + * @state_changed: Handler for the #XfsmManager::state-changed signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link>. + */ + +typedef XfsmManagerIface XfsmManagerInterface; +G_DEFINE_INTERFACE (XfsmManager, xfsm_manager, G_TYPE_OBJECT) + +static void +xfsm_manager_default_init (XfsmManagerIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * XfsmManager::handle-get-info: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.GetInfo">GetInfo()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_get_info() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-info", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_get_info), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-list-clients: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.ListClients">ListClients()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_list_clients() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-list-clients", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_list_clients), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-get-state: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.GetState">GetState()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_get_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-state", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_get_state), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-checkpoint: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_session_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Checkpoint">Checkpoint()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_checkpoint() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-checkpoint", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_checkpoint), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * XfsmManager::handle-logout: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_show_dialog: Argument passed by remote caller. + * @arg_allow_save: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Logout">Logout()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_logout() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-logout", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_logout), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); + + /** + * XfsmManager::handle-shutdown: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_allow_save: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Shutdown">Shutdown()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_shutdown() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-shutdown", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_shutdown), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN); + + /** + * XfsmManager::handle-can-shutdown: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.CanShutdown">CanShutdown()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_can_shutdown() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-can-shutdown", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_can_shutdown), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-restart: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_allow_save: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Restart">Restart()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_restart() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-restart", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_restart), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN); + + /** + * XfsmManager::handle-can-restart: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.CanRestart">CanRestart()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_can_restart() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-can-restart", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_can_restart), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-suspend: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Suspend">Suspend()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_suspend() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-suspend", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_suspend), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-can-suspend: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.CanSuspend">CanSuspend()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_can_suspend() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-can-suspend", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_can_suspend), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-hibernate: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.Hibernate">Hibernate()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_hibernate() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-hibernate", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_hibernate), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-can-hibernate: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHibernate">CanHibernate()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_can_hibernate() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-can-hibernate", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_can_hibernate), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-hybrid-sleep: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.HybridSleep">HybridSleep()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_hybrid_sleep() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-hybrid-sleep", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_hybrid_sleep), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-can-hybrid-sleep: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHybridSleep">CanHybridSleep()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_can_hybrid_sleep() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-can-hybrid-sleep", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_can_hybrid_sleep), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-switch-user: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.SwitchUser">SwitchUser()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_switch_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-switch-user", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_switch_user), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * XfsmManager::handle-register-client: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_app_id: Argument passed by remote caller. + * @arg_client_startup_id: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.RegisterClient">RegisterClient()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_register_client() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-client", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_register_client), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); + + /** + * XfsmManager::handle-unregister-client: + * @object: A #XfsmManager. + * @invocation: A #GDBusMethodInvocation. + * @arg_client_id: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-xfce-Session-Manager.UnregisterClient">UnregisterClient()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xfsm_manager_complete_unregister_client() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-unregister-client", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, handle_unregister_client), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * XfsmManager::state-changed: + * @object: A #XfsmManager. + * @arg_old_state: Argument. + * @arg_new_state: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Manager.StateChanged">"StateChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_UINT, G_TYPE_UINT); + + /** + * XfsmManager::client-registered: + * @object: A #XfsmManager. + * @arg_client: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Manager.ClientRegistered">"ClientRegistered"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("client-registered", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, client_registered), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_STRING); + + /** + * XfsmManager::shutdown-cancelled: + * @object: A #XfsmManager. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-xfce-Session-Manager.ShutdownCancelled">"ShutdownCancelled"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("shutdown-cancelled", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (XfsmManagerIface, shutdown_cancelled), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + +} + +/** + * xfsm_manager_emit_state_changed: + * @object: A #XfsmManager. + * @arg_old_state: Argument to pass with the signal. + * @arg_new_state: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Manager.StateChanged">"StateChanged"</link> D-Bus signal. + */ +void +xfsm_manager_emit_state_changed ( + XfsmManager *object, + guint arg_old_state, + guint arg_new_state) +{ + g_signal_emit_by_name (object, "state-changed", arg_old_state, arg_new_state); +} + +/** + * xfsm_manager_emit_client_registered: + * @object: A #XfsmManager. + * @arg_client: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Manager.ClientRegistered">"ClientRegistered"</link> D-Bus signal. + */ +void +xfsm_manager_emit_client_registered ( + XfsmManager *object, + const gchar *arg_client) +{ + g_signal_emit_by_name (object, "client-registered", arg_client); +} + +/** + * xfsm_manager_emit_shutdown_cancelled: + * @object: A #XfsmManager. + * + * Emits the <link linkend="gdbus-signal-org-xfce-Session-Manager.ShutdownCancelled">"ShutdownCancelled"</link> D-Bus signal. + */ +void +xfsm_manager_emit_shutdown_cancelled ( + XfsmManager *object) +{ + g_signal_emit_by_name (object, "shutdown-cancelled"); +} + +/** + * xfsm_manager_call_get_info: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.GetInfo">GetInfo()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_get_info_finish() to get the result of the operation. + * + * See xfsm_manager_call_get_info_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_get_info ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_get_info_finish: + * @proxy: A #XfsmManagerProxy. + * @out_name: (out) (optional): Return location for return parameter or %NULL to ignore. + * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore. + * @out_vendor: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_get_info(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_get_info(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_get_info_finish ( + XfsmManager *proxy, + gchar **out_name, + gchar **out_version, + gchar **out_vendor, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(sss)", + out_name, + out_version, + out_vendor); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_get_info_sync: + * @proxy: A #XfsmManagerProxy. + * @out_name: (out) (optional): Return location for return parameter or %NULL to ignore. + * @out_version: (out) (optional): Return location for return parameter or %NULL to ignore. + * @out_vendor: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.GetInfo">GetInfo()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_get_info() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_get_info_sync ( + XfsmManager *proxy, + gchar **out_name, + gchar **out_version, + gchar **out_vendor, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(sss)", + out_name, + out_version, + out_vendor); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_list_clients: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.ListClients">ListClients()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_list_clients_finish() to get the result of the operation. + * + * See xfsm_manager_call_list_clients_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_list_clients ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ListClients", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_list_clients_finish: + * @proxy: A #XfsmManagerProxy. + * @out_clients: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_list_clients(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_list_clients(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_list_clients_finish ( + XfsmManager *proxy, + gchar ***out_clients, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^ao)", + out_clients); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_list_clients_sync: + * @proxy: A #XfsmManagerProxy. + * @out_clients: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.ListClients">ListClients()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_list_clients() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_list_clients_sync ( + XfsmManager *proxy, + gchar ***out_clients, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ListClients", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^ao)", + out_clients); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_get_state: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.GetState">GetState()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_get_state_finish() to get the result of the operation. + * + * See xfsm_manager_call_get_state_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_get_state ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetState", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_get_state_finish: + * @proxy: A #XfsmManagerProxy. + * @out_state: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_get_state(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_get_state(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_get_state_finish ( + XfsmManager *proxy, + guint *out_state, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_state); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_get_state_sync: + * @proxy: A #XfsmManagerProxy. + * @out_state: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.GetState">GetState()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_get_state() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_get_state_sync ( + XfsmManager *proxy, + guint *out_state, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetState", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_state); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_checkpoint: + * @proxy: A #XfsmManagerProxy. + * @arg_session_name: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Checkpoint">Checkpoint()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_checkpoint_finish() to get the result of the operation. + * + * See xfsm_manager_call_checkpoint_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_checkpoint ( + XfsmManager *proxy, + const gchar *arg_session_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Checkpoint", + g_variant_new ("(s)", + arg_session_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_checkpoint_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_checkpoint(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_checkpoint(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_checkpoint_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_checkpoint_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_session_name: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Checkpoint">Checkpoint()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_checkpoint() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_checkpoint_sync ( + XfsmManager *proxy, + const gchar *arg_session_name, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Checkpoint", + g_variant_new ("(s)", + arg_session_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_logout: + * @proxy: A #XfsmManagerProxy. + * @arg_show_dialog: Argument to pass with the method invocation. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Logout">Logout()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_logout_finish() to get the result of the operation. + * + * See xfsm_manager_call_logout_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_logout ( + XfsmManager *proxy, + gboolean arg_show_dialog, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Logout", + g_variant_new ("(bb)", + arg_show_dialog, + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_logout_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_logout(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_logout(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_logout_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_logout_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_show_dialog: Argument to pass with the method invocation. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Logout">Logout()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_logout() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_logout_sync ( + XfsmManager *proxy, + gboolean arg_show_dialog, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Logout", + g_variant_new ("(bb)", + arg_show_dialog, + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_shutdown: + * @proxy: A #XfsmManagerProxy. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Shutdown">Shutdown()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_shutdown_finish() to get the result of the operation. + * + * See xfsm_manager_call_shutdown_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_shutdown ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Shutdown", + g_variant_new ("(b)", + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_shutdown_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_shutdown(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_shutdown(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_shutdown_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_shutdown_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Shutdown">Shutdown()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_shutdown() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_shutdown_sync ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Shutdown", + g_variant_new ("(b)", + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_shutdown: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanShutdown">CanShutdown()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_can_shutdown_finish() to get the result of the operation. + * + * See xfsm_manager_call_can_shutdown_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_can_shutdown ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CanShutdown", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_can_shutdown_finish: + * @proxy: A #XfsmManagerProxy. + * @out_can_shutdown: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_can_shutdown(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_can_shutdown(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_shutdown_finish ( + XfsmManager *proxy, + gboolean *out_can_shutdown, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_shutdown); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_shutdown_sync: + * @proxy: A #XfsmManagerProxy. + * @out_can_shutdown: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanShutdown">CanShutdown()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_can_shutdown() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_shutdown_sync ( + XfsmManager *proxy, + gboolean *out_can_shutdown, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CanShutdown", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_shutdown); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_restart: + * @proxy: A #XfsmManagerProxy. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Restart">Restart()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_restart_finish() to get the result of the operation. + * + * See xfsm_manager_call_restart_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_restart ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Restart", + g_variant_new ("(b)", + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_restart_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_restart(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_restart(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_restart_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_restart_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_allow_save: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Restart">Restart()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_restart() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_restart_sync ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Restart", + g_variant_new ("(b)", + arg_allow_save), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_restart: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanRestart">CanRestart()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_can_restart_finish() to get the result of the operation. + * + * See xfsm_manager_call_can_restart_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_can_restart ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CanRestart", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_can_restart_finish: + * @proxy: A #XfsmManagerProxy. + * @out_can_restart: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_can_restart(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_can_restart(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_restart_finish ( + XfsmManager *proxy, + gboolean *out_can_restart, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_restart); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_restart_sync: + * @proxy: A #XfsmManagerProxy. + * @out_can_restart: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanRestart">CanRestart()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_can_restart() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_restart_sync ( + XfsmManager *proxy, + gboolean *out_can_restart, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CanRestart", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_restart); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_suspend: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Suspend">Suspend()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_suspend_finish() to get the result of the operation. + * + * See xfsm_manager_call_suspend_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_suspend ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Suspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_suspend_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_suspend(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_suspend(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_suspend_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_suspend_sync: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Suspend">Suspend()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_suspend() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_suspend_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Suspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_suspend: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanSuspend">CanSuspend()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_can_suspend_finish() to get the result of the operation. + * + * See xfsm_manager_call_can_suspend_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_can_suspend ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CanSuspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_can_suspend_finish: + * @proxy: A #XfsmManagerProxy. + * @out_can_suspend: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_can_suspend(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_can_suspend(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_suspend_finish ( + XfsmManager *proxy, + gboolean *out_can_suspend, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_suspend); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_suspend_sync: + * @proxy: A #XfsmManagerProxy. + * @out_can_suspend: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanSuspend">CanSuspend()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_can_suspend() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_suspend_sync ( + XfsmManager *proxy, + gboolean *out_can_suspend, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CanSuspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_suspend); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_hibernate: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Hibernate">Hibernate()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_hibernate_finish() to get the result of the operation. + * + * See xfsm_manager_call_hibernate_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_hibernate ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Hibernate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_hibernate_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_hibernate(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_hibernate(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_hibernate_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_hibernate_sync: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.Hibernate">Hibernate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_hibernate() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_hibernate_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Hibernate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_hibernate: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHibernate">CanHibernate()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_can_hibernate_finish() to get the result of the operation. + * + * See xfsm_manager_call_can_hibernate_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_can_hibernate ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CanHibernate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_can_hibernate_finish: + * @proxy: A #XfsmManagerProxy. + * @out_can_hibernate: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_can_hibernate(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_can_hibernate(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_hibernate_finish ( + XfsmManager *proxy, + gboolean *out_can_hibernate, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_hibernate); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_hibernate_sync: + * @proxy: A #XfsmManagerProxy. + * @out_can_hibernate: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHibernate">CanHibernate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_can_hibernate() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_hibernate_sync ( + XfsmManager *proxy, + gboolean *out_can_hibernate, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CanHibernate", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_hibernate); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_hybrid_sleep: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.HybridSleep">HybridSleep()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_hybrid_sleep_finish() to get the result of the operation. + * + * See xfsm_manager_call_hybrid_sleep_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_hybrid_sleep ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "HybridSleep", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_hybrid_sleep_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_hybrid_sleep(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_hybrid_sleep(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_hybrid_sleep_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_hybrid_sleep_sync: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.HybridSleep">HybridSleep()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_hybrid_sleep() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_hybrid_sleep_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "HybridSleep", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_hybrid_sleep: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHybridSleep">CanHybridSleep()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_can_hybrid_sleep_finish() to get the result of the operation. + * + * See xfsm_manager_call_can_hybrid_sleep_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_can_hybrid_sleep ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CanHybridSleep", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_can_hybrid_sleep_finish: + * @proxy: A #XfsmManagerProxy. + * @out_can_hybrid_sleep: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_can_hybrid_sleep(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_can_hybrid_sleep(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_hybrid_sleep_finish ( + XfsmManager *proxy, + gboolean *out_can_hybrid_sleep, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_hybrid_sleep); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_can_hybrid_sleep_sync: + * @proxy: A #XfsmManagerProxy. + * @out_can_hybrid_sleep: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHybridSleep">CanHybridSleep()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_can_hybrid_sleep() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_can_hybrid_sleep_sync ( + XfsmManager *proxy, + gboolean *out_can_hybrid_sleep, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CanHybridSleep", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_can_hybrid_sleep); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_switch_user: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.SwitchUser">SwitchUser()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_switch_user_finish() to get the result of the operation. + * + * See xfsm_manager_call_switch_user_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_switch_user ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "SwitchUser", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_switch_user_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_switch_user(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_switch_user(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_switch_user_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_switch_user_sync: + * @proxy: A #XfsmManagerProxy. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.SwitchUser">SwitchUser()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_switch_user() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_switch_user_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "SwitchUser", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_register_client: + * @proxy: A #XfsmManagerProxy. + * @arg_app_id: Argument to pass with the method invocation. + * @arg_client_startup_id: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.RegisterClient">RegisterClient()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_register_client_finish() to get the result of the operation. + * + * See xfsm_manager_call_register_client_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_register_client ( + XfsmManager *proxy, + const gchar *arg_app_id, + const gchar *arg_client_startup_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "RegisterClient", + g_variant_new ("(ss)", + arg_app_id, + arg_client_startup_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_register_client_finish: + * @proxy: A #XfsmManagerProxy. + * @out_client_id: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_register_client(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_register_client(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_register_client_finish ( + XfsmManager *proxy, + gchar **out_client_id, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_client_id); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_register_client_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_app_id: Argument to pass with the method invocation. + * @arg_client_startup_id: Argument to pass with the method invocation. + * @out_client_id: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.RegisterClient">RegisterClient()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_register_client() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_register_client_sync ( + XfsmManager *proxy, + const gchar *arg_app_id, + const gchar *arg_client_startup_id, + gchar **out_client_id, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "RegisterClient", + g_variant_new ("(ss)", + arg_app_id, + arg_client_startup_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_client_id); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_unregister_client: + * @proxy: A #XfsmManagerProxy. + * @arg_client_id: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.UnregisterClient">UnregisterClient()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_call_unregister_client_finish() to get the result of the operation. + * + * See xfsm_manager_call_unregister_client_sync() for the synchronous, blocking version of this method. + */ +void +xfsm_manager_call_unregister_client ( + XfsmManager *proxy, + const gchar *arg_client_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "UnregisterClient", + g_variant_new ("(o)", + arg_client_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * xfsm_manager_call_unregister_client_finish: + * @proxy: A #XfsmManagerProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_call_unregister_client(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with xfsm_manager_call_unregister_client(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_unregister_client_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_call_unregister_client_sync: + * @proxy: A #XfsmManagerProxy. + * @arg_client_id: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-xfce-Session-Manager.UnregisterClient">UnregisterClient()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See xfsm_manager_call_unregister_client() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +xfsm_manager_call_unregister_client_sync ( + XfsmManager *proxy, + const gchar *arg_client_id, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "UnregisterClient", + g_variant_new ("(o)", + arg_client_id), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * xfsm_manager_complete_get_info: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @name: Parameter to return. + * @version: Parameter to return. + * @vendor: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.GetInfo">GetInfo()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_get_info ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *name, + const gchar *version, + const gchar *vendor) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(sss)", + name, + version, + vendor)); +} + +/** + * xfsm_manager_complete_list_clients: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @clients: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.ListClients">ListClients()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_list_clients ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *const *clients) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^ao)", + clients)); +} + +/** + * xfsm_manager_complete_get_state: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @state: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.GetState">GetState()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_get_state ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + guint state) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + state)); +} + +/** + * xfsm_manager_complete_checkpoint: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Checkpoint">Checkpoint()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_checkpoint ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_logout: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Logout">Logout()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_logout ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_shutdown: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Shutdown">Shutdown()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_shutdown ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_can_shutdown: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @can_shutdown: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.CanShutdown">CanShutdown()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_can_shutdown ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_shutdown) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + can_shutdown)); +} + +/** + * xfsm_manager_complete_restart: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Restart">Restart()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_restart ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_can_restart: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @can_restart: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.CanRestart">CanRestart()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_can_restart ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_restart) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + can_restart)); +} + +/** + * xfsm_manager_complete_suspend: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Suspend">Suspend()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_suspend ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_can_suspend: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @can_suspend: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.CanSuspend">CanSuspend()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_can_suspend ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_suspend) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + can_suspend)); +} + +/** + * xfsm_manager_complete_hibernate: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.Hibernate">Hibernate()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_hibernate ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_can_hibernate: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @can_hibernate: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHibernate">CanHibernate()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_can_hibernate ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_hibernate) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + can_hibernate)); +} + +/** + * xfsm_manager_complete_hybrid_sleep: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.HybridSleep">HybridSleep()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_hybrid_sleep ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_can_hybrid_sleep: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @can_hybrid_sleep: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.CanHybridSleep">CanHybridSleep()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_can_hybrid_sleep ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_hybrid_sleep) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + can_hybrid_sleep)); +} + +/** + * xfsm_manager_complete_switch_user: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.SwitchUser">SwitchUser()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_switch_user ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * xfsm_manager_complete_register_client: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @client_id: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.RegisterClient">RegisterClient()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_register_client ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *client_id) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + client_id)); +} + +/** + * xfsm_manager_complete_unregister_client: + * @object: A #XfsmManager. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-xfce-Session-Manager.UnregisterClient">UnregisterClient()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +xfsm_manager_complete_unregister_client ( + XfsmManager *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * XfsmManagerProxy: + * + * The #XfsmManagerProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * XfsmManagerProxyClass: + * @parent_class: The parent class. + * + * Class structure for #XfsmManagerProxy. + */ + +struct _XfsmManagerProxyPrivate +{ + GData *qdata; +}; + +static void xfsm_manager_proxy_iface_init (XfsmManagerIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (XfsmManagerProxy, xfsm_manager_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (XfsmManagerProxy) + G_IMPLEMENT_INTERFACE (XFSM_TYPE_MANAGER, xfsm_manager_proxy_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (XfsmManagerProxy, xfsm_manager_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (XFSM_TYPE_MANAGER, xfsm_manager_proxy_iface_init)) + +#endif +static void +xfsm_manager_proxy_finalize (GObject *object) +{ + XfsmManagerProxy *proxy = XFSM_MANAGER_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (xfsm_manager_proxy_parent_class)->finalize (object); +} + +static void +xfsm_manager_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +xfsm_manager_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +xfsm_manager_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + gsize num_params; + gsize n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], XFSM_TYPE_MANAGER); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, XFSM_TYPE_MANAGER); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +xfsm_manager_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + XfsmManagerProxy *proxy = XFSM_MANAGER_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +xfsm_manager_proxy_init (XfsmManagerProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = xfsm_manager_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XFSM_TYPE_MANAGER_PROXY, XfsmManagerProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xfsm_manager_interface_info ()); +} + +static void +xfsm_manager_proxy_class_init (XfsmManagerProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = xfsm_manager_proxy_finalize; + gobject_class->get_property = xfsm_manager_proxy_get_property; + gobject_class->set_property = xfsm_manager_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = xfsm_manager_proxy_g_signal; + proxy_class->g_properties_changed = xfsm_manager_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (XfsmManagerProxyPrivate)); +#endif +} + +static void +xfsm_manager_proxy_iface_init (XfsmManagerIface *iface) +{ +} + +/** + * xfsm_manager_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_proxy_new_finish() to get the result of the operation. + * + * See xfsm_manager_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +xfsm_manager_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (XFSM_TYPE_MANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Manager", NULL); +} + +/** + * xfsm_manager_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with xfsm_manager_proxy_new(). + * + * Returns: (transfer full) (type XfsmManagerProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmManager * +xfsm_manager_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return XFSM_MANAGER (ret); + else + return NULL; +} + +/** + * xfsm_manager_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See xfsm_manager_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type XfsmManagerProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmManager * +xfsm_manager_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (XFSM_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Manager", NULL); + if (ret != NULL) + return XFSM_MANAGER (ret); + else + return NULL; +} + + +/** + * xfsm_manager_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like xfsm_manager_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call xfsm_manager_proxy_new_for_bus_finish() to get the result of the operation. + * + * See xfsm_manager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +xfsm_manager_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (XFSM_TYPE_MANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Manager", NULL); +} + +/** + * xfsm_manager_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xfsm_manager_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with xfsm_manager_proxy_new_for_bus(). + * + * Returns: (transfer full) (type XfsmManagerProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmManager * +xfsm_manager_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return XFSM_MANAGER (ret); + else + return NULL; +} + +/** + * xfsm_manager_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like xfsm_manager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See xfsm_manager_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type XfsmManagerProxy): The constructed proxy object or %NULL if @error is set. + */ +XfsmManager * +xfsm_manager_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (XFSM_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.xfce.Session.Manager", NULL); + if (ret != NULL) + return XFSM_MANAGER (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * XfsmManagerSkeleton: + * + * The #XfsmManagerSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * XfsmManagerSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #XfsmManagerSkeleton. + */ + +struct _XfsmManagerSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_xfsm_manager_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + gsize num_params; + guint num_extra; + gsize n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], XFSM_TYPE_MANAGER); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, XFSM_TYPE_MANAGER); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_xfsm_manager_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_xfsm_manager_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xfsm_manager_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _xfsm_manager_skeleton_vtable = +{ + _xfsm_manager_skeleton_handle_method_call, + _xfsm_manager_skeleton_handle_get_property, + _xfsm_manager_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +xfsm_manager_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return xfsm_manager_interface_info (); +} + +static GDBusInterfaceVTable * +xfsm_manager_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_xfsm_manager_skeleton_vtable; +} + +static GVariant * +xfsm_manager_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_xfsm_manager_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _xfsm_manager_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _xfsm_manager_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _xfsm_manager_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Manager", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +xfsm_manager_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_xfsm_manager_on_signal_state_changed ( + XfsmManager *object, + guint arg_old_state, + guint arg_new_state) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(uu)", + arg_old_state, + arg_new_state)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Manager", "StateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_manager_on_signal_client_registered ( + XfsmManager *object, + const gchar *arg_client) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(o)", + arg_client)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Manager", "ClientRegistered", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_xfsm_manager_on_signal_shutdown_cancelled ( + XfsmManager *object) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.xfce.Session.Manager", "ShutdownCancelled", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void xfsm_manager_skeleton_iface_init (XfsmManagerIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (XfsmManagerSkeleton, xfsm_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (XfsmManagerSkeleton) + G_IMPLEMENT_INTERFACE (XFSM_TYPE_MANAGER, xfsm_manager_skeleton_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (XfsmManagerSkeleton, xfsm_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (XFSM_TYPE_MANAGER, xfsm_manager_skeleton_iface_init)) + +#endif +static void +xfsm_manager_skeleton_finalize (GObject *object) +{ + XfsmManagerSkeleton *skeleton = XFSM_MANAGER_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (xfsm_manager_skeleton_parent_class)->finalize (object); +} + +static void +xfsm_manager_skeleton_init (XfsmManagerSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = xfsm_manager_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XFSM_TYPE_MANAGER_SKELETON, XfsmManagerSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +xfsm_manager_skeleton_class_init (XfsmManagerSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = xfsm_manager_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = xfsm_manager_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = xfsm_manager_skeleton_dbus_interface_get_properties; + skeleton_class->flush = xfsm_manager_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = xfsm_manager_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (XfsmManagerSkeletonPrivate)); +#endif +} + +static void +xfsm_manager_skeleton_iface_init (XfsmManagerIface *iface) +{ + iface->state_changed = _xfsm_manager_on_signal_state_changed; + iface->client_registered = _xfsm_manager_on_signal_client_registered; + iface->shutdown_cancelled = _xfsm_manager_on_signal_shutdown_cancelled; +} + +/** + * xfsm_manager_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-xfce-Session-Manager.top_of_page">org.xfce.Session.Manager</link>. + * + * Returns: (transfer full) (type XfsmManagerSkeleton): The skeleton object. + */ +XfsmManager * +xfsm_manager_skeleton_new (void) +{ + return XFSM_MANAGER (g_object_new (XFSM_TYPE_MANAGER_SKELETON, NULL)); +} + diff --git a/settings/xfsm-manager-dbus-client.h b/settings/xfsm-manager-dbus-client.h new file mode 100644 index 0000000..289dc47 --- /dev/null +++ b/settings/xfsm-manager-dbus-client.h @@ -0,0 +1,669 @@ +/* + * Generated by gdbus-codegen 2.62.4 from xfsm-manager-dbus.xml. DO NOT EDIT. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. + */ + +#ifndef __XFSM_MANAGER_DBUS_CLIENT_H__ +#define __XFSM_MANAGER_DBUS_CLIENT_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.xfce.Session.Manager */ + +#define XFSM_TYPE_MANAGER (xfsm_manager_get_type ()) +#define XFSM_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_MANAGER, XfsmManager)) +#define XFSM_IS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_MANAGER)) +#define XFSM_MANAGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), XFSM_TYPE_MANAGER, XfsmManagerIface)) + +struct _XfsmManager; +typedef struct _XfsmManager XfsmManager; +typedef struct _XfsmManagerIface XfsmManagerIface; + +struct _XfsmManagerIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_can_hibernate) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_can_hybrid_sleep) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_can_restart) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_can_shutdown) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_can_suspend) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_checkpoint) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *arg_session_name); + + gboolean (*handle_get_info) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_state) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_hibernate) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_hybrid_sleep) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_list_clients) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_logout) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean arg_show_dialog, + gboolean arg_allow_save); + + gboolean (*handle_register_client) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *arg_app_id, + const gchar *arg_client_startup_id); + + gboolean (*handle_restart) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean arg_allow_save); + + gboolean (*handle_shutdown) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean arg_allow_save); + + gboolean (*handle_suspend) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_switch_user) ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_unregister_client) ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *arg_client_id); + + void (*client_registered) ( + XfsmManager *object, + const gchar *arg_client); + + void (*shutdown_cancelled) ( + XfsmManager *object); + + void (*state_changed) ( + XfsmManager *object, + guint arg_old_state, + guint arg_new_state); + +}; + +GType xfsm_manager_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *xfsm_manager_interface_info (void); +guint xfsm_manager_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void xfsm_manager_complete_get_info ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *name, + const gchar *version, + const gchar *vendor); + +void xfsm_manager_complete_list_clients ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *const *clients); + +void xfsm_manager_complete_get_state ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + guint state); + +void xfsm_manager_complete_checkpoint ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_logout ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_shutdown ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_can_shutdown ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_shutdown); + +void xfsm_manager_complete_restart ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_can_restart ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_restart); + +void xfsm_manager_complete_suspend ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_can_suspend ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_suspend); + +void xfsm_manager_complete_hibernate ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_can_hibernate ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_hibernate); + +void xfsm_manager_complete_hybrid_sleep ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_can_hybrid_sleep ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + gboolean can_hybrid_sleep); + +void xfsm_manager_complete_switch_user ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + +void xfsm_manager_complete_register_client ( + XfsmManager *object, + GDBusMethodInvocation *invocation, + const gchar *client_id); + +void xfsm_manager_complete_unregister_client ( + XfsmManager *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void xfsm_manager_emit_state_changed ( + XfsmManager *object, + guint arg_old_state, + guint arg_new_state); + +void xfsm_manager_emit_client_registered ( + XfsmManager *object, + const gchar *arg_client); + +void xfsm_manager_emit_shutdown_cancelled ( + XfsmManager *object); + + + +/* D-Bus method calls: */ +void xfsm_manager_call_get_info ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_get_info_finish ( + XfsmManager *proxy, + gchar **out_name, + gchar **out_version, + gchar **out_vendor, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_get_info_sync ( + XfsmManager *proxy, + gchar **out_name, + gchar **out_version, + gchar **out_vendor, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_list_clients ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_list_clients_finish ( + XfsmManager *proxy, + gchar ***out_clients, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_list_clients_sync ( + XfsmManager *proxy, + gchar ***out_clients, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_get_state ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_get_state_finish ( + XfsmManager *proxy, + guint *out_state, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_get_state_sync ( + XfsmManager *proxy, + guint *out_state, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_checkpoint ( + XfsmManager *proxy, + const gchar *arg_session_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_checkpoint_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_checkpoint_sync ( + XfsmManager *proxy, + const gchar *arg_session_name, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_logout ( + XfsmManager *proxy, + gboolean arg_show_dialog, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_logout_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_logout_sync ( + XfsmManager *proxy, + gboolean arg_show_dialog, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_shutdown ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_shutdown_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_shutdown_sync ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_can_shutdown ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_can_shutdown_finish ( + XfsmManager *proxy, + gboolean *out_can_shutdown, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_can_shutdown_sync ( + XfsmManager *proxy, + gboolean *out_can_shutdown, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_restart ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_restart_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_restart_sync ( + XfsmManager *proxy, + gboolean arg_allow_save, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_can_restart ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_can_restart_finish ( + XfsmManager *proxy, + gboolean *out_can_restart, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_can_restart_sync ( + XfsmManager *proxy, + gboolean *out_can_restart, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_suspend ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_suspend_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_suspend_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_can_suspend ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_can_suspend_finish ( + XfsmManager *proxy, + gboolean *out_can_suspend, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_can_suspend_sync ( + XfsmManager *proxy, + gboolean *out_can_suspend, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_hibernate ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_hibernate_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_hibernate_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_can_hibernate ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_can_hibernate_finish ( + XfsmManager *proxy, + gboolean *out_can_hibernate, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_can_hibernate_sync ( + XfsmManager *proxy, + gboolean *out_can_hibernate, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_hybrid_sleep ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_hybrid_sleep_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_hybrid_sleep_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_can_hybrid_sleep ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_can_hybrid_sleep_finish ( + XfsmManager *proxy, + gboolean *out_can_hybrid_sleep, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_can_hybrid_sleep_sync ( + XfsmManager *proxy, + gboolean *out_can_hybrid_sleep, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_switch_user ( + XfsmManager *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_switch_user_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_switch_user_sync ( + XfsmManager *proxy, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_register_client ( + XfsmManager *proxy, + const gchar *arg_app_id, + const gchar *arg_client_startup_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_register_client_finish ( + XfsmManager *proxy, + gchar **out_client_id, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_register_client_sync ( + XfsmManager *proxy, + const gchar *arg_app_id, + const gchar *arg_client_startup_id, + gchar **out_client_id, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_call_unregister_client ( + XfsmManager *proxy, + const gchar *arg_client_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean xfsm_manager_call_unregister_client_finish ( + XfsmManager *proxy, + GAsyncResult *res, + GError **error); + +gboolean xfsm_manager_call_unregister_client_sync ( + XfsmManager *proxy, + const gchar *arg_client_id, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define XFSM_TYPE_MANAGER_PROXY (xfsm_manager_proxy_get_type ()) +#define XFSM_MANAGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_MANAGER_PROXY, XfsmManagerProxy)) +#define XFSM_MANAGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), XFSM_TYPE_MANAGER_PROXY, XfsmManagerProxyClass)) +#define XFSM_MANAGER_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFSM_TYPE_MANAGER_PROXY, XfsmManagerProxyClass)) +#define XFSM_IS_MANAGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_MANAGER_PROXY)) +#define XFSM_IS_MANAGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFSM_TYPE_MANAGER_PROXY)) + +typedef struct _XfsmManagerProxy XfsmManagerProxy; +typedef struct _XfsmManagerProxyClass XfsmManagerProxyClass; +typedef struct _XfsmManagerProxyPrivate XfsmManagerProxyPrivate; + +struct _XfsmManagerProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + XfsmManagerProxyPrivate *priv; +}; + +struct _XfsmManagerProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType xfsm_manager_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XfsmManagerProxy, g_object_unref) +#endif + +void xfsm_manager_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +XfsmManager *xfsm_manager_proxy_new_finish ( + GAsyncResult *res, + GError **error); +XfsmManager *xfsm_manager_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void xfsm_manager_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +XfsmManager *xfsm_manager_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +XfsmManager *xfsm_manager_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define XFSM_TYPE_MANAGER_SKELETON (xfsm_manager_skeleton_get_type ()) +#define XFSM_MANAGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XFSM_TYPE_MANAGER_SKELETON, XfsmManagerSkeleton)) +#define XFSM_MANAGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), XFSM_TYPE_MANAGER_SKELETON, XfsmManagerSkeletonClass)) +#define XFSM_MANAGER_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XFSM_TYPE_MANAGER_SKELETON, XfsmManagerSkeletonClass)) +#define XFSM_IS_MANAGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XFSM_TYPE_MANAGER_SKELETON)) +#define XFSM_IS_MANAGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XFSM_TYPE_MANAGER_SKELETON)) + +typedef struct _XfsmManagerSkeleton XfsmManagerSkeleton; +typedef struct _XfsmManagerSkeletonClass XfsmManagerSkeletonClass; +typedef struct _XfsmManagerSkeletonPrivate XfsmManagerSkeletonPrivate; + +struct _XfsmManagerSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + XfsmManagerSkeletonPrivate *priv; +}; + +struct _XfsmManagerSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType xfsm_manager_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XfsmManagerSkeleton, g_object_unref) +#endif + +XfsmManager *xfsm_manager_skeleton_new (void); + + +G_END_DECLS + +#endif /* __XFSM_MANAGER_DBUS_CLIENT_H__ */ |