diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 1265 | ||||
-rw-r--r-- | src/familiar-players-db.vala | 164 | ||||
-rw-r--r-- | src/fetch-file.c | 488 | ||||
-rw-r--r-- | src/freedesktop-interfaces.c | 857 | ||||
-rw-r--r-- | src/gen-sound-service.xml.c | 27 | ||||
-rw-r--r-- | src/gen-sound-service.xml.h | 1 | ||||
-rw-r--r-- | src/metadata-menu-item.c | 723 | ||||
-rw-r--r-- | src/mpris2-controller.c | 1391 | ||||
-rw-r--r-- | src/mpris2-interfaces.c | 2601 | ||||
-rw-r--r-- | src/mpris2-watcher.c | 698 | ||||
-rw-r--r-- | src/music-player-bridge.c | 819 | ||||
-rw-r--r-- | src/music-player-bridge.h | 565 | ||||
-rw-r--r-- | src/player-controller.c | 817 | ||||
-rw-r--r-- | src/player-item.c | 496 | ||||
-rw-r--r-- | src/playlists-menu-item.c | 568 | ||||
-rw-r--r-- | src/scrub-menu-item.vala | 56 | ||||
-rw-r--r-- | src/settings-manager.c | 363 | ||||
-rw-r--r-- | src/transport-menu-item.c | 332 |
18 files changed, 12011 insertions, 220 deletions
diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..bfd79c6 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,1265 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +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@ +libexec_PROGRAMS = indicator-sound-service$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +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) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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__installdirs = "$(DESTDIR)$(soundmenulibdir)" \ + "$(DESTDIR)$(libexecdir)" +LTLIBRARIES = $(soundmenulib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libsoundmenu_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libsoundmenu_la_OBJECTS = libsoundmenu_la-indicator-sound.lo \ + libsoundmenu_la-sound-state.lo \ + libsoundmenu_la-sound-state-manager.lo \ + libsoundmenu_la-transport-widget.lo \ + libsoundmenu_la-metadata-widget.lo \ + libsoundmenu_la-mute-widget.lo \ + libsoundmenu_la-volume-widget.lo \ + libsoundmenu_la-voip-input-widget.lo \ + libsoundmenu_la-gen-sound-service.xml.lo +libsoundmenu_la_OBJECTS = $(am_libsoundmenu_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libsoundmenu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libsoundmenu_la_CFLAGS) $(CFLAGS) $(libsoundmenu_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +PROGRAMS = $(libexec_PROGRAMS) +am__objects_1 = indicator_sound_service-music-player-bridge.$(OBJEXT) \ + indicator_sound_service-transport-menu-item.$(OBJEXT) \ + indicator_sound_service-metadata-menu-item.$(OBJEXT) \ + indicator_sound_service-player-controller.$(OBJEXT) \ + indicator_sound_service-mpris2-interfaces.$(OBJEXT) \ + indicator_sound_service-mpris2-watcher.$(OBJEXT) \ + indicator_sound_service-mpris2-controller.$(OBJEXT) \ + indicator_sound_service-player-item.$(OBJEXT) \ + indicator_sound_service-settings-manager.$(OBJEXT) \ + indicator_sound_service-playlists-menu-item.$(OBJEXT) \ + indicator_sound_service-freedesktop-interfaces.$(OBJEXT) \ + indicator_sound_service-fetch-file.$(OBJEXT) +am_indicator_sound_service_OBJECTS = \ + indicator_sound_service-sound-service.$(OBJEXT) \ + indicator_sound_service-sound-state.$(OBJEXT) \ + indicator_sound_service-pulseaudio-mgr.$(OBJEXT) \ + indicator_sound_service-device.$(OBJEXT) \ + indicator_sound_service-sound-service-dbus.$(OBJEXT) \ + indicator_sound_service-slider-menu-item.$(OBJEXT) \ + indicator_sound_service-voip-input-menu-item.$(OBJEXT) \ + indicator_sound_service-mute-menu-item.$(OBJEXT) \ + indicator_sound_service-gen-sound-service.xml.$(OBJEXT) \ + $(am__objects_1) +indicator_sound_service_OBJECTS = \ + $(am_indicator_sound_service_OBJECTS) +indicator_sound_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +indicator_sound_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(indicator_sound_service_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +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_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +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_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libsoundmenu_la_SOURCES) \ + $(indicator_sound_service_SOURCES) +DIST_SOURCES = $(libsoundmenu_la_SOURCES) \ + $(indicator_sound_service_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLET_CFLAGS = @APPLET_CFLAGS@ +APPLET_LIBS = @APPLET_LIBS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUSSERVICEDIR = @DBUSSERVICEDIR@ +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@ +GCONFTOOL = @GCONFTOOL@ +GCONF_CFLAGS = @GCONF_CFLAGS@ +GCONF_LIBS = @GCONF_LIBS@ +GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ +GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMELOCALEDIR = @GNOMELOCALEDIR@ +GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ +INDICATORDIR = @INDICATORDIR@ +INDICATORICONSDIR = @INDICATORICONSDIR@ +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@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +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@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PULSEAUDIO_CFLAGS = @PULSEAUDIO_CFLAGS@ +PULSEAUDIO_LIBS = @PULSEAUDIO_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOUNDSERVICE_CFLAGS = @SOUNDSERVICE_CFLAGS@ +SOUNDSERVICE_LIBS = @SOUNDSERVICE_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VALAC = @VALAC@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +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@ +gsettingsschemadir = @gsettingsschemadir@ +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@ +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@ +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@ + +################### +# Indicator Stuff +################### +soundmenulibdir = $(INDICATORDIR) +soundmenulib_LTLIBRARIES = libsoundmenu.la +libsoundmenu_la_SOURCES = \ + common-defs.h \ + indicator-sound.h \ + indicator-sound.c \ + sound-state.c \ + sound-state.h \ + sound-state-manager.c \ + sound-state-manager.h \ + transport-widget.c \ + transport-widget.h \ + metadata-widget.c \ + metadata-widget.h \ + mute-widget.c \ + mute-widget.h \ + volume-widget.c \ + volume-widget.h \ + voip-input-widget.c \ + voip-input-widget.h \ + gen-sound-service.xml.h \ + gen-sound-service.xml.c \ + dbus-shared-names.h + +libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror -DG_LOG_DOMAIN=\"Indicator-Sound\" +libsoundmenu_la_LIBADD = $(APPLET_LIBS) +libsoundmenu_la_LDFLAGS = -module -avoid-version + +#################################################################### +# Sound Service +#################################################################### + +##################### +# Sound service vala +##################### +music_bridge_VALASOURCES = \ + music-player-bridge.vala \ + transport-menu-item.vala \ + metadata-menu-item.vala \ + player-controller.vala \ + mpris2-interfaces.vala \ + mpris2-watcher.vala \ + mpris2-controller.vala \ + player-item.vala \ + settings-manager.vala \ + playlists-menu-item.vala \ + freedesktop-interfaces.vala \ + fetch-file.vala + +music_bridge_VALAFLAGS = \ + --ccode \ + --disable-dbus-transformation \ + -H music-player-bridge.h -d . \ + --vapidir=$(top_srcdir)/vapi/ \ + --vapidir=./ \ + --thread \ + --pkg gee-1.0 \ + --pkg Dbusmenu-0.4 \ + --pkg common-defs \ + --pkg config \ + --pkg gio-2.0 \ + --pkg gio-unix-2.0 \ + --pkg gdk-pixbuf-2.0 \ + --pkg libxml-2.0 + +music_bridge_APIFILES = \ + music-player-bridge.h + + +############################### +# Sound Service C +############################### +indicator_sound_service_SOURCES = \ + common-defs.h \ + sound-service.h \ + sound-service.c \ + sound-state.c \ + sound-state.h \ + pulseaudio-mgr.h \ + pulseaudio-mgr.c \ + device.c \ + device.h \ + sound-service-dbus.h \ + sound-service-dbus.c \ + slider-menu-item.h \ + slider-menu-item.c \ + voip-input-menu-item.h \ + voip-input-menu-item.c \ + mute-menu-item.h \ + mute-menu-item.c \ + gen-sound-service.xml.h \ + gen-sound-service.xml.c \ + $(music_bridge_VALASOURCES:.vala=.c) + +indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall +indicator_sound_service_LDADD = $(PULSEAUDIO_LIBS) $(SOUNDSERVICE_LIBS) $(GCONF_LIBS) + +######################### +# Service xml compilation +######################### +DBUS_SPECS = \ + sound-service.xml + +EXTRA_DIST = \ + $(DBUS_SPECS) \ + sound-service.xml \ + $(music_bridge_APIFILES) \ + $(music_bridge_VALASOURCES) + + +####################### +# Stuff to clean Stuff +####################### +BUILT_SOURCES = \ + music_bridge_vala.stamp \ + $(music_bridge_APIFILES) \ + gen-sound-service.xml.h \ + gen-sound-service.xml.c \ + $(music_bridge_VALASOURCES:.vala=.c) + +CLEANFILES = \ + $(BUILT_SOURCES) + +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) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: 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__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + 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-soundmenulibLTLIBRARIES: $(soundmenulib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(soundmenulibdir)" || $(MKDIR_P) "$(DESTDIR)$(soundmenulibdir)" + @list='$(soundmenulib_LTLIBRARIES)'; test -n "$(soundmenulibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(soundmenulibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(soundmenulibdir)"; \ + } + +uninstall-soundmenulibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(soundmenulib_LTLIBRARIES)'; test -n "$(soundmenulibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(soundmenulibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(soundmenulibdir)/$$f"; \ + done + +clean-soundmenulibLTLIBRARIES: + -test -z "$(soundmenulib_LTLIBRARIES)" || rm -f $(soundmenulib_LTLIBRARIES) + @list='$(soundmenulib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsoundmenu.la: $(libsoundmenu_la_OBJECTS) $(libsoundmenu_la_DEPENDENCIES) + $(AM_V_CCLD)$(libsoundmenu_la_LINK) -rpath $(soundmenulibdir) $(libsoundmenu_la_OBJECTS) $(libsoundmenu_la_LIBADD) $(LIBS) +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + 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)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || 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)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_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 +indicator-sound-service$(EXEEXT): $(indicator_sound_service_OBJECTS) $(indicator_sound_service_DEPENDENCIES) + @rm -f indicator-sound-service$(EXEEXT) + $(AM_V_CCLD)$(indicator_sound_service_LINK) $(indicator_sound_service_OBJECTS) $(indicator_sound_service_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-fetch-file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-metadata-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mpris2-controller.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mpris2-interfaces.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mpris2-watcher.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-music-player-bridge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mute-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-player-controller.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-player-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-playlists-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-settings-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-slider-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-sound-service-dbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-sound-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-sound-state.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-transport-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-voip-input-menu-item.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-gen-sound-service.xml.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-indicator-sound.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-metadata-widget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-mute-widget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-sound-state-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-sound-state.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-transport-widget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-voip-input-widget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-volume-widget.Plo@am__quote@ + +.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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libsoundmenu_la-indicator-sound.lo: indicator-sound.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-indicator-sound.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-indicator-sound.Tpo -c -o libsoundmenu_la-indicator-sound.lo `test -f 'indicator-sound.c' || echo '$(srcdir)/'`indicator-sound.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-indicator-sound.Tpo $(DEPDIR)/libsoundmenu_la-indicator-sound.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='indicator-sound.c' object='libsoundmenu_la-indicator-sound.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-indicator-sound.lo `test -f 'indicator-sound.c' || echo '$(srcdir)/'`indicator-sound.c + +libsoundmenu_la-sound-state.lo: sound-state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-sound-state.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-sound-state.Tpo -c -o libsoundmenu_la-sound-state.lo `test -f 'sound-state.c' || echo '$(srcdir)/'`sound-state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-sound-state.Tpo $(DEPDIR)/libsoundmenu_la-sound-state.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-state.c' object='libsoundmenu_la-sound-state.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-sound-state.lo `test -f 'sound-state.c' || echo '$(srcdir)/'`sound-state.c + +libsoundmenu_la-sound-state-manager.lo: sound-state-manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-sound-state-manager.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-sound-state-manager.Tpo -c -o libsoundmenu_la-sound-state-manager.lo `test -f 'sound-state-manager.c' || echo '$(srcdir)/'`sound-state-manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-sound-state-manager.Tpo $(DEPDIR)/libsoundmenu_la-sound-state-manager.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-state-manager.c' object='libsoundmenu_la-sound-state-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-sound-state-manager.lo `test -f 'sound-state-manager.c' || echo '$(srcdir)/'`sound-state-manager.c + +libsoundmenu_la-transport-widget.lo: transport-widget.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-transport-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-transport-widget.Tpo -c -o libsoundmenu_la-transport-widget.lo `test -f 'transport-widget.c' || echo '$(srcdir)/'`transport-widget.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-transport-widget.Tpo $(DEPDIR)/libsoundmenu_la-transport-widget.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-widget.c' object='libsoundmenu_la-transport-widget.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-transport-widget.lo `test -f 'transport-widget.c' || echo '$(srcdir)/'`transport-widget.c + +libsoundmenu_la-metadata-widget.lo: metadata-widget.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-metadata-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-metadata-widget.Tpo -c -o libsoundmenu_la-metadata-widget.lo `test -f 'metadata-widget.c' || echo '$(srcdir)/'`metadata-widget.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-metadata-widget.Tpo $(DEPDIR)/libsoundmenu_la-metadata-widget.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-widget.c' object='libsoundmenu_la-metadata-widget.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-metadata-widget.lo `test -f 'metadata-widget.c' || echo '$(srcdir)/'`metadata-widget.c + +libsoundmenu_la-mute-widget.lo: mute-widget.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-mute-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-mute-widget.Tpo -c -o libsoundmenu_la-mute-widget.lo `test -f 'mute-widget.c' || echo '$(srcdir)/'`mute-widget.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-mute-widget.Tpo $(DEPDIR)/libsoundmenu_la-mute-widget.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mute-widget.c' object='libsoundmenu_la-mute-widget.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-mute-widget.lo `test -f 'mute-widget.c' || echo '$(srcdir)/'`mute-widget.c + +libsoundmenu_la-volume-widget.lo: volume-widget.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-volume-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-volume-widget.Tpo -c -o libsoundmenu_la-volume-widget.lo `test -f 'volume-widget.c' || echo '$(srcdir)/'`volume-widget.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-volume-widget.Tpo $(DEPDIR)/libsoundmenu_la-volume-widget.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='volume-widget.c' object='libsoundmenu_la-volume-widget.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-volume-widget.lo `test -f 'volume-widget.c' || echo '$(srcdir)/'`volume-widget.c + +libsoundmenu_la-voip-input-widget.lo: voip-input-widget.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-voip-input-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-voip-input-widget.Tpo -c -o libsoundmenu_la-voip-input-widget.lo `test -f 'voip-input-widget.c' || echo '$(srcdir)/'`voip-input-widget.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-voip-input-widget.Tpo $(DEPDIR)/libsoundmenu_la-voip-input-widget.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='voip-input-widget.c' object='libsoundmenu_la-voip-input-widget.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-voip-input-widget.lo `test -f 'voip-input-widget.c' || echo '$(srcdir)/'`voip-input-widget.c + +libsoundmenu_la-gen-sound-service.xml.lo: gen-sound-service.xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-gen-sound-service.xml.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-gen-sound-service.xml.Tpo -c -o libsoundmenu_la-gen-sound-service.xml.lo `test -f 'gen-sound-service.xml.c' || echo '$(srcdir)/'`gen-sound-service.xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-gen-sound-service.xml.Tpo $(DEPDIR)/libsoundmenu_la-gen-sound-service.xml.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gen-sound-service.xml.c' object='libsoundmenu_la-gen-sound-service.xml.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-gen-sound-service.xml.lo `test -f 'gen-sound-service.xml.c' || echo '$(srcdir)/'`gen-sound-service.xml.c + +indicator_sound_service-sound-service.o: sound-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service.Tpo -c -o indicator_sound_service-sound-service.o `test -f 'sound-service.c' || echo '$(srcdir)/'`sound-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service.Tpo $(DEPDIR)/indicator_sound_service-sound-service.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service.c' object='indicator_sound_service-sound-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service.o `test -f 'sound-service.c' || echo '$(srcdir)/'`sound-service.c + +indicator_sound_service-sound-service.obj: sound-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service.Tpo -c -o indicator_sound_service-sound-service.obj `if test -f 'sound-service.c'; then $(CYGPATH_W) 'sound-service.c'; else $(CYGPATH_W) '$(srcdir)/sound-service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service.Tpo $(DEPDIR)/indicator_sound_service-sound-service.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service.c' object='indicator_sound_service-sound-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service.obj `if test -f 'sound-service.c'; then $(CYGPATH_W) 'sound-service.c'; else $(CYGPATH_W) '$(srcdir)/sound-service.c'; fi` + +indicator_sound_service-sound-state.o: sound-state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-state.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-state.Tpo -c -o indicator_sound_service-sound-state.o `test -f 'sound-state.c' || echo '$(srcdir)/'`sound-state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-state.Tpo $(DEPDIR)/indicator_sound_service-sound-state.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-state.c' object='indicator_sound_service-sound-state.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-state.o `test -f 'sound-state.c' || echo '$(srcdir)/'`sound-state.c + +indicator_sound_service-sound-state.obj: sound-state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-state.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-state.Tpo -c -o indicator_sound_service-sound-state.obj `if test -f 'sound-state.c'; then $(CYGPATH_W) 'sound-state.c'; else $(CYGPATH_W) '$(srcdir)/sound-state.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-state.Tpo $(DEPDIR)/indicator_sound_service-sound-state.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-state.c' object='indicator_sound_service-sound-state.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-state.obj `if test -f 'sound-state.c'; then $(CYGPATH_W) 'sound-state.c'; else $(CYGPATH_W) '$(srcdir)/sound-state.c'; fi` + +indicator_sound_service-pulseaudio-mgr.o: pulseaudio-mgr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-pulseaudio-mgr.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Tpo -c -o indicator_sound_service-pulseaudio-mgr.o `test -f 'pulseaudio-mgr.c' || echo '$(srcdir)/'`pulseaudio-mgr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Tpo $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pulseaudio-mgr.c' object='indicator_sound_service-pulseaudio-mgr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-pulseaudio-mgr.o `test -f 'pulseaudio-mgr.c' || echo '$(srcdir)/'`pulseaudio-mgr.c + +indicator_sound_service-pulseaudio-mgr.obj: pulseaudio-mgr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-pulseaudio-mgr.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Tpo -c -o indicator_sound_service-pulseaudio-mgr.obj `if test -f 'pulseaudio-mgr.c'; then $(CYGPATH_W) 'pulseaudio-mgr.c'; else $(CYGPATH_W) '$(srcdir)/pulseaudio-mgr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Tpo $(DEPDIR)/indicator_sound_service-pulseaudio-mgr.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pulseaudio-mgr.c' object='indicator_sound_service-pulseaudio-mgr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-pulseaudio-mgr.obj `if test -f 'pulseaudio-mgr.c'; then $(CYGPATH_W) 'pulseaudio-mgr.c'; else $(CYGPATH_W) '$(srcdir)/pulseaudio-mgr.c'; fi` + +indicator_sound_service-device.o: device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-device.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-device.Tpo -c -o indicator_sound_service-device.o `test -f 'device.c' || echo '$(srcdir)/'`device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-device.Tpo $(DEPDIR)/indicator_sound_service-device.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='device.c' object='indicator_sound_service-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-device.o `test -f 'device.c' || echo '$(srcdir)/'`device.c + +indicator_sound_service-device.obj: device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-device.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-device.Tpo -c -o indicator_sound_service-device.obj `if test -f 'device.c'; then $(CYGPATH_W) 'device.c'; else $(CYGPATH_W) '$(srcdir)/device.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-device.Tpo $(DEPDIR)/indicator_sound_service-device.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='device.c' object='indicator_sound_service-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-device.obj `if test -f 'device.c'; then $(CYGPATH_W) 'device.c'; else $(CYGPATH_W) '$(srcdir)/device.c'; fi` + +indicator_sound_service-sound-service-dbus.o: sound-service-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service-dbus.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo -c -o indicator_sound_service-sound-service-dbus.o `test -f 'sound-service-dbus.c' || echo '$(srcdir)/'`sound-service-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo $(DEPDIR)/indicator_sound_service-sound-service-dbus.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service-dbus.c' object='indicator_sound_service-sound-service-dbus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service-dbus.o `test -f 'sound-service-dbus.c' || echo '$(srcdir)/'`sound-service-dbus.c + +indicator_sound_service-sound-service-dbus.obj: sound-service-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service-dbus.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo -c -o indicator_sound_service-sound-service-dbus.obj `if test -f 'sound-service-dbus.c'; then $(CYGPATH_W) 'sound-service-dbus.c'; else $(CYGPATH_W) '$(srcdir)/sound-service-dbus.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo $(DEPDIR)/indicator_sound_service-sound-service-dbus.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service-dbus.c' object='indicator_sound_service-sound-service-dbus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service-dbus.obj `if test -f 'sound-service-dbus.c'; then $(CYGPATH_W) 'sound-service-dbus.c'; else $(CYGPATH_W) '$(srcdir)/sound-service-dbus.c'; fi` + +indicator_sound_service-slider-menu-item.o: slider-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-slider-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo -c -o indicator_sound_service-slider-menu-item.o `test -f 'slider-menu-item.c' || echo '$(srcdir)/'`slider-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo $(DEPDIR)/indicator_sound_service-slider-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slider-menu-item.c' object='indicator_sound_service-slider-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-slider-menu-item.o `test -f 'slider-menu-item.c' || echo '$(srcdir)/'`slider-menu-item.c + +indicator_sound_service-slider-menu-item.obj: slider-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-slider-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo -c -o indicator_sound_service-slider-menu-item.obj `if test -f 'slider-menu-item.c'; then $(CYGPATH_W) 'slider-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/slider-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo $(DEPDIR)/indicator_sound_service-slider-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slider-menu-item.c' object='indicator_sound_service-slider-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-slider-menu-item.obj `if test -f 'slider-menu-item.c'; then $(CYGPATH_W) 'slider-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/slider-menu-item.c'; fi` + +indicator_sound_service-voip-input-menu-item.o: voip-input-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-voip-input-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Tpo -c -o indicator_sound_service-voip-input-menu-item.o `test -f 'voip-input-menu-item.c' || echo '$(srcdir)/'`voip-input-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Tpo $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='voip-input-menu-item.c' object='indicator_sound_service-voip-input-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-voip-input-menu-item.o `test -f 'voip-input-menu-item.c' || echo '$(srcdir)/'`voip-input-menu-item.c + +indicator_sound_service-voip-input-menu-item.obj: voip-input-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-voip-input-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Tpo -c -o indicator_sound_service-voip-input-menu-item.obj `if test -f 'voip-input-menu-item.c'; then $(CYGPATH_W) 'voip-input-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/voip-input-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Tpo $(DEPDIR)/indicator_sound_service-voip-input-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='voip-input-menu-item.c' object='indicator_sound_service-voip-input-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-voip-input-menu-item.obj `if test -f 'voip-input-menu-item.c'; then $(CYGPATH_W) 'voip-input-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/voip-input-menu-item.c'; fi` + +indicator_sound_service-mute-menu-item.o: mute-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mute-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mute-menu-item.Tpo -c -o indicator_sound_service-mute-menu-item.o `test -f 'mute-menu-item.c' || echo '$(srcdir)/'`mute-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mute-menu-item.Tpo $(DEPDIR)/indicator_sound_service-mute-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mute-menu-item.c' object='indicator_sound_service-mute-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mute-menu-item.o `test -f 'mute-menu-item.c' || echo '$(srcdir)/'`mute-menu-item.c + +indicator_sound_service-mute-menu-item.obj: mute-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mute-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mute-menu-item.Tpo -c -o indicator_sound_service-mute-menu-item.obj `if test -f 'mute-menu-item.c'; then $(CYGPATH_W) 'mute-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/mute-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mute-menu-item.Tpo $(DEPDIR)/indicator_sound_service-mute-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mute-menu-item.c' object='indicator_sound_service-mute-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mute-menu-item.obj `if test -f 'mute-menu-item.c'; then $(CYGPATH_W) 'mute-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/mute-menu-item.c'; fi` + +indicator_sound_service-gen-sound-service.xml.o: gen-sound-service.xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-gen-sound-service.xml.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Tpo -c -o indicator_sound_service-gen-sound-service.xml.o `test -f 'gen-sound-service.xml.c' || echo '$(srcdir)/'`gen-sound-service.xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Tpo $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gen-sound-service.xml.c' object='indicator_sound_service-gen-sound-service.xml.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-gen-sound-service.xml.o `test -f 'gen-sound-service.xml.c' || echo '$(srcdir)/'`gen-sound-service.xml.c + +indicator_sound_service-gen-sound-service.xml.obj: gen-sound-service.xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-gen-sound-service.xml.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Tpo -c -o indicator_sound_service-gen-sound-service.xml.obj `if test -f 'gen-sound-service.xml.c'; then $(CYGPATH_W) 'gen-sound-service.xml.c'; else $(CYGPATH_W) '$(srcdir)/gen-sound-service.xml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Tpo $(DEPDIR)/indicator_sound_service-gen-sound-service.xml.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gen-sound-service.xml.c' object='indicator_sound_service-gen-sound-service.xml.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-gen-sound-service.xml.obj `if test -f 'gen-sound-service.xml.c'; then $(CYGPATH_W) 'gen-sound-service.xml.c'; else $(CYGPATH_W) '$(srcdir)/gen-sound-service.xml.c'; fi` + +indicator_sound_service-music-player-bridge.o: music-player-bridge.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-music-player-bridge.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo -c -o indicator_sound_service-music-player-bridge.o `test -f 'music-player-bridge.c' || echo '$(srcdir)/'`music-player-bridge.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo $(DEPDIR)/indicator_sound_service-music-player-bridge.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='music-player-bridge.c' object='indicator_sound_service-music-player-bridge.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-music-player-bridge.o `test -f 'music-player-bridge.c' || echo '$(srcdir)/'`music-player-bridge.c + +indicator_sound_service-music-player-bridge.obj: music-player-bridge.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-music-player-bridge.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo -c -o indicator_sound_service-music-player-bridge.obj `if test -f 'music-player-bridge.c'; then $(CYGPATH_W) 'music-player-bridge.c'; else $(CYGPATH_W) '$(srcdir)/music-player-bridge.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo $(DEPDIR)/indicator_sound_service-music-player-bridge.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='music-player-bridge.c' object='indicator_sound_service-music-player-bridge.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-music-player-bridge.obj `if test -f 'music-player-bridge.c'; then $(CYGPATH_W) 'music-player-bridge.c'; else $(CYGPATH_W) '$(srcdir)/music-player-bridge.c'; fi` + +indicator_sound_service-transport-menu-item.o: transport-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-transport-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo -c -o indicator_sound_service-transport-menu-item.o `test -f 'transport-menu-item.c' || echo '$(srcdir)/'`transport-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo $(DEPDIR)/indicator_sound_service-transport-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-menu-item.c' object='indicator_sound_service-transport-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-transport-menu-item.o `test -f 'transport-menu-item.c' || echo '$(srcdir)/'`transport-menu-item.c + +indicator_sound_service-transport-menu-item.obj: transport-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-transport-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo -c -o indicator_sound_service-transport-menu-item.obj `if test -f 'transport-menu-item.c'; then $(CYGPATH_W) 'transport-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/transport-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo $(DEPDIR)/indicator_sound_service-transport-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-menu-item.c' object='indicator_sound_service-transport-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-transport-menu-item.obj `if test -f 'transport-menu-item.c'; then $(CYGPATH_W) 'transport-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/transport-menu-item.c'; fi` + +indicator_sound_service-metadata-menu-item.o: metadata-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-metadata-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo -c -o indicator_sound_service-metadata-menu-item.o `test -f 'metadata-menu-item.c' || echo '$(srcdir)/'`metadata-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo $(DEPDIR)/indicator_sound_service-metadata-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-menu-item.c' object='indicator_sound_service-metadata-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-metadata-menu-item.o `test -f 'metadata-menu-item.c' || echo '$(srcdir)/'`metadata-menu-item.c + +indicator_sound_service-metadata-menu-item.obj: metadata-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-metadata-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo -c -o indicator_sound_service-metadata-menu-item.obj `if test -f 'metadata-menu-item.c'; then $(CYGPATH_W) 'metadata-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/metadata-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo $(DEPDIR)/indicator_sound_service-metadata-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-menu-item.c' object='indicator_sound_service-metadata-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-metadata-menu-item.obj `if test -f 'metadata-menu-item.c'; then $(CYGPATH_W) 'metadata-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/metadata-menu-item.c'; fi` + +indicator_sound_service-player-controller.o: player-controller.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-controller.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-controller.Tpo -c -o indicator_sound_service-player-controller.o `test -f 'player-controller.c' || echo '$(srcdir)/'`player-controller.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-controller.Tpo $(DEPDIR)/indicator_sound_service-player-controller.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-controller.c' object='indicator_sound_service-player-controller.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-controller.o `test -f 'player-controller.c' || echo '$(srcdir)/'`player-controller.c + +indicator_sound_service-player-controller.obj: player-controller.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-controller.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-controller.Tpo -c -o indicator_sound_service-player-controller.obj `if test -f 'player-controller.c'; then $(CYGPATH_W) 'player-controller.c'; else $(CYGPATH_W) '$(srcdir)/player-controller.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-controller.Tpo $(DEPDIR)/indicator_sound_service-player-controller.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-controller.c' object='indicator_sound_service-player-controller.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-controller.obj `if test -f 'player-controller.c'; then $(CYGPATH_W) 'player-controller.c'; else $(CYGPATH_W) '$(srcdir)/player-controller.c'; fi` + +indicator_sound_service-mpris2-interfaces.o: mpris2-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-interfaces.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Tpo -c -o indicator_sound_service-mpris2-interfaces.o `test -f 'mpris2-interfaces.c' || echo '$(srcdir)/'`mpris2-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Tpo $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-interfaces.c' object='indicator_sound_service-mpris2-interfaces.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-interfaces.o `test -f 'mpris2-interfaces.c' || echo '$(srcdir)/'`mpris2-interfaces.c + +indicator_sound_service-mpris2-interfaces.obj: mpris2-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-interfaces.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Tpo -c -o indicator_sound_service-mpris2-interfaces.obj `if test -f 'mpris2-interfaces.c'; then $(CYGPATH_W) 'mpris2-interfaces.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-interfaces.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Tpo $(DEPDIR)/indicator_sound_service-mpris2-interfaces.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-interfaces.c' object='indicator_sound_service-mpris2-interfaces.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-interfaces.obj `if test -f 'mpris2-interfaces.c'; then $(CYGPATH_W) 'mpris2-interfaces.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-interfaces.c'; fi` + +indicator_sound_service-mpris2-watcher.o: mpris2-watcher.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-watcher.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-watcher.Tpo -c -o indicator_sound_service-mpris2-watcher.o `test -f 'mpris2-watcher.c' || echo '$(srcdir)/'`mpris2-watcher.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-watcher.Tpo $(DEPDIR)/indicator_sound_service-mpris2-watcher.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-watcher.c' object='indicator_sound_service-mpris2-watcher.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-watcher.o `test -f 'mpris2-watcher.c' || echo '$(srcdir)/'`mpris2-watcher.c + +indicator_sound_service-mpris2-watcher.obj: mpris2-watcher.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-watcher.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-watcher.Tpo -c -o indicator_sound_service-mpris2-watcher.obj `if test -f 'mpris2-watcher.c'; then $(CYGPATH_W) 'mpris2-watcher.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-watcher.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-watcher.Tpo $(DEPDIR)/indicator_sound_service-mpris2-watcher.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-watcher.c' object='indicator_sound_service-mpris2-watcher.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-watcher.obj `if test -f 'mpris2-watcher.c'; then $(CYGPATH_W) 'mpris2-watcher.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-watcher.c'; fi` + +indicator_sound_service-mpris2-controller.o: mpris2-controller.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-controller.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-controller.Tpo -c -o indicator_sound_service-mpris2-controller.o `test -f 'mpris2-controller.c' || echo '$(srcdir)/'`mpris2-controller.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-controller.Tpo $(DEPDIR)/indicator_sound_service-mpris2-controller.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-controller.c' object='indicator_sound_service-mpris2-controller.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-controller.o `test -f 'mpris2-controller.c' || echo '$(srcdir)/'`mpris2-controller.c + +indicator_sound_service-mpris2-controller.obj: mpris2-controller.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris2-controller.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris2-controller.Tpo -c -o indicator_sound_service-mpris2-controller.obj `if test -f 'mpris2-controller.c'; then $(CYGPATH_W) 'mpris2-controller.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-controller.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris2-controller.Tpo $(DEPDIR)/indicator_sound_service-mpris2-controller.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris2-controller.c' object='indicator_sound_service-mpris2-controller.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris2-controller.obj `if test -f 'mpris2-controller.c'; then $(CYGPATH_W) 'mpris2-controller.c'; else $(CYGPATH_W) '$(srcdir)/mpris2-controller.c'; fi` + +indicator_sound_service-player-item.o: player-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-item.Tpo -c -o indicator_sound_service-player-item.o `test -f 'player-item.c' || echo '$(srcdir)/'`player-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-item.Tpo $(DEPDIR)/indicator_sound_service-player-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-item.c' object='indicator_sound_service-player-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-item.o `test -f 'player-item.c' || echo '$(srcdir)/'`player-item.c + +indicator_sound_service-player-item.obj: player-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-item.Tpo -c -o indicator_sound_service-player-item.obj `if test -f 'player-item.c'; then $(CYGPATH_W) 'player-item.c'; else $(CYGPATH_W) '$(srcdir)/player-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-item.Tpo $(DEPDIR)/indicator_sound_service-player-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-item.c' object='indicator_sound_service-player-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-item.obj `if test -f 'player-item.c'; then $(CYGPATH_W) 'player-item.c'; else $(CYGPATH_W) '$(srcdir)/player-item.c'; fi` + +indicator_sound_service-settings-manager.o: settings-manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-settings-manager.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-settings-manager.Tpo -c -o indicator_sound_service-settings-manager.o `test -f 'settings-manager.c' || echo '$(srcdir)/'`settings-manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-settings-manager.Tpo $(DEPDIR)/indicator_sound_service-settings-manager.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings-manager.c' object='indicator_sound_service-settings-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-settings-manager.o `test -f 'settings-manager.c' || echo '$(srcdir)/'`settings-manager.c + +indicator_sound_service-settings-manager.obj: settings-manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-settings-manager.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-settings-manager.Tpo -c -o indicator_sound_service-settings-manager.obj `if test -f 'settings-manager.c'; then $(CYGPATH_W) 'settings-manager.c'; else $(CYGPATH_W) '$(srcdir)/settings-manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-settings-manager.Tpo $(DEPDIR)/indicator_sound_service-settings-manager.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings-manager.c' object='indicator_sound_service-settings-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-settings-manager.obj `if test -f 'settings-manager.c'; then $(CYGPATH_W) 'settings-manager.c'; else $(CYGPATH_W) '$(srcdir)/settings-manager.c'; fi` + +indicator_sound_service-playlists-menu-item.o: playlists-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-playlists-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-playlists-menu-item.Tpo -c -o indicator_sound_service-playlists-menu-item.o `test -f 'playlists-menu-item.c' || echo '$(srcdir)/'`playlists-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-playlists-menu-item.Tpo $(DEPDIR)/indicator_sound_service-playlists-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='playlists-menu-item.c' object='indicator_sound_service-playlists-menu-item.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-playlists-menu-item.o `test -f 'playlists-menu-item.c' || echo '$(srcdir)/'`playlists-menu-item.c + +indicator_sound_service-playlists-menu-item.obj: playlists-menu-item.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-playlists-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-playlists-menu-item.Tpo -c -o indicator_sound_service-playlists-menu-item.obj `if test -f 'playlists-menu-item.c'; then $(CYGPATH_W) 'playlists-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/playlists-menu-item.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-playlists-menu-item.Tpo $(DEPDIR)/indicator_sound_service-playlists-menu-item.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='playlists-menu-item.c' object='indicator_sound_service-playlists-menu-item.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-playlists-menu-item.obj `if test -f 'playlists-menu-item.c'; then $(CYGPATH_W) 'playlists-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/playlists-menu-item.c'; fi` + +indicator_sound_service-freedesktop-interfaces.o: freedesktop-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-freedesktop-interfaces.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Tpo -c -o indicator_sound_service-freedesktop-interfaces.o `test -f 'freedesktop-interfaces.c' || echo '$(srcdir)/'`freedesktop-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Tpo $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='freedesktop-interfaces.c' object='indicator_sound_service-freedesktop-interfaces.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-freedesktop-interfaces.o `test -f 'freedesktop-interfaces.c' || echo '$(srcdir)/'`freedesktop-interfaces.c + +indicator_sound_service-freedesktop-interfaces.obj: freedesktop-interfaces.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-freedesktop-interfaces.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Tpo -c -o indicator_sound_service-freedesktop-interfaces.obj `if test -f 'freedesktop-interfaces.c'; then $(CYGPATH_W) 'freedesktop-interfaces.c'; else $(CYGPATH_W) '$(srcdir)/freedesktop-interfaces.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Tpo $(DEPDIR)/indicator_sound_service-freedesktop-interfaces.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='freedesktop-interfaces.c' object='indicator_sound_service-freedesktop-interfaces.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-freedesktop-interfaces.obj `if test -f 'freedesktop-interfaces.c'; then $(CYGPATH_W) 'freedesktop-interfaces.c'; else $(CYGPATH_W) '$(srcdir)/freedesktop-interfaces.c'; fi` + +indicator_sound_service-fetch-file.o: fetch-file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-fetch-file.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-fetch-file.Tpo -c -o indicator_sound_service-fetch-file.o `test -f 'fetch-file.c' || echo '$(srcdir)/'`fetch-file.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-fetch-file.Tpo $(DEPDIR)/indicator_sound_service-fetch-file.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch-file.c' object='indicator_sound_service-fetch-file.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-fetch-file.o `test -f 'fetch-file.c' || echo '$(srcdir)/'`fetch-file.c + +indicator_sound_service-fetch-file.obj: fetch-file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-fetch-file.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-fetch-file.Tpo -c -o indicator_sound_service-fetch-file.obj `if test -f 'fetch-file.c'; then $(CYGPATH_W) 'fetch-file.c'; else $(CYGPATH_W) '$(srcdir)/fetch-file.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-fetch-file.Tpo $(DEPDIR)/indicator_sound_service-fetch-file.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch-file.c' object='indicator_sound_service-fetch-file.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-fetch-file.obj `if test -f 'fetch-file.c'; then $(CYGPATH_W) 'fetch-file.c'; else $(CYGPATH_W) '$(srcdir)/fetch-file.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(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 $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(soundmenulibdir)" "$(DESTDIR)$(libexecdir)"; 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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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) + +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-generic clean-libexecPROGRAMS clean-libtool \ + clean-soundmenulibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -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-soundmenulibLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libexecPROGRAMS + +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 -rf ./$(DEPDIR) + -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-libexecPROGRAMS \ + uninstall-soundmenulibLTLIBRARIES + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS clean-libtool \ + clean-soundmenulibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libexecPROGRAMS install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-soundmenulibLTLIBRARIES \ + 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 uninstall uninstall-am \ + uninstall-libexecPROGRAMS uninstall-soundmenulibLTLIBRARIES + + +checkxml: $(srcdir)/sound-service.xml + @xmllint -valid -noout $< + @echo $< checks out ok + + $(MAINTAINER_VALAFLAGS) + +music_bridge_vala.stamp $(music_bridge_APIFILES): $(music_bridge_VALASOURCES) + $(AM_V_GEN) $(VALAC) $(music_bridge_VALAFLAGS) $^ + touch music_bridge_vala.stamp + +gen-%.xml.h: %.xml + @echo "Building $@ from $<" + @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@ + +gen-%.xml.c: %.xml + @echo "Building $@ from $<" + @echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@ + @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ + @echo ";" >> $@ + +# 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/src/familiar-players-db.vala b/src/familiar-players-db.vala deleted file mode 100644 index 96d690a..0000000 --- a/src/familiar-players-db.vala +++ /dev/null @@ -1,164 +0,0 @@ -/* -Copyright 2010 Canonical Ltd. - -Authors: - Conor Curran <conor.curran@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. -*/ - -using Gee; -using GLib.Path; -using GLib.DirUtils; -using GLib.FileUtils; -using GLib.Timeout; -using GLib.Environment; - -// TODO: more refactoring needed here -public class FamiliarPlayersDB : GLib.Object -{ - private const string GROUP_NAME = "Seen Database"; - private const string KEY_NAME = "DesktopFiles"; - private const string DEFAULT_APP_DESKTOP = "/usr/share/applications/banshee-1.desktop"; - private HashMap<string, bool> players_DB; - private string file_name; - private string dir_name; - private KeyFile key_file; - private uint write_id; - - public FamiliarPlayersDB() - { - this.write_id = 0; - this.players_DB = new HashMap<string, bool>(); - if ( !create_key_file() ){ - this.players_DB.set(DEFAULT_APP_DESKTOP, true); - this.write_db(); - } - - this.dir_name = build_filename(get_user_cache_dir(), "indicators", "sound"); - this.file_name = build_filename(this.dir_name, "familiar-players-db.keyfile"); - if(create_key_file() && check_for_keys() && load_data_from_key_file()){ - debug("keyfiles in place and ready for action"); - } - else{ - this.key_file = null; - warning("FamiliarPlayersDB:: problems loading key file - can't go any further"); - } - } - - private bool create_key_file(){ - bool result = false; - if (test(this.file_name, GLib.FileTest.EXISTS)) { - this.key_file = new KeyFile(); - try{ - result = this.key_file.load_from_file(this.file_name, KeyFileFlags.NONE); - } - catch(GLib.KeyFileError e){ - warning("FamiliarPlayersDB::create_key_file() - KeyFileError"); - } - catch(GLib.FileError e){ - warning("FamiliarPlayersDB::create_key_file() - FileError"); - } - } - return result; - } - - private bool check_for_keys(){ - try{ - if(this.key_file.has_key(GROUP_NAME, KEY_NAME) == true){ - return true; - } - } - catch(KeyFileError e){ - return false; - } - warning("Seen DB '%s' does not have key '%s' in group '%s'", this.file_name, KEY_NAME, GROUP_NAME); - return false; - } - - private bool load_data_from_key_file(){ - try{ - string[] desktops = this.key_file.get_string_list(GROUP_NAME, - KEY_NAME); - foreach(string s in desktops){ - this.players_DB.set(s, true); - } - return true; - } - catch(GLib.KeyFileError error){ - warning("Error loading the Desktop string list"); - return false; - } - } - - private bool write_db() - { - KeyFile keyfile = new KeyFile(); - string[] desktops = {}; - foreach(string key in this.players_DB.keys){ - desktops += key; - } - keyfile.set_string_list(GROUP_NAME, - KEY_NAME, - desktops); - size_t data_length; - string data = null; - try{ - data = keyfile.to_data(out data_length); - } - catch(GLib.KeyFileError e){ - warning("Problems dumping keyfile to a string"); - return false; - } - - if(create_with_parents(this.dir_name, 0700) != 0){ - warning("Unable to make directory: %s", this.dir_name); - return false; - } - - try{ - if(set_contents(this.file_name, data, (ssize_t)data_length) == false){ - warning("Unable to write out file '%s'", this.file_name); - } - } - catch(FileError err){ - warning("Unable to write out file '%s'", this.file_name); - } - return true; - } - - public void insert(string desktop) - { - if(already_familiar(desktop) == false){ - if(this.write_id != 0){ - Source.remove(this.write_id); - this.write_id = 0; - } - this.write_id = Timeout.add_seconds(60, write_db); - this.players_DB.set(desktop.dup(), true); - } - } - - public bool already_familiar(string desktop) - { - debug("playerDB->already_familiar - result %s", this.players_DB.keys.contains(desktop).to_string()); - return this.players_DB.keys.contains(desktop); - } - - public Gee.Set<string> records() - { - return this.players_DB.keys; - } - - -}
\ No newline at end of file diff --git a/src/fetch-file.c b/src/fetch-file.c new file mode 100644 index 0000000..401c53f --- /dev/null +++ b/src/fetch-file.c @@ -0,0 +1,488 @@ +/* fetch-file.c generated by valac 0.12.1, the Vala compiler + * generated from fetch-file.vala, do not modify */ + +/* + * Copyright (C) 2010 Canonical, Ltd. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License + * version 3.0 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3.0 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + * + * Authors + * Gordon Allott <gord.allott@canonical.com> + * Conor Curran <conor.curran@canonical.com> + */ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <gio/gio.h> + + +#define TYPE_FETCH_FILE (fetch_file_get_type ()) +#define FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FETCH_FILE, FetchFile)) +#define FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FETCH_FILE, FetchFileClass)) +#define IS_FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FETCH_FILE)) +#define IS_FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FETCH_FILE)) +#define FETCH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FETCH_FILE, FetchFileClass)) + +typedef struct _FetchFile FetchFile; +typedef struct _FetchFileClass FetchFileClass; +typedef struct _FetchFilePrivate FetchFilePrivate; +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_byte_array_free0(var) ((var == NULL) ? NULL : (var = (g_byte_array_free (var, TRUE), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +typedef struct _FetchFileFetchDataData FetchFileFetchDataData; +typedef struct _FetchFileReadSomethingAsyncData FetchFileReadSomethingAsyncData; + +struct _FetchFile { + GObject parent_instance; + FetchFilePrivate * priv; +}; + +struct _FetchFileClass { + GObjectClass parent_class; +}; + +struct _FetchFilePrivate { + gchar* _uri; + gchar* _intended_property; + GDataInputStream* stream; + GFile* file; + GByteArray* data; +}; + +struct _FetchFileFetchDataData { + int _state_; + GObject* _source_object_; + GAsyncResult* _res_; + GSimpleAsyncResult* _async_result; + FetchFile* self; + GFileInputStream* _tmp0_; + GFileInputStream* _tmp1_; + GFileInputStream* _tmp2_; + GDataInputStream* _tmp3_; + GError * e; + GError * _inner_error_; +}; + +struct _FetchFileReadSomethingAsyncData { + int _state_; + GObject* _source_object_; + GAsyncResult* _res_; + GSimpleAsyncResult* _async_result; + FetchFile* self; + gssize size; + guint8* _tmp0_; + guint8* buffer; + gint buffer_length1; + gint _buffer_size_; + gssize bufsize; + gboolean _tmp1_; + gssize _tmp2_; + gssize _tmp3_; + guint8* _tmp4_; + guint8* cpybuf; + gint cpybuf_length1; + gint _cpybuf_size_; + GError * e; + GError * _inner_error_; +}; + + +static gpointer fetch_file_parent_class = NULL; + +GType fetch_file_get_type (void) G_GNUC_CONST; +#define FETCH_FILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FETCH_FILE, FetchFilePrivate)) +enum { + FETCH_FILE_DUMMY_PROPERTY, + FETCH_FILE_URI, + FETCH_FILE_INTENDED_PROPERTY +}; +FetchFile* fetch_file_new (const gchar* uri, const gchar* prop); +FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop); +static void fetch_file_fetch_data_data_free (gpointer _data); +void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_); +static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data); +static void fetch_file_read_something_async (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _res_); +static void fetch_file_read_something_async_data_free (gpointer _data); +static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* data); +static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); +const gchar* fetch_file_get_intended_property (FetchFile* self); +const gchar* fetch_file_get_uri (FetchFile* self); +static void fetch_file_set_uri (FetchFile* self, const gchar* value); +static void fetch_file_set_intended_property (FetchFile* self, const gchar* value); +static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static GObject * fetch_file_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +static void fetch_file_finalize (GObject* obj); +static void _vala_fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop) { + FetchFile * self = NULL; + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (prop != NULL, NULL); + self = (FetchFile*) g_object_new (object_type, "uri", uri, "intended-property", prop, NULL); + return self; +} + + +FetchFile* fetch_file_new (const gchar* uri, const gchar* prop) { + return fetch_file_construct (TYPE_FETCH_FILE, uri, prop); +} + + +static void fetch_file_fetch_data_data_free (gpointer _data) { + FetchFileFetchDataData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (FetchFileFetchDataData, data); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + FetchFileFetchDataData* _data_; + _data_ = g_slice_new0 (FetchFileFetchDataData); + _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_fetch_data); + g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_fetch_data_data_free); + _data_->self = _g_object_ref0 (self); + fetch_file_fetch_data_co (_data_); +} + + +void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_) { + FetchFileFetchDataData* _data_; + _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); +} + + +static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data) { + switch (data->_state_) { + case 0: + goto _state_0; + default: + g_assert_not_reached (); + } + _state_0: + data->_tmp0_ = NULL; + data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_); + data->_tmp1_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + goto __catch14_g_error; + } + data->_tmp2_ = data->_tmp1_; + data->_tmp3_ = NULL; + data->_tmp3_ = g_data_input_stream_new ((GInputStream*) data->_tmp2_); + _g_object_unref0 (data->self->priv->stream); + data->self->priv->stream = data->_tmp3_; + _g_object_unref0 (data->_tmp2_); + g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); + goto __finally14; + __catch14_g_error: + { + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + g_signal_emit_by_name (data->self, "failed"); + _g_error_free0 (data->e); + } + __finally14: + if (data->_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + fetch_file_read_something_async (data->self, NULL, NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; +} + + +static void fetch_file_read_something_async_data_free (gpointer _data) { + FetchFileReadSomethingAsyncData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (FetchFileReadSomethingAsyncData, data); +} + + +static void fetch_file_read_something_async (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + FetchFileReadSomethingAsyncData* _data_; + _data_ = g_slice_new0 (FetchFileReadSomethingAsyncData); + _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_read_something_async); + g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_read_something_async_data_free); + _data_->self = _g_object_ref0 (self); + fetch_file_read_something_async_co (_data_); +} + + +static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _res_) { + FetchFileReadSomethingAsyncData* _data_; + _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); +} + + +static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { + FetchFileReadSomethingAsyncData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + fetch_file_read_something_async_co (data); +} + + +static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* data) { + switch (data->_state_) { + case 0: + goto _state_0; + case 1: + goto _state_1; + default: + g_assert_not_reached (); + } + _state_0: + data->size = (gssize) 1024; + data->_tmp0_ = NULL; + data->_tmp0_ = g_new0 (guint8, data->size); + data->buffer = data->_tmp0_; + data->buffer_length1 = data->size; + data->_buffer_size_ = data->size; + data->bufsize = (gssize) 1; + { + data->_tmp1_ = TRUE; + while (TRUE) { + if (!data->_tmp1_) { + if (!(data->bufsize > 0)) { + break; + } + } + data->_tmp1_ = FALSE; + data->_state_ = 1; + g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->buffer_length1, G_PRIORITY_DEFAULT, NULL, fetch_file_read_something_async_ready, data); + return FALSE; + _state_1: + data->_tmp2_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_); + data->_tmp3_ = data->_tmp2_; + if (data->_inner_error_ != NULL) { + goto __catch15_g_error; + } + data->bufsize = data->_tmp3_; + if (data->bufsize < 1) { + break; + } + if (data->bufsize != data->size) { + data->_tmp4_ = NULL; + data->_tmp4_ = g_new0 (guint8, data->bufsize); + data->cpybuf = data->_tmp4_; + data->cpybuf_length1 = data->bufsize; + data->_cpybuf_size_ = data->bufsize; + memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize); + g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1); + data->cpybuf = (g_free (data->cpybuf), NULL); + } else { + g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1); + } + goto __finally15; + __catch15_g_error: + { + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + g_signal_emit_by_name (data->self, "failed"); + _g_error_free0 (data->e); + } + __finally15: + if (data->_inner_error_ != NULL) { + data->buffer = (g_free (data->buffer), NULL); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + } + } + g_signal_emit_by_name (data->self, "completed", data->self->priv->data, data->self->priv->_intended_property); + data->buffer = (g_free (data->buffer), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; +} + + +const gchar* fetch_file_get_uri (FetchFile* self) { + const gchar* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_uri; + return result; +} + + +static void fetch_file_set_uri (FetchFile* self, const gchar* value) { + gchar* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup (value); + _g_free0 (self->priv->_uri); + self->priv->_uri = _tmp0_; + g_object_notify ((GObject *) self, "uri"); +} + + +const gchar* fetch_file_get_intended_property (FetchFile* self) { + const gchar* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_intended_property; + return result; +} + + +static void fetch_file_set_intended_property (FetchFile* self, const gchar* value) { + gchar* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup (value); + _g_free0 (self->priv->_intended_property); + self->priv->_intended_property = _tmp0_; + g_object_notify ((GObject *) self, "intended-property"); +} + + +static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__POINTER_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2); + register GMarshalFunc_VOID__POINTER_STRING callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 3); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__POINTER_STRING) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_pointer (param_values + 1), g_value_get_string (param_values + 2), data2); +} + + +static GObject * fetch_file_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + FetchFile * self; + GFile* _tmp0_ = NULL; + GByteArray* _tmp1_ = NULL; + parent_class = G_OBJECT_CLASS (fetch_file_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = FETCH_FILE (obj); + _tmp0_ = g_file_new_for_uri (self->priv->_uri); + _g_object_unref0 (self->priv->file); + self->priv->file = _tmp0_; + _tmp1_ = g_byte_array_new (); + _g_byte_array_free0 (self->priv->data); + self->priv->data = _tmp1_; + return obj; +} + + +static void fetch_file_class_init (FetchFileClass * klass) { + fetch_file_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (FetchFilePrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_fetch_file_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_fetch_file_set_property; + G_OBJECT_CLASS (klass)->constructor = fetch_file_constructor; + G_OBJECT_CLASS (klass)->finalize = fetch_file_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), FETCH_FILE_URI, g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), FETCH_FILE_INTENDED_PROPERTY, g_param_spec_string ("intended-property", "intended-property", "intended-property", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_signal_new ("failed", TYPE_FETCH_FILE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + g_signal_new ("completed", TYPE_FETCH_FILE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__POINTER_STRING, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_STRING); +} + + +static void fetch_file_instance_init (FetchFile * self) { + self->priv = FETCH_FILE_GET_PRIVATE (self); +} + + +static void fetch_file_finalize (GObject* obj) { + FetchFile * self; + self = FETCH_FILE (obj); + _g_free0 (self->priv->_uri); + _g_free0 (self->priv->_intended_property); + _g_object_unref0 (self->priv->stream); + _g_object_unref0 (self->priv->file); + _g_byte_array_free0 (self->priv->data); + G_OBJECT_CLASS (fetch_file_parent_class)->finalize (obj); +} + + +GType fetch_file_get_type (void) { + static volatile gsize fetch_file_type_id__volatile = 0; + if (g_once_init_enter (&fetch_file_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FetchFileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fetch_file_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FetchFile), 0, (GInstanceInitFunc) fetch_file_instance_init, NULL }; + GType fetch_file_type_id; + fetch_file_type_id = g_type_register_static (G_TYPE_OBJECT, "FetchFile", &g_define_type_info, 0); + g_once_init_leave (&fetch_file_type_id__volatile, fetch_file_type_id); + } + return fetch_file_type_id__volatile; +} + + +static void _vala_fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + FetchFile * self; + self = FETCH_FILE (object); + switch (property_id) { + case FETCH_FILE_URI: + g_value_set_string (value, fetch_file_get_uri (self)); + break; + case FETCH_FILE_INTENDED_PROPERTY: + g_value_set_string (value, fetch_file_get_intended_property (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + FetchFile * self; + self = FETCH_FILE (object); + switch (property_id) { + case FETCH_FILE_URI: + fetch_file_set_uri (self, g_value_get_string (value)); + break; + case FETCH_FILE_INTENDED_PROPERTY: + fetch_file_set_intended_property (self, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/src/freedesktop-interfaces.c b/src/freedesktop-interfaces.c new file mode 100644 index 0000000..287c3e0 --- /dev/null +++ b/src/freedesktop-interfaces.c @@ -0,0 +1,857 @@ +/* freedesktop-interfaces.c generated by valac 0.12.1, the Vala compiler + * generated from freedesktop-interfaces.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <stdlib.h> +#include <string.h> + + +#define TYPE_FREE_DESKTOP_OBJECT (free_desktop_object_get_type ()) +#define FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObject)) +#define IS_FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_OBJECT)) +#define FREE_DESKTOP_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObjectIface)) + +typedef struct _FreeDesktopObject FreeDesktopObject; +typedef struct _FreeDesktopObjectIface FreeDesktopObjectIface; + +#define TYPE_FREE_DESKTOP_OBJECT_PROXY (free_desktop_object_proxy_get_type ()) +typedef GDBusProxy FreeDesktopObjectProxy; +typedef GDBusProxyClass FreeDesktopObjectProxyClass; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE (free_desktop_introspectable_get_type ()) +#define FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectable)) +#define IS_FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE)) +#define FREE_DESKTOP_INTROSPECTABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectableIface)) + +typedef struct _FreeDesktopIntrospectable FreeDesktopIntrospectable; +typedef struct _FreeDesktopIntrospectableIface FreeDesktopIntrospectableIface; + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY (free_desktop_introspectable_proxy_get_type ()) +typedef GDBusProxy FreeDesktopIntrospectableProxy; +typedef GDBusProxyClass FreeDesktopIntrospectableProxyClass; + +#define TYPE_FREE_DESKTOP_PROPERTIES (free_desktop_properties_get_type ()) +#define FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopProperties)) +#define IS_FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_PROPERTIES)) +#define FREE_DESKTOP_PROPERTIES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopPropertiesIface)) + +typedef struct _FreeDesktopProperties FreeDesktopProperties; +typedef struct _FreeDesktopPropertiesIface FreeDesktopPropertiesIface; + +#define TYPE_FREE_DESKTOP_PROPERTIES_PROXY (free_desktop_properties_proxy_get_type ()) +typedef GDBusProxy FreeDesktopPropertiesProxy; +typedef GDBusProxyClass FreeDesktopPropertiesProxyClass; +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) + +struct _FreeDesktopObjectIface { + GTypeInterface parent_iface; + void (*list_names) (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + gchar** (*list_names_finish) (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +}; + +struct _FreeDesktopIntrospectableIface { + GTypeInterface parent_iface; + gchar* (*Introspect) (FreeDesktopIntrospectable* self, GError** error); +}; + +struct _FreeDesktopPropertiesIface { + GTypeInterface parent_iface; +}; + +typedef enum { + XML_ERROR_FILE_NOT_FOUND, + XML_ERROR_XML_DOCUMENT_EMPTY +} XmlError; +#define XML_ERROR xml_error_quark () + + +GType free_desktop_object_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_object_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_object_get_type (void) G_GNUC_CONST; +void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +static void g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static void free_desktop_object_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static void _dbus_handle_free_desktop_object_name_owner_changed (FreeDesktopObject* self, GVariant* parameters); +static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data); +static void free_desktop_object_proxy_list_names_async (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static gchar** free_desktop_object_proxy_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +static void free_desktop_object_proxy_free_desktop_object_interface_init (FreeDesktopObjectIface* iface); +static void _dbus_free_desktop_object_list_names (FreeDesktopObject* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_free_desktop_object_list_names_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void free_desktop_object_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* free_desktop_object_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static gboolean free_desktop_object_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _dbus_free_desktop_object_name_owner_changed (GObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer* _data); +static void _free_desktop_object_unregister_object (gpointer user_data); +GType free_desktop_introspectable_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_introspectable_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_introspectable_get_type (void) G_GNUC_CONST; +gchar* free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GError** error); +static void free_desktop_introspectable_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static gchar* free_desktop_introspectable_proxy_Introspect (FreeDesktopIntrospectable* self, GError** error); +static void free_desktop_introspectable_proxy_free_desktop_introspectable_interface_init (FreeDesktopIntrospectableIface* iface); +static void _dbus_free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void free_desktop_introspectable_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* free_desktop_introspectable_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static gboolean free_desktop_introspectable_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _free_desktop_introspectable_unregister_object (gpointer user_data); +GType free_desktop_properties_get_type (void) G_GNUC_CONST; +GType free_desktop_properties_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_properties_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static void free_desktop_properties_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktopProperties* self, GVariant* parameters); +static void free_desktop_properties_proxy_free_desktop_properties_interface_init (FreeDesktopPropertiesIface* iface); +static void free_desktop_properties_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* free_desktop_properties_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static gboolean free_desktop_properties_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer* _data); +static void _free_desktop_properties_unregister_object (gpointer user_data); +GQuark xml_error_quark (void); +#define FREEDESKTOP_SERVICE "org.freedesktop.DBus" +#define FREEDESKTOP_OBJECT "/org/freedesktop/DBus" +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + +static const GDBusArgInfo _free_desktop_object_dbus_arg_info_list_names_result = {-1, "result", "as"}; +static const GDBusArgInfo * const _free_desktop_object_dbus_arg_info_list_names_in[] = {NULL}; +static const GDBusArgInfo * const _free_desktop_object_dbus_arg_info_list_names_out[] = {&_free_desktop_object_dbus_arg_info_list_names_result, NULL}; +static const GDBusMethodInfo _free_desktop_object_dbus_method_info_list_names = {-1, "ListNames", (GDBusArgInfo **) (&_free_desktop_object_dbus_arg_info_list_names_in), (GDBusArgInfo **) (&_free_desktop_object_dbus_arg_info_list_names_out)}; +static const GDBusMethodInfo * const _free_desktop_object_dbus_method_info[] = {&_free_desktop_object_dbus_method_info_list_names, NULL}; +static const GDBusArgInfo _free_desktop_object_dbus_arg_info_name_owner_changed_name = {-1, "name", "s"}; +static const GDBusArgInfo _free_desktop_object_dbus_arg_info_name_owner_changed_old_owner = {-1, "old_owner", "s"}; +static const GDBusArgInfo _free_desktop_object_dbus_arg_info_name_owner_changed_new_owner = {-1, "new_owner", "s"}; +static const GDBusArgInfo * const _free_desktop_object_dbus_arg_info_name_owner_changed[] = {&_free_desktop_object_dbus_arg_info_name_owner_changed_name, &_free_desktop_object_dbus_arg_info_name_owner_changed_old_owner, &_free_desktop_object_dbus_arg_info_name_owner_changed_new_owner, NULL}; +static const GDBusSignalInfo _free_desktop_object_dbus_signal_info_name_owner_changed = {-1, "NameOwnerChanged", (GDBusArgInfo **) (&_free_desktop_object_dbus_arg_info_name_owner_changed)}; +static const GDBusSignalInfo * const _free_desktop_object_dbus_signal_info[] = {&_free_desktop_object_dbus_signal_info_name_owner_changed, NULL}; +static const GDBusPropertyInfo * const _free_desktop_object_dbus_property_info[] = {NULL}; +static const GDBusInterfaceInfo _free_desktop_object_dbus_interface_info = {-1, "org.freedesktop.DBus", (GDBusMethodInfo **) (&_free_desktop_object_dbus_method_info), (GDBusSignalInfo **) (&_free_desktop_object_dbus_signal_info), (GDBusPropertyInfo **) (&_free_desktop_object_dbus_property_info)}; +static const GDBusInterfaceVTable _free_desktop_object_dbus_interface_vtable = {free_desktop_object_dbus_interface_method_call, free_desktop_object_dbus_interface_get_property, free_desktop_object_dbus_interface_set_property}; +static const GDBusArgInfo _free_desktop_introspectable_dbus_arg_info_Introspect_result = {-1, "result", "s"}; +static const GDBusArgInfo * const _free_desktop_introspectable_dbus_arg_info_Introspect_in[] = {NULL}; +static const GDBusArgInfo * const _free_desktop_introspectable_dbus_arg_info_Introspect_out[] = {&_free_desktop_introspectable_dbus_arg_info_Introspect_result, NULL}; +static const GDBusMethodInfo _free_desktop_introspectable_dbus_method_info_Introspect = {-1, "Introspect", (GDBusArgInfo **) (&_free_desktop_introspectable_dbus_arg_info_Introspect_in), (GDBusArgInfo **) (&_free_desktop_introspectable_dbus_arg_info_Introspect_out)}; +static const GDBusMethodInfo * const _free_desktop_introspectable_dbus_method_info[] = {&_free_desktop_introspectable_dbus_method_info_Introspect, NULL}; +static const GDBusSignalInfo * const _free_desktop_introspectable_dbus_signal_info[] = {NULL}; +static const GDBusPropertyInfo * const _free_desktop_introspectable_dbus_property_info[] = {NULL}; +static const GDBusInterfaceInfo _free_desktop_introspectable_dbus_interface_info = {-1, "org.freedesktop.DBus.Introspectable", (GDBusMethodInfo **) (&_free_desktop_introspectable_dbus_method_info), (GDBusSignalInfo **) (&_free_desktop_introspectable_dbus_signal_info), (GDBusPropertyInfo **) (&_free_desktop_introspectable_dbus_property_info)}; +static const GDBusInterfaceVTable _free_desktop_introspectable_dbus_interface_vtable = {free_desktop_introspectable_dbus_interface_method_call, free_desktop_introspectable_dbus_interface_get_property, free_desktop_introspectable_dbus_interface_set_property}; +static const GDBusMethodInfo * const _free_desktop_properties_dbus_method_info[] = {NULL}; +static const GDBusArgInfo _free_desktop_properties_dbus_arg_info_properties_changed_source = {-1, "source", "s"}; +static const GDBusArgInfo _free_desktop_properties_dbus_arg_info_properties_changed_changed_properties = {-1, "changed_properties", "a{sv}"}; +static const GDBusArgInfo _free_desktop_properties_dbus_arg_info_properties_changed_invalid = {-1, "invalid", "as"}; +static const GDBusArgInfo * const _free_desktop_properties_dbus_arg_info_properties_changed[] = {&_free_desktop_properties_dbus_arg_info_properties_changed_source, &_free_desktop_properties_dbus_arg_info_properties_changed_changed_properties, &_free_desktop_properties_dbus_arg_info_properties_changed_invalid, NULL}; +static const GDBusSignalInfo _free_desktop_properties_dbus_signal_info_properties_changed = {-1, "PropertiesChanged", (GDBusArgInfo **) (&_free_desktop_properties_dbus_arg_info_properties_changed)}; +static const GDBusSignalInfo * const _free_desktop_properties_dbus_signal_info[] = {&_free_desktop_properties_dbus_signal_info_properties_changed, NULL}; +static const GDBusPropertyInfo * const _free_desktop_properties_dbus_property_info[] = {NULL}; +static const GDBusInterfaceInfo _free_desktop_properties_dbus_interface_info = {-1, "org.freedesktop.DBus.Properties", (GDBusMethodInfo **) (&_free_desktop_properties_dbus_method_info), (GDBusSignalInfo **) (&_free_desktop_properties_dbus_signal_info), (GDBusPropertyInfo **) (&_free_desktop_properties_dbus_property_info)}; +static const GDBusInterfaceVTable _free_desktop_properties_dbus_interface_vtable = {free_desktop_properties_dbus_interface_method_call, free_desktop_properties_dbus_interface_get_property, free_desktop_properties_dbus_interface_set_property}; + +void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + FREE_DESKTOP_OBJECT_GET_INTERFACE (self)->list_names (self, _callback_, _user_data_); +} + + +gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error) { + return FREE_DESKTOP_OBJECT_GET_INTERFACE (self)->list_names_finish (self, _res_, result_length1, error); +} + + +static void g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, const char* arg_3, gpointer data2); + register GMarshalFunc_VOID__STRING_STRING_STRING callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 4); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_string (param_values + 3), data2); +} + + +static void free_desktop_object_base_init (FreeDesktopObjectIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + g_signal_new ("name_owner_changed", TYPE_FREE_DESKTOP_OBJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); + } +} + + +GType free_desktop_object_get_type (void) { + static volatile gsize free_desktop_object_type_id__volatile = 0; + if (g_once_init_enter (&free_desktop_object_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FreeDesktopObjectIface), (GBaseInitFunc) free_desktop_object_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType free_desktop_object_type_id; + free_desktop_object_type_id = g_type_register_static (G_TYPE_INTERFACE, "FreeDesktopObject", &g_define_type_info, 0); + g_type_interface_add_prerequisite (free_desktop_object_type_id, G_TYPE_OBJECT); + g_type_set_qdata (free_desktop_object_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) free_desktop_object_proxy_get_type); + g_type_set_qdata (free_desktop_object_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.DBus"); + g_type_set_qdata (free_desktop_object_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) free_desktop_object_register_object); + g_once_init_leave (&free_desktop_object_type_id__volatile, free_desktop_object_type_id); + } + return free_desktop_object_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (FreeDesktopObjectProxy, free_desktop_object_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_FREE_DESKTOP_OBJECT, free_desktop_object_proxy_free_desktop_object_interface_init) ) +static void free_desktop_object_proxy_class_init (FreeDesktopObjectProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = free_desktop_object_proxy_g_signal; +} + + +static void _dbus_handle_free_desktop_object_name_owner_changed (FreeDesktopObject* self, GVariant* parameters) { + GVariantIter _arguments_iter; + gchar* name = NULL; + GVariant* _tmp77_; + gchar* old_owner = NULL; + GVariant* _tmp78_; + gchar* new_owner = NULL; + GVariant* _tmp79_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp77_ = g_variant_iter_next_value (&_arguments_iter); + name = g_variant_dup_string (_tmp77_, NULL); + g_variant_unref (_tmp77_); + _tmp78_ = g_variant_iter_next_value (&_arguments_iter); + old_owner = g_variant_dup_string (_tmp78_, NULL); + g_variant_unref (_tmp78_); + _tmp79_ = g_variant_iter_next_value (&_arguments_iter); + new_owner = g_variant_dup_string (_tmp79_, NULL); + g_variant_unref (_tmp79_); + g_signal_emit_by_name (self, "name-owner-changed", name, old_owner, new_owner); + _g_free0 (name); + _g_free0 (old_owner); + _g_free0 (new_owner); +} + + +static void free_desktop_object_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { + if (strcmp (signal_name, "NameOwnerChanged") == 0) { + _dbus_handle_free_desktop_object_name_owner_changed ((FreeDesktopObject*) proxy, parameters); + } +} + + +static void free_desktop_object_proxy_init (FreeDesktopObjectProxy* self) { +} + + +static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data) { + g_simple_async_result_set_op_res_gpointer (user_data, g_object_ref (res), g_object_unref); + g_simple_async_result_complete (user_data); + g_object_unref (user_data); +} + + +static void free_desktop_object_proxy_list_names_async (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.DBus", "ListNames"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static gchar** free_desktop_object_proxy_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error) { + GDBusMessage *_reply_message; + GVariant *_reply; + GVariantIter _reply_iter; + gchar** _result; + int _result_length1; + GVariant* _tmp80_; + gchar** _tmp81_; + int _tmp81__length; + int _tmp81__size; + int _tmp81__length1; + GVariantIter _tmp82_; + GVariant* _tmp83_; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return NULL; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return NULL; + } + _reply = g_dbus_message_get_body (_reply_message); + g_variant_iter_init (&_reply_iter, _reply); + _result_length1 = 0; + _tmp80_ = g_variant_iter_next_value (&_reply_iter); + _tmp81_ = g_new (gchar*, 5); + _tmp81__length = 0; + _tmp81__size = 4; + _tmp81__length1 = 0; + g_variant_iter_init (&_tmp82_, _tmp80_); + for (; (_tmp83_ = g_variant_iter_next_value (&_tmp82_)) != NULL; _tmp81__length1++) { + if (_tmp81__size == _tmp81__length) { + _tmp81__size = 2 * _tmp81__size; + _tmp81_ = g_renew (gchar*, _tmp81_, _tmp81__size + 1); + } + _tmp81_[_tmp81__length++] = g_variant_dup_string (_tmp83_, NULL); + g_variant_unref (_tmp83_); + } + _result_length1 = _tmp81__length1; + _tmp81_[_tmp81__length] = NULL; + _result = _tmp81_; + g_variant_unref (_tmp80_); + *result_length1 = _result_length1; + g_object_unref (_reply_message); + return _result; +} + + +static void free_desktop_object_proxy_free_desktop_object_interface_init (FreeDesktopObjectIface* iface) { + iface->list_names = free_desktop_object_proxy_list_names_async; + iface->list_names_finish = free_desktop_object_proxy_list_names_finish; +} + + +static void _dbus_free_desktop_object_list_names (FreeDesktopObject* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + free_desktop_object_list_names (self, (GAsyncReadyCallback) _dbus_free_desktop_object_list_names_ready, invocation); +} + + +static void _dbus_free_desktop_object_list_names_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + gchar** result; + int result_length1 = 0; + gchar** _tmp84_; + GVariantBuilder _tmp85_; + int _tmp86_; + invocation = _user_data_; + result = free_desktop_object_list_names_finish ((FreeDesktopObject*) source_object, _res_, &result_length1, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _tmp84_ = result; + g_variant_builder_init (&_tmp85_, G_VARIANT_TYPE ("as")); + for (_tmp86_ = 0; _tmp86_ < result_length1; _tmp86_++) { + g_variant_builder_add_value (&_tmp85_, g_variant_new_string (*_tmp84_)); + _tmp84_++; + } + g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp85_)); + result = (_vala_array_free ( result, result_length1, (GDestroyNotify) g_free), NULL); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void free_desktop_object_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (method_name, "ListNames") == 0) { + _dbus_free_desktop_object_list_names (object, parameters, invocation); + } else { + g_object_unref (invocation); + } +} + + +static GVariant* free_desktop_object_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return NULL; +} + + +static gboolean free_desktop_object_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return FALSE; +} + + +static void _dbus_free_desktop_object_name_owner_changed (GObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer* _data) { + GDBusConnection * _connection; + const gchar * _path; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + _connection = _data[1]; + _path = _data[2]; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (name)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (old_owner)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (new_owner)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.DBus", "NameOwnerChanged", _arguments, NULL); +} + + +guint free_desktop_object_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_free_desktop_object_dbus_interface_info), &_free_desktop_object_dbus_interface_vtable, data, _free_desktop_object_unregister_object, error); + if (!result) { + return 0; + } + g_signal_connect (object, "name-owner-changed", (GCallback) _dbus_free_desktop_object_name_owner_changed, data); + return result; +} + + +static void _free_desktop_object_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +gchar* free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GError** error) { + return FREE_DESKTOP_INTROSPECTABLE_GET_INTERFACE (self)->Introspect (self, error); +} + + +static void free_desktop_introspectable_base_init (FreeDesktopIntrospectableIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + } +} + + +GType free_desktop_introspectable_get_type (void) { + static volatile gsize free_desktop_introspectable_type_id__volatile = 0; + if (g_once_init_enter (&free_desktop_introspectable_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FreeDesktopIntrospectableIface), (GBaseInitFunc) free_desktop_introspectable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType free_desktop_introspectable_type_id; + free_desktop_introspectable_type_id = g_type_register_static (G_TYPE_INTERFACE, "FreeDesktopIntrospectable", &g_define_type_info, 0); + g_type_interface_add_prerequisite (free_desktop_introspectable_type_id, G_TYPE_OBJECT); + g_type_set_qdata (free_desktop_introspectable_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) free_desktop_introspectable_proxy_get_type); + g_type_set_qdata (free_desktop_introspectable_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.DBus.Introspectable"); + g_type_set_qdata (free_desktop_introspectable_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) free_desktop_introspectable_register_object); + g_once_init_leave (&free_desktop_introspectable_type_id__volatile, free_desktop_introspectable_type_id); + } + return free_desktop_introspectable_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (FreeDesktopIntrospectableProxy, free_desktop_introspectable_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_FREE_DESKTOP_INTROSPECTABLE, free_desktop_introspectable_proxy_free_desktop_introspectable_interface_init) ) +static void free_desktop_introspectable_proxy_class_init (FreeDesktopIntrospectableProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = free_desktop_introspectable_proxy_g_signal; +} + + +static void free_desktop_introspectable_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { +} + + +static void free_desktop_introspectable_proxy_init (FreeDesktopIntrospectableProxy* self) { +} + + +static gchar* free_desktop_introspectable_proxy_Introspect (FreeDesktopIntrospectable* self, GError** error) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + GDBusMessage *_reply_message; + GVariant *_reply; + GVariantIter _reply_iter; + gchar* _result; + GVariant* _tmp87_; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.DBus.Introspectable", "Introspect"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error); + g_object_unref (_message); + if (!_reply_message) { + return NULL; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return NULL; + } + _reply = g_dbus_message_get_body (_reply_message); + g_variant_iter_init (&_reply_iter, _reply); + _tmp87_ = g_variant_iter_next_value (&_reply_iter); + _result = g_variant_dup_string (_tmp87_, NULL); + g_variant_unref (_tmp87_); + g_object_unref (_reply_message); + return _result; +} + + +static void free_desktop_introspectable_proxy_free_desktop_introspectable_interface_init (FreeDesktopIntrospectableIface* iface) { + iface->Introspect = free_desktop_introspectable_proxy_Introspect; +} + + +static void _dbus_free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GError* error = NULL; + GVariantIter _arguments_iter; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + gchar* result; + g_variant_iter_init (&_arguments_iter, parameters); + result = free_desktop_introspectable_Introspect (self, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result)); + _g_free0 ( result); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void free_desktop_introspectable_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (method_name, "Introspect") == 0) { + _dbus_free_desktop_introspectable_Introspect (object, parameters, invocation); + } else { + g_object_unref (invocation); + } +} + + +static GVariant* free_desktop_introspectable_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return NULL; +} + + +static gboolean free_desktop_introspectable_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return FALSE; +} + + +guint free_desktop_introspectable_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_free_desktop_introspectable_dbus_interface_info), &_free_desktop_introspectable_dbus_interface_vtable, data, _free_desktop_introspectable_unregister_object, error); + if (!result) { + return 0; + } + return result; +} + + +static void _free_desktop_introspectable_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gint arg_4, gpointer data2); + register GMarshalFunc_VOID__STRING_BOXED_BOXED_INT callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 5); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_string (param_values + 1), g_value_get_boxed (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_int (param_values + 4), data2); +} + + +static void free_desktop_properties_base_init (FreeDesktopPropertiesIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + g_signal_new ("properties_changed", TYPE_FREE_DESKTOP_PROPERTIES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT, G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_HASH_TABLE, G_TYPE_STRV, G_TYPE_INT); + } +} + + +GType free_desktop_properties_get_type (void) { + static volatile gsize free_desktop_properties_type_id__volatile = 0; + if (g_once_init_enter (&free_desktop_properties_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FreeDesktopPropertiesIface), (GBaseInitFunc) free_desktop_properties_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType free_desktop_properties_type_id; + free_desktop_properties_type_id = g_type_register_static (G_TYPE_INTERFACE, "FreeDesktopProperties", &g_define_type_info, 0); + g_type_interface_add_prerequisite (free_desktop_properties_type_id, G_TYPE_OBJECT); + g_type_set_qdata (free_desktop_properties_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) free_desktop_properties_proxy_get_type); + g_type_set_qdata (free_desktop_properties_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.DBus.Properties"); + g_type_set_qdata (free_desktop_properties_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) free_desktop_properties_register_object); + g_once_init_leave (&free_desktop_properties_type_id__volatile, free_desktop_properties_type_id); + } + return free_desktop_properties_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (FreeDesktopPropertiesProxy, free_desktop_properties_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_FREE_DESKTOP_PROPERTIES, free_desktop_properties_proxy_free_desktop_properties_interface_init) ) +static void free_desktop_properties_proxy_class_init (FreeDesktopPropertiesProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = free_desktop_properties_proxy_g_signal; +} + + +static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktopProperties* self, GVariant* parameters) { + GVariantIter _arguments_iter; + gchar* source = NULL; + GVariant* _tmp88_; + GHashTable* changed_properties = NULL; + GVariant* _tmp89_; + GHashTable* _tmp90_; + GVariantIter _tmp91_; + GVariant* _tmp92_; + GVariant* _tmp93_; + gchar** invalid = NULL; + int invalid_length1; + GVariant* _tmp94_; + gchar** _tmp95_; + int _tmp95__length; + int _tmp95__size; + int _tmp95__length1; + GVariantIter _tmp96_; + GVariant* _tmp97_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp88_ = g_variant_iter_next_value (&_arguments_iter); + source = g_variant_dup_string (_tmp88_, NULL); + g_variant_unref (_tmp88_); + _tmp89_ = g_variant_iter_next_value (&_arguments_iter); + _tmp90_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + g_variant_iter_init (&_tmp91_, _tmp89_); + while (g_variant_iter_loop (&_tmp91_, "{?*}", &_tmp92_, &_tmp93_)) { + g_hash_table_insert (_tmp90_, g_variant_dup_string (_tmp92_, NULL), g_variant_get_variant (_tmp93_)); + } + changed_properties = _tmp90_; + g_variant_unref (_tmp89_); + invalid_length1 = 0; + _tmp94_ = g_variant_iter_next_value (&_arguments_iter); + _tmp95_ = g_new (gchar*, 5); + _tmp95__length = 0; + _tmp95__size = 4; + _tmp95__length1 = 0; + g_variant_iter_init (&_tmp96_, _tmp94_); + for (; (_tmp97_ = g_variant_iter_next_value (&_tmp96_)) != NULL; _tmp95__length1++) { + if (_tmp95__size == _tmp95__length) { + _tmp95__size = 2 * _tmp95__size; + _tmp95_ = g_renew (gchar*, _tmp95_, _tmp95__size + 1); + } + _tmp95_[_tmp95__length++] = g_variant_dup_string (_tmp97_, NULL); + g_variant_unref (_tmp97_); + } + invalid_length1 = _tmp95__length1; + _tmp95_[_tmp95__length] = NULL; + invalid = _tmp95_; + g_variant_unref (_tmp94_); + g_signal_emit_by_name (self, "properties-changed", source, changed_properties, invalid, invalid_length1); + _g_free0 (source); + _g_hash_table_unref0 (changed_properties); + invalid = (_vala_array_free (invalid, invalid_length1, (GDestroyNotify) g_free), NULL); +} + + +static void free_desktop_properties_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { + if (strcmp (signal_name, "PropertiesChanged") == 0) { + _dbus_handle_free_desktop_properties_properties_changed ((FreeDesktopProperties*) proxy, parameters); + } +} + + +static void free_desktop_properties_proxy_init (FreeDesktopPropertiesProxy* self) { +} + + +static void free_desktop_properties_proxy_free_desktop_properties_interface_init (FreeDesktopPropertiesIface* iface) { +} + + +static void free_desktop_properties_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + g_object_unref (invocation); +} + + +static GVariant* free_desktop_properties_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return NULL; +} + + +static gboolean free_desktop_properties_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + return FALSE; +} + + +static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer* _data) { + GDBusConnection * _connection; + const gchar * _path; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + GVariantBuilder _tmp98_; + GHashTableIter _tmp99_; + gpointer _tmp100_; + gpointer _tmp101_; + gchar** _tmp102_; + GVariantBuilder _tmp103_; + int _tmp104_; + _connection = _data[1]; + _path = _data[2]; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (source)); + g_hash_table_iter_init (&_tmp99_, changed_properties); + g_variant_builder_init (&_tmp98_, G_VARIANT_TYPE ("a{sv}")); + while (g_hash_table_iter_next (&_tmp99_, &_tmp100_, &_tmp101_)) { + gchar* _key; + GVariant* _value; + _key = (gchar*) _tmp100_; + _value = (GVariant*) _tmp101_; + g_variant_builder_add (&_tmp98_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value)); + } + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp98_)); + _tmp102_ = invalid; + g_variant_builder_init (&_tmp103_, G_VARIANT_TYPE ("as")); + for (_tmp104_ = 0; _tmp104_ < invalid_length1; _tmp104_++) { + g_variant_builder_add_value (&_tmp103_, g_variant_new_string (*_tmp102_)); + _tmp102_++; + } + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp103_)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.DBus.Properties", "PropertiesChanged", _arguments, NULL); +} + + +guint free_desktop_properties_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_free_desktop_properties_dbus_interface_info), &_free_desktop_properties_dbus_interface_vtable, data, _free_desktop_properties_unregister_object, error); + if (!result) { + return 0; + } + g_signal_connect (object, "properties-changed", (GCallback) _dbus_free_desktop_properties_properties_changed, data); + return result; +} + + +static void _free_desktop_properties_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +GQuark xml_error_quark (void) { + return g_quark_from_static_string ("xml_error-quark"); +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/src/gen-sound-service.xml.c b/src/gen-sound-service.xml.c new file mode 100644 index 0000000..2590cae --- /dev/null +++ b/src/gen-sound-service.xml.c @@ -0,0 +1,27 @@ +const char * _sound_service = +"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n" +"<node name=\"/com/canonical/indicators/sound\">\n" +" <interface name=\"com.canonical.indicators.sound\">\n" +" <method name = \"BlacklistMediaPlayer\">\n" +" <annotation name=\"org.freedesktop.DBus.GLib.Async\" value=\"true\"/>\n" +" <arg type='s' name='player_desktop_name' direction=\"in\"/>\n" +" <arg type='b' name='blacklist' direction=\"in\"/>\n" +" <arg type='b' name='result' direction=\"out\"/>\n" +" </method>\n" +" <method name = \"IsBlacklisted\">\n" +" <annotation name=\"org.freedesktop.DBus.GLib.Async\" value=\"true\"/>\n" +" <arg type='s' name='player_desktop_name' direction=\"in\"/>\n" +" <arg type='b' name='result' direction=\"out\"/>\n" +" </method>\n" +"\n" +" <method name = \"GetSoundState\">\n" +" <annotation name=\"org.freedesktop.DBus.GLib.Async\" value=\"true\"/>\n" +" <arg type='i' name='current_state' direction=\"out\"/>\n" +" </method>\n" +" <signal name=\"SoundStateUpdate\">\n" +" <arg name=\"new_state\" type=\"i\" direction=\"out\"/>\n" +" </signal>\n" +" </interface>\n" +"</node>\n" +"\n" +; diff --git a/src/gen-sound-service.xml.h b/src/gen-sound-service.xml.h new file mode 100644 index 0000000..6634bc4 --- /dev/null +++ b/src/gen-sound-service.xml.h @@ -0,0 +1 @@ +extern const char * _sound_service; diff --git a/src/metadata-menu-item.c b/src/metadata-menu-item.c new file mode 100644 index 0000000..56c0c8c --- /dev/null +++ b/src/metadata-menu-item.c @@ -0,0 +1,723 @@ +/* metadata-menu-item.c generated by valac 0.12.1, the Vala compiler + * generated from metadata-menu-item.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <stdlib.h> +#include <string.h> +#include <common-defs.h> +#include <gio/gio.h> +#include <gdk-pixbuf/gdk-pixdata.h> +#include <glib/gstdio.h> +#include <gee.h> + + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; + +#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ()) +#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem)) +#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) +#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM)) +#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM)) +#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) + +typedef struct _MetadataMenuitem MetadataMenuitem; +typedef struct _MetadataMenuitemClass MetadataMenuitemClass; +typedef struct _MetadataMenuitemPrivate MetadataMenuitemPrivate; + +#define TYPE_FETCH_FILE (fetch_file_get_type ()) +#define FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FETCH_FILE, FetchFile)) +#define FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FETCH_FILE, FetchFileClass)) +#define IS_FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FETCH_FILE)) +#define IS_FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FETCH_FILE)) +#define FETCH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FETCH_FILE, FetchFileClass)) + +typedef struct _FetchFile FetchFile; +typedef struct _FetchFileClass FetchFileClass; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; + +#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _MetadataMenuitem { + PlayerItem parent_instance; + MetadataMenuitemPrivate * priv; +}; + +struct _MetadataMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _MetadataMenuitemPrivate { + gchar* previous_temp_album_art_path; +}; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + +typedef enum { + PLAYER_CONTROLLER_STATE_OFFLINE, + PLAYER_CONTROLLER_STATE_INSTANTIATING, + PLAYER_CONTROLLER_STATE_READY, + PLAYER_CONTROLLER_STATE_CONNECTED, + PLAYER_CONTROLLER_STATE_DISCONNECTED +} PlayerControllerstate; + + +static gpointer metadata_menuitem_parent_class = NULL; +extern gchar* metadata_menuitem_album_art_cache_dir; +gchar* metadata_menuitem_album_art_cache_dir = NULL; +static FetchFile* metadata_menuitem_fetcher; +static FetchFile* metadata_menuitem_fetcher = NULL; + +GType player_item_get_type (void) G_GNUC_CONST; +GType metadata_menuitem_get_type (void) G_GNUC_CONST; +#define METADATA_MENUITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_METADATA_MENUITEM, MetadataMenuitemPrivate)) +enum { + METADATA_MENUITEM_DUMMY_PROPERTY +}; +GType fetch_file_get_type (void) G_GNUC_CONST; +#define METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX "indicators/sound/album-art-cache" +GType player_controller_get_type (void) G_GNUC_CONST; +MetadataMenuitem* metadata_menuitem_new (PlayerController* parent); +MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent); +static void metadata_menuitem_clean_album_art_temp_dir (void); +static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir); +static gchar* metadata_menuitem_create_album_art_temp_dir (void); +void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop); +#define PLAYER_ITEM_EMPTY (-1) +FetchFile* fetch_file_new (const gchar* uri, const gchar* prop); +FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop); +static void _lambda0_ (MetadataMenuitem* self); +static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self); +static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self); +static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property); +static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self); +void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_); +static void metadata_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp); +PlayerController* player_item_get_owner (PlayerItem* self); +GType mpris2_controller_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; +void player_controller_instantiate (PlayerController* self); +void mpris2_controller_expose (Mpris2Controller* self); +void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title); +void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update); +void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse); +GeeHashSet* metadata_menuitem_attributes_format (void); +GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void); +static GObject * metadata_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +GAppInfo* player_controller_get_app_info (PlayerController* self); +const gchar* player_controller_get_icon_name (PlayerController* self); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +static void metadata_menuitem_finalize (GObject* obj); + + +MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent) { + MetadataMenuitem * self = NULL; + g_return_val_if_fail (parent != NULL, NULL); + self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, "owner", parent, NULL); + return self; +} + + +MetadataMenuitem* metadata_menuitem_new (PlayerController* parent) { + return metadata_menuitem_construct (TYPE_METADATA_MENUITEM, parent); +} + + +static void metadata_menuitem_clean_album_art_temp_dir (void) { + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* path; + GFile* _tmp2_ = NULL; + GFile* album_art_dir; + gboolean _tmp3_; + _tmp0_ = g_get_user_cache_dir (); + _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL); + path = _tmp1_; + _tmp2_ = g_file_new_for_path (path); + album_art_dir = _tmp2_; + _tmp3_ = metadata_menuitem_delete_album_art_contents (album_art_dir); + if (_tmp3_ == FALSE) { + g_warning ("metadata-menu-item.vala:58: could not remove the temp album art files " \ +"%s", path); + } + _g_object_unref0 (album_art_dir); + _g_free0 (path); +} + + +static gchar* metadata_menuitem_create_album_art_temp_dir (void) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* path; + gint _tmp2_; + _tmp0_ = g_get_user_cache_dir (); + _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL); + path = _tmp1_; + _tmp2_ = g_mkdir (path, 0700); + if (_tmp2_ == (-1)) { + g_warning ("metadata-menu-item.vala:66: could not create a temp dir for remote alb" \ +"um art, it must have been created already"); + } + result = path; + return result; +} + + +static const gchar* string_to_string (const gchar* self) { + const gchar* result = NULL; + g_return_val_if_fail (self != NULL, NULL); + result = self; + return result; +} + + +static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir) { + gboolean result = FALSE; + gboolean _result_; + GFileEnumerator* _tmp0_ = NULL; + GFileEnumerator* e; + GError * _inner_error_ = NULL; + g_return_val_if_fail (dir != NULL, FALSE); + _result_ = TRUE; + _tmp0_ = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); + e = _tmp0_; + if (_inner_error_ != NULL) { + goto __catch2_g_error; + } + while (TRUE) { + GFileInfo* _tmp1_ = NULL; + GFileInfo* file; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + GFile* _tmp4_ = NULL; + GFile* child; + _tmp1_ = g_file_enumerator_next_file (e, NULL, &_inner_error_); + file = _tmp1_; + if (_inner_error_ != NULL) { + _g_object_unref0 (e); + goto __catch2_g_error; + } + _tmp2_ = g_file_info_get_name (file); + g_debug ("metadata-menu-item.vala:82: file name = %s", _tmp2_); + if (file == NULL) { + _g_object_unref0 (file); + break; + } + _tmp3_ = g_file_info_get_name (file); + _tmp4_ = g_file_get_child (dir, _tmp3_); + child = _tmp4_; + g_file_delete (child, NULL, &_inner_error_); + if (_inner_error_ != NULL) { + goto __catch3_g_error; + } + goto __finally3; + __catch3_g_error: + { + GError * error_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + const gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + gchar* _tmp10_; + error_ = _inner_error_; + _inner_error_ = NULL; + _tmp5_ = g_file_get_basename (child); + _tmp6_ = _tmp5_; + _tmp7_ = string_to_string (_tmp6_); + _tmp8_ = string_to_string (error_->message); + _tmp9_ = g_strconcat ("Unable to delete file '", _tmp7_, ": ", _tmp8_, NULL); + _tmp10_ = _tmp9_; + g_warning ("metadata-menu-item.vala:92: %s", _tmp10_); + _g_free0 (_tmp10_); + _g_free0 (_tmp6_); + _result_ = FALSE; + _g_error_free0 (error_); + } + __finally3: + if (_inner_error_ != NULL) { + _g_object_unref0 (child); + _g_object_unref0 (file); + _g_object_unref0 (e); + goto __catch2_g_error; + } + _g_object_unref0 (child); + _g_object_unref0 (file); + } + _g_object_unref0 (e); + goto __finally2; + __catch2_g_error: + { + GError * _error_; + gchar* _tmp11_ = NULL; + gchar* _tmp12_; + const gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + gchar* _tmp15_; + _error_ = _inner_error_; + _inner_error_ = NULL; + _tmp11_ = g_file_get_basename (dir); + _tmp12_ = _tmp11_; + _tmp13_ = string_to_string (_tmp12_); + _tmp14_ = g_strconcat ("Unable to read files from directory '", _tmp13_, "': %s", NULL); + _tmp15_ = _tmp14_; + g_warning (_tmp15_, _error_->message); + _g_free0 (_tmp15_); + _g_free0 (_tmp12_); + _result_ = FALSE; + _g_error_free0 (_error_); + } + __finally2: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return FALSE; + } + result = _result_; + return result; +} + + +static gchar* string_strip (const gchar* self) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gchar* _result_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = g_strdup (self); + _result_ = _tmp0_; + g_strstrip (_result_); + result = _result_; + return result; +} + + +static void _lambda0_ (MetadataMenuitem* self) { + metadata_menuitem_on_fetcher_failed (self); +} + + +static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self) { + _lambda0_ (self); +} + + +static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self) { + metadata_menuitem_on_fetcher_completed (self, data, property); +} + + +void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop) { + GFile* _tmp0_ = NULL; + GFile* art_file; + gboolean _tmp1_; + FetchFile* _tmp10_ = NULL; + GError * _inner_error_ = NULL; + g_return_if_fail (self != NULL); + g_return_if_fail (uri != NULL); + g_return_if_fail (prop != NULL); + _tmp0_ = g_file_new_for_uri (uri); + art_file = _tmp0_; + _tmp1_ = g_file_is_native (art_file); + if (_tmp1_ == TRUE) { + gboolean _tmp2_; + gchar* path = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_ = NULL; + gchar* _tmp9_; + _tmp2_ = g_file_query_exists (art_file, NULL); + if (_tmp2_ == FALSE) { + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, prop, PLAYER_ITEM_EMPTY); + _g_object_unref0 (art_file); + return; + } + _tmp3_ = string_strip (uri); + _tmp4_ = _tmp3_; + _tmp5_ = g_filename_from_uri (_tmp4_, NULL, &_inner_error_); + _tmp6_ = _tmp5_; + _g_free0 (_tmp4_); + _tmp7_ = _tmp6_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_CONVERT_ERROR) { + goto __catch4_g_convert_error; + } + _g_free0 (path); + _g_object_unref0 (art_file); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } + _g_free0 (path); + path = _tmp7_; + _tmp8_ = string_strip (uri); + _tmp9_ = _tmp8_; + g_debug ("metadata-menu-item.vala:116: Populating the artwork field with %s", _tmp9_); + _g_free0 (_tmp9_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, prop, path); + goto __finally4; + __catch4_g_convert_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("metadata-menu-item.vala:120: Problem converting URI %s to file path", uri); + _g_error_free0 (e); + } + __finally4: + if (_inner_error_ != NULL) { + _g_free0 (path); + _g_object_unref0 (art_file); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } + _g_free0 (path); + _g_object_unref0 (art_file); + return; + } + g_debug ("metadata-menu-item.vala:126: fetch_art -remotely %s", metadata_menuitem_album_art_cache_dir); + if (metadata_menuitem_album_art_cache_dir == NULL) { + _g_object_unref0 (art_file); + return; + } + _tmp10_ = fetch_file_new (uri, prop); + _g_object_unref0 (metadata_menuitem_fetcher); + metadata_menuitem_fetcher = _tmp10_; + g_signal_connect_object (metadata_menuitem_fetcher, "failed", (GCallback) __lambda0__fetch_file_failed, self, 0); + g_signal_connect_object (metadata_menuitem_fetcher, "completed", (GCallback) _metadata_menuitem_on_fetcher_completed_fetch_file_completed, self, 0); + fetch_file_fetch_data (metadata_menuitem_fetcher, NULL, NULL); + _g_object_unref0 (art_file); +} + + +static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self) { + g_return_if_fail (self != NULL); + g_warning ("metadata-menu-item.vala:141: on_fetcher_failed -> could not fetch artw" \ +"ork"); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property) { + GdkPixbufLoader* _tmp0_ = NULL; + GdkPixbufLoader* loader; + GdkPixbuf* _tmp1_ = NULL; + GdkPixbuf* _tmp2_; + GdkPixbuf* icon; + gchar* _tmp3_ = NULL; + gchar* path; + gint _tmp4_; + gint r; + GError * _inner_error_ = NULL; + g_return_if_fail (self != NULL); + g_return_if_fail (update != NULL); + g_return_if_fail (property != NULL); + _tmp0_ = gdk_pixbuf_loader_new (); + loader = _tmp0_; + gdk_pixbuf_loader_write (loader, update->data, (gsize) ((gint) update->len), &_inner_error_); + if (_inner_error_ != NULL) { + _g_object_unref0 (loader); + goto __catch5_g_error; + } + gdk_pixbuf_loader_close (loader, &_inner_error_); + if (_inner_error_ != NULL) { + _g_object_unref0 (loader); + goto __catch5_g_error; + } + _tmp1_ = gdk_pixbuf_loader_get_pixbuf (loader); + _tmp2_ = _g_object_ref0 (_tmp1_); + icon = _tmp2_; + _tmp3_ = g_strconcat (metadata_menuitem_album_art_cache_dir, "/downloaded-coverart-XXXXXX", NULL); + path = _tmp3_; + _tmp4_ = g_mkstemp (path); + r = _tmp4_; + if (r != (-1)) { + GdkPixbufFormat* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_; + _tmp5_ = gdk_pixbuf_loader_get_format (loader); + _tmp6_ = gdk_pixbuf_format_get_name (_tmp5_); + gdk_pixbuf_save (icon, path, _tmp6_, &_inner_error_, NULL); + if (_inner_error_ != NULL) { + _g_free0 (path); + _g_object_unref0 (icon); + _g_object_unref0 (loader); + goto __catch5_g_error; + } + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, path); + if (self->priv->previous_temp_album_art_path != NULL) { + g_remove (self->priv->previous_temp_album_art_path); + } + _tmp7_ = g_strdup (path); + _g_free0 (self->priv->previous_temp_album_art_path); + self->priv->previous_temp_album_art_path = _tmp7_; + } + _g_free0 (path); + _g_object_unref0 (icon); + _g_object_unref0 (loader); + goto __finally5; + __catch5_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("metadata-menu-item.vala:163: Problem creating file from bytearray fetc" \ +"hed from the interweb - error: %s", e->message); + _g_error_free0 (e); + } + __finally5: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } +} + + +static void metadata_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) { + MetadataMenuitem * self; + PlayerController* _tmp0_ = NULL; + self = (MetadataMenuitem*) base; + g_return_if_fail (name != NULL); + g_return_if_fail (input_value != NULL); + _tmp0_ = player_item_get_owner ((PlayerItem*) self); + if (_tmp0_->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) { + PlayerController* _tmp1_ = NULL; + _tmp1_ = player_item_get_owner ((PlayerItem*) self); + player_controller_instantiate (_tmp1_); + } else { + PlayerController* _tmp2_ = NULL; + _tmp2_ = player_item_get_owner ((PlayerItem*) self); + if (_tmp2_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED) { + PlayerController* _tmp3_ = NULL; + _tmp3_ = player_item_get_owner ((PlayerItem*) self); + mpris2_controller_expose (_tmp3_->mpris_bridge); + } + } +} + + +void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title) { + g_return_if_fail (self != NULL); + g_return_if_fail (new_title != NULL); + if (new_title == NULL) { + return; + } + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, new_title); +} + + +void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update) { + g_return_if_fail (self != NULL); + g_debug ("metadata-menu-item.vala:189: toggle active triangle"); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, update); +} + + +void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse) { + g_return_if_fail (self != NULL); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, collapse); +} + + +GeeHashSet* metadata_menuitem_attributes_format (void) { + GeeHashSet* result = NULL; + GeeHashSet* _tmp0_ = NULL; + GeeHashSet* attrs; + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + attrs = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TITLE); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTIST); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ALBUM); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTURL); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING); + result = attrs; + return result; +} + + +GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void) { + GeeHashSet* result = NULL; + GeeHashSet* _tmp0_ = NULL; + GeeHashSet* attrs; + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + attrs = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TITLE); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTIST); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ALBUM); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTURL); + result = attrs; + return result; +} + + +static GObject * metadata_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + MetadataMenuitem * self; + gchar* _tmp0_ = NULL; + PlayerController* _tmp1_ = NULL; + GAppInfo* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + PlayerController* _tmp4_ = NULL; + GAppInfo* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + PlayerController* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + GeeHashSet* _tmp9_ = NULL; + GeeHashSet* _tmp10_; + parent_class = G_OBJECT_CLASS (metadata_menuitem_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = METADATA_MENUITEM (obj); + metadata_menuitem_clean_album_art_temp_dir (); + _g_free0 (self->priv->previous_temp_album_art_path); + self->priv->previous_temp_album_art_path = NULL; + _tmp0_ = metadata_menuitem_create_album_art_temp_dir (); + _g_free0 (metadata_menuitem_album_art_cache_dir); + metadata_menuitem_album_art_cache_dir = _tmp0_; + _tmp1_ = player_item_get_owner ((PlayerItem*) self); + _tmp2_ = player_controller_get_app_info (_tmp1_); + _tmp3_ = g_app_info_get_name (_tmp2_); + g_debug ("metadata-menu-item.vala:42: JUST ABOUT TO ATTEMPT PLAYER NAME SETTING " \ +"%s", _tmp3_); + _tmp4_ = player_item_get_owner ((PlayerItem*) self); + _tmp5_ = player_controller_get_app_info (_tmp4_); + _tmp6_ = g_app_info_get_name (_tmp5_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp6_); + _tmp7_ = player_item_get_owner ((PlayerItem*) self); + _tmp8_ = player_controller_get_icon_name (_tmp7_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON, _tmp8_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, FALSE); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, TRUE); + _tmp9_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp10_ = _tmp9_; + player_item_reset ((PlayerItem*) self, _tmp10_); + _g_object_unref0 (_tmp10_); + return obj; +} + + +static void metadata_menuitem_class_init (MetadataMenuitemClass * klass) { + metadata_menuitem_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (MetadataMenuitemPrivate)); + DBUSMENU_MENUITEM_CLASS (klass)->handle_event = metadata_menuitem_real_handle_event; + G_OBJECT_CLASS (klass)->constructor = metadata_menuitem_constructor; + G_OBJECT_CLASS (klass)->finalize = metadata_menuitem_finalize; +} + + +static void metadata_menuitem_instance_init (MetadataMenuitem * self) { + self->priv = METADATA_MENUITEM_GET_PRIVATE (self); +} + + +static void metadata_menuitem_finalize (GObject* obj) { + MetadataMenuitem * self; + self = METADATA_MENUITEM (obj); + _g_free0 (self->priv->previous_temp_album_art_path); + G_OBJECT_CLASS (metadata_menuitem_parent_class)->finalize (obj); +} + + +GType metadata_menuitem_get_type (void) { + static volatile gsize metadata_menuitem_type_id__volatile = 0; + if (g_once_init_enter (&metadata_menuitem_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (MetadataMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) metadata_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MetadataMenuitem), 0, (GInstanceInitFunc) metadata_menuitem_instance_init, NULL }; + GType metadata_menuitem_type_id; + metadata_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "MetadataMenuitem", &g_define_type_info, 0); + g_once_init_leave (&metadata_menuitem_type_id__volatile, metadata_menuitem_type_id); + } + return metadata_menuitem_type_id__volatile; +} + + + diff --git a/src/mpris2-controller.c b/src/mpris2-controller.c new file mode 100644 index 0000000..8b3ad14 --- /dev/null +++ b/src/mpris2-controller.c @@ -0,0 +1,1391 @@ +/* mpris2-controller.c generated by valac 0.12.1, the Vala compiler + * generated from mpris2-controller.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <stdlib.h> +#include <string.h> +#include <common-defs.h> +#include <gee.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> + + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; +typedef struct _Mpris2ControllerPrivate Mpris2ControllerPrivate; + +#define TYPE_MPRIS_ROOT (mpris_root_get_type ()) +#define MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_ROOT, MprisRoot)) +#define IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_ROOT)) +#define MPRIS_ROOT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_ROOT, MprisRootIface)) + +typedef struct _MprisRoot MprisRoot; +typedef struct _MprisRootIface MprisRootIface; + +#define TYPE_MPRIS_ROOT_PROXY (mpris_root_proxy_get_type ()) + +#define TYPE_MPRIS_PLAYER (mpris_player_get_type ()) +#define MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYER, MprisPlayer)) +#define IS_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYER)) +#define MPRIS_PLAYER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYER, MprisPlayerIface)) + +typedef struct _MprisPlayer MprisPlayer; +typedef struct _MprisPlayerIface MprisPlayerIface; + +#define TYPE_MPRIS_PLAYER_PROXY (mpris_player_proxy_get_type ()) + +#define TYPE_MPRIS_PLAYLISTS (mpris_playlists_get_type ()) +#define MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylists)) +#define IS_MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYLISTS)) +#define MPRIS_PLAYLISTS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylistsIface)) + +typedef struct _MprisPlaylists MprisPlaylists; +typedef struct _MprisPlaylistsIface MprisPlaylistsIface; + +#define TYPE_MPRIS_PLAYLISTS_PROXY (mpris_playlists_proxy_get_type ()) + +#define TYPE_PLAYLIST_DETAILS (playlist_details_get_type ()) +typedef struct _PlaylistDetails PlaylistDetails; + +#define TYPE_ACTIVE_PLAYLIST_CONTAINER (active_playlist_container_get_type ()) +typedef struct _ActivePlaylistContainer ActivePlaylistContainer; + +#define TYPE_FREE_DESKTOP_PROPERTIES (free_desktop_properties_get_type ()) +#define FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopProperties)) +#define IS_FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_PROPERTIES)) +#define FREE_DESKTOP_PROPERTIES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopPropertiesIface)) + +typedef struct _FreeDesktopProperties FreeDesktopProperties; +typedef struct _FreeDesktopPropertiesIface FreeDesktopPropertiesIface; + +#define TYPE_FREE_DESKTOP_PROPERTIES_PROXY (free_desktop_properties_proxy_get_type ()) + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; + +#define PLAYER_CONTROLLER_TYPE_WIDGET_ORDER (player_controller_widget_order_get_type ()) + +#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ()) +#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem)) +#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) +#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM)) +#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM)) +#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) + +typedef struct _TransportMenuitem TransportMenuitem; +typedef struct _TransportMenuitemClass TransportMenuitemClass; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ()) +#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem)) +#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) +#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM)) +#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM)) +#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) + +typedef struct _MetadataMenuitem MetadataMenuitem; +typedef struct _MetadataMenuitemClass MetadataMenuitemClass; +#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL))) +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) + +#define TYPE_PLAYLISTS_MENUITEM (playlists_menuitem_get_type ()) +#define PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitem)) +#define PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) +#define IS_PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYLISTS_MENUITEM)) +#define IS_PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYLISTS_MENUITEM)) +#define PLAYLISTS_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) + +typedef struct _PlaylistsMenuitem PlaylistsMenuitem; +typedef struct _PlaylistsMenuitemClass PlaylistsMenuitemClass; +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +typedef struct _Mpris2ControllerFetchPlaylistsData Mpris2ControllerFetchPlaylistsData; + +struct _Mpris2Controller { + GObject parent_instance; + Mpris2ControllerPrivate * priv; +}; + +struct _Mpris2ControllerClass { + GObjectClass parent_class; +}; + +struct _MprisRootIface { + GTypeInterface parent_iface; + void (*Quit) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Quit_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + void (*Raise) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Raise_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + gboolean (*get_HasTracklist) (MprisRoot* self); + void (*set_HasTracklist) (MprisRoot* self, gboolean value); + gboolean (*get_CanQuit) (MprisRoot* self); + void (*set_CanQuit) (MprisRoot* self, gboolean value); + gboolean (*get_CanRaise) (MprisRoot* self); + void (*set_CanRaise) (MprisRoot* self, gboolean value); + gchar* (*get_Identity) (MprisRoot* self); + void (*set_Identity) (MprisRoot* self, const gchar* value); + gchar* (*get_DesktopEntry) (MprisRoot* self); + void (*set_DesktopEntry) (MprisRoot* self, const gchar* value); +}; + +struct _MprisPlayerIface { + GTypeInterface parent_iface; + void (*PlayPause) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*PlayPause_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Next) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Next_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Previous) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Previous_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Seek) (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Seek_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + GHashTable* (*get_Metadata) (MprisPlayer* self); + void (*set_Metadata) (MprisPlayer* self, GHashTable* value); + gint32 (*get_Position) (MprisPlayer* self); + void (*set_Position) (MprisPlayer* self, gint32 value); + gchar* (*get_PlaybackStatus) (MprisPlayer* self); + void (*set_PlaybackStatus) (MprisPlayer* self, const gchar* value); +}; + +struct _PlaylistDetails { + char* path; + gchar* name; + gchar* icon_path; +}; + +struct _ActivePlaylistContainer { + gboolean valid; + PlaylistDetails details; +}; + +struct _MprisPlaylistsIface { + GTypeInterface parent_iface; + void (*ActivatePlaylist) (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*ActivatePlaylist_finish) (MprisPlaylists* self, GAsyncResult* _res_, GError** error); + void (*GetPlaylists) (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); + PlaylistDetails* (*GetPlaylists_finish) (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); + gchar** (*get_Orderings) (MprisPlaylists* self, int* result_length1); + void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); + guint32 (*get_PlaylistCount) (MprisPlaylists* self); + void (*set_PlaylistCount) (MprisPlaylists* self, guint32 value); + void (*get_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); + void (*set_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); +}; + +struct _FreeDesktopPropertiesIface { + GTypeInterface parent_iface; +}; + +struct _Mpris2ControllerPrivate { + MprisRoot* _mpris2_root; + MprisPlayer* _player; + MprisPlaylists* _playlists; + FreeDesktopProperties* _properties_interface; + PlayerController* _owner; +}; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + +typedef enum { + PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, + PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS +} PlayerControllerwidget_order; + +struct _Mpris2ControllerFetchPlaylistsData { + int _state_; + GObject* _source_object_; + GAsyncResult* _res_; + GSimpleAsyncResult* _async_result; + Mpris2Controller* self; + PlaylistDetails* current_playlists; + gint current_playlists_length1; + gint _current_playlists_size_; + gint _tmp0_; + PlaylistDetails* _tmp1_; + PlaylistDetails* _tmp2_; + gint _tmp2__length1; + gint __tmp2__size_; + GError * e; + gpointer _tmp3_; + PlayerItem* _tmp4_; + PlaylistsMenuitem* playlists_item; + gboolean _tmp5_; + gboolean* _tmp6_; + GError * _inner_error_; +}; + + +static gpointer mpris2_controller_parent_class = NULL; + +GType mpris2_controller_get_type (void) G_GNUC_CONST; +GType mpris_root_proxy_get_type (void) G_GNUC_CONST; +guint mpris_root_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_root_get_type (void) G_GNUC_CONST; +GType mpris_player_proxy_get_type (void) G_GNUC_CONST; +guint mpris_player_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_player_get_type (void) G_GNUC_CONST; +GType mpris_playlists_proxy_get_type (void) G_GNUC_CONST; +guint mpris_playlists_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType playlist_details_get_type (void) G_GNUC_CONST; +PlaylistDetails* playlist_details_dup (const PlaylistDetails* self); +void playlist_details_free (PlaylistDetails* self); +void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest); +void playlist_details_destroy (PlaylistDetails* self); +GType active_playlist_container_get_type (void) G_GNUC_CONST; +ActivePlaylistContainer* active_playlist_container_dup (const ActivePlaylistContainer* self); +void active_playlist_container_free (ActivePlaylistContainer* self); +void active_playlist_container_copy (const ActivePlaylistContainer* self, ActivePlaylistContainer* dest); +void active_playlist_container_destroy (ActivePlaylistContainer* self); +GType mpris_playlists_get_type (void) G_GNUC_CONST; +GType free_desktop_properties_get_type (void) G_GNUC_CONST; +GType free_desktop_properties_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_properties_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType player_controller_get_type (void) G_GNUC_CONST; +#define MPRIS2_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerPrivate)) +enum { + MPRIS2_CONTROLLER_DUMMY_PROPERTY, + MPRIS2_CONTROLLER_MPRIS2_ROOT, + MPRIS2_CONTROLLER_PLAYER, + MPRIS2_CONTROLLER_PLAYLISTS, + MPRIS2_CONTROLLER_PROPERTIES_INTERFACE, + MPRIS2_CONTROLLER_OWNER +}; +Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); +Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); +void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1); +#define MPRIS_PREFIX "org.mpris.MediaPlayer2." +MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self); +gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self); +static gboolean mpris2_controller_ensure_correct_playback_status (Mpris2Controller* self); +static gboolean _mpris2_controller_ensure_correct_playback_status_gsource_func (gpointer self); +static TransportState mpris2_controller_determine_play_state (Mpris2Controller* self, const gchar* status); +PlayerController* mpris2_controller_get_owner (Mpris2Controller* self); +GType player_item_get_type (void) G_GNUC_CONST; +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; +void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update); +static gboolean mpris2_controller_ensure_correct_metadata (Mpris2Controller* self); +static gboolean _mpris2_controller_ensure_correct_metadata_gsource_func (gpointer self); +static gboolean _bool_equal (const gboolean* s1, const gboolean* s2); +static gboolean mpris2_controller_fetch_active_playlist (Mpris2Controller* self); +static gboolean _mpris2_controller_fetch_active_playlist_gsource_func (gpointer self); +void mpris2_controller_fetch_playlists (Mpris2Controller* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris2_controller_fetch_playlists_finish (Mpris2Controller* self, GAsyncResult* _res_); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; +void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title); +MprisRoot* mpris2_controller_get_mpris2_root (Mpris2Controller* self); +gchar* mpris_root_get_Identity (MprisRoot* self); +static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void); +void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); +void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse); +GHashTable* mpris_player_get_Metadata (MprisPlayer* self); +static GVariant* _variant_new1 (const gchar* value); +void mpris2_controller_initial_update (Mpris2Controller* self); +GeeHashSet* metadata_menuitem_attributes_format (void); +void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction command); +void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Previous (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Next (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Seek (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +gboolean mpris2_controller_connected (Mpris2Controller* self); +void mpris2_controller_expose (Mpris2Controller* self); +void mpris_root_Raise (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_root_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +static void mpris2_controller_on_playlistdetails_changed (Mpris2Controller* self, PlaylistDetails* details); +GType playlists_menuitem_get_type (void) G_GNUC_CONST; +void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail); +static void mpris2_controller_fetch_playlists_data_free (gpointer _data); +static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* data); +MprisPlaylists* mpris2_controller_get_playlists (Mpris2Controller* self); +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); +static void mpris2_controller_fetch_playlists_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length); +void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1); +static gboolean* _bool_dup (gboolean* self); +void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail); +void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* path); +void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); +static void mpris2_controller_set_mpris2_root (Mpris2Controller* self, MprisRoot* value); +static void mpris2_controller_set_player (Mpris2Controller* self, MprisPlayer* value); +static void mpris2_controller_set_playlists (Mpris2Controller* self, MprisPlaylists* value); +FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self); +static void mpris2_controller_set_properties_interface (Mpris2Controller* self, FreeDesktopProperties* value); +static void mpris2_controller_set_owner (Mpris2Controller* self, PlayerController* value); +static GObject * mpris2_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +const gchar* player_controller_get_dbus_name (PlayerController* self); +static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer self); +static void _mpris2_controller_on_playlistdetails_changed_mpris_playlists_playlist_changed (MprisPlaylists* _sender, PlaylistDetails* details, gpointer self); +static void mpris2_controller_finalize (GObject* obj); +static void _vala_mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl) { + Mpris2Controller * self = NULL; + g_return_val_if_fail (ctrl != NULL, NULL); + self = (Mpris2Controller*) g_object_new (object_type, "owner", ctrl, NULL); + return self; +} + + +Mpris2Controller* mpris2_controller_new (PlayerController* ctrl) { + return mpris2_controller_construct (TYPE_MPRIS2_CONTROLLER, ctrl); +} + + +static gpointer _g_variant_ref0 (gpointer self) { + return self ? g_variant_ref (self) : NULL; +} + + +static gboolean _mpris2_controller_ensure_correct_playback_status_gsource_func (gpointer self) { + gboolean result; + result = mpris2_controller_ensure_correct_playback_status (self); + return result; +} + + +static gboolean _mpris2_controller_ensure_correct_metadata_gsource_func (gpointer self) { + gboolean result; + result = mpris2_controller_ensure_correct_metadata (self); + return result; +} + + +static gboolean _bool_equal (const gboolean* s1, const gboolean* s2) { + if (s1 == s2) { + return TRUE; + } + if (s1 == NULL) { + return FALSE; + } + if (s2 == NULL) { + return FALSE; + } + return (*s1) == (*s2); +} + + +static gboolean _mpris2_controller_fetch_active_playlist_gsource_func (gpointer self) { + gboolean result; + result = mpris2_controller_fetch_active_playlist (self); + return result; +} + + +void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1) { + gboolean _tmp0_ = FALSE; + gconstpointer _tmp2_ = NULL; + GVariant* _tmp3_; + GVariant* play_v; + gconstpointer _tmp9_ = NULL; + GVariant* _tmp10_; + GVariant* meta_v; + gconstpointer _tmp11_ = NULL; + GVariant* _tmp12_; + GVariant* playlist_v; + gboolean _tmp13_ = FALSE; + gconstpointer _tmp15_ = NULL; + GVariant* _tmp16_; + GVariant* playlist_count_v; + gboolean _tmp17_ = FALSE; + gconstpointer _tmp19_ = NULL; + GVariant* _tmp20_; + GVariant* playlist_orderings_v; + gboolean _tmp21_ = FALSE; + gconstpointer _tmp23_ = NULL; + GVariant* _tmp24_; + GVariant* identity_v; + g_return_if_fail (self != NULL); + g_return_if_fail (interface_source != NULL); + g_return_if_fail (changed_properties != NULL); + if (changed_properties == NULL) { + _tmp0_ = TRUE; + } else { + gboolean _tmp1_; + _tmp1_ = g_str_has_prefix (interface_source, MPRIS_PREFIX); + _tmp0_ = _tmp1_ == FALSE; + } + if (_tmp0_) { + g_warning ("mpris2-controller.vala:77: Property-changed hash is null or this is an" \ +" interface that doesn't concern us"); + return; + } + _tmp2_ = g_hash_table_lookup (changed_properties, "PlaybackStatus"); + _tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_); + play_v = _tmp3_; + if (play_v != NULL) { + gchar* _tmp4_ = NULL; + gchar* state; + TransportState _tmp5_; + TransportState p; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; + TransportMenuitem* _tmp8_; + _tmp4_ = mpris_player_get_PlaybackStatus (self->priv->_player); + state = _tmp4_; + g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _mpris2_controller_ensure_correct_playback_status_gsource_func, g_object_ref (self), g_object_unref); + _tmp5_ = mpris2_controller_determine_play_state (self, state); + p = (TransportState) _tmp5_; + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp7_ = (PlayerItem*) _tmp6_; + _tmp8_ = IS_TRANSPORT_MENUITEM (_tmp7_) ? ((TransportMenuitem*) _tmp7_) : NULL; + transport_menuitem_change_play_state (_tmp8_, p); + _g_object_unref0 (_tmp8_); + _g_free0 (state); + } + _tmp9_ = g_hash_table_lookup (changed_properties, "Metadata"); + _tmp10_ = _g_variant_ref0 ((GVariant*) _tmp9_); + meta_v = _tmp10_; + if (meta_v != NULL) { + g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _mpris2_controller_ensure_correct_metadata_gsource_func, g_object_ref (self), g_object_unref); + } + _tmp11_ = g_hash_table_lookup (changed_properties, "ActivePlaylist"); + _tmp12_ = _g_variant_ref0 ((GVariant*) _tmp11_); + playlist_v = _tmp12_; + if (playlist_v != NULL) { + gboolean _tmp14_; + _tmp14_ = TRUE; + _tmp13_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp14_) == TRUE; + } else { + _tmp13_ = FALSE; + } + if (_tmp13_) { + g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, _mpris2_controller_fetch_active_playlist_gsource_func, g_object_ref (self), g_object_unref); + } + _tmp15_ = g_hash_table_lookup (changed_properties, "PlaylistCount"); + _tmp16_ = _g_variant_ref0 ((GVariant*) _tmp15_); + playlist_count_v = _tmp16_; + if (playlist_count_v != NULL) { + gboolean _tmp18_; + _tmp18_ = TRUE; + _tmp17_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp18_) == TRUE; + } else { + _tmp17_ = FALSE; + } + if (_tmp17_) { + mpris2_controller_fetch_playlists (self, NULL, NULL); + mpris2_controller_fetch_active_playlist (self); + } + _tmp19_ = g_hash_table_lookup (changed_properties, "Orderings"); + _tmp20_ = _g_variant_ref0 ((GVariant*) _tmp19_); + playlist_orderings_v = _tmp20_; + if (playlist_orderings_v != NULL) { + gboolean _tmp22_; + _tmp22_ = TRUE; + _tmp21_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp22_) == TRUE; + } else { + _tmp21_ = FALSE; + } + if (_tmp21_) { + mpris2_controller_fetch_playlists (self, NULL, NULL); + mpris2_controller_fetch_active_playlist (self); + } + _tmp23_ = g_hash_table_lookup (changed_properties, "Identity"); + _tmp24_ = _g_variant_ref0 ((GVariant*) _tmp23_); + identity_v = _tmp24_; + if (identity_v != NULL) { + gpointer _tmp25_ = NULL; + PlayerItem* _tmp26_; + MetadataMenuitem* md; + gchar* _tmp27_ = NULL; + gchar* _tmp28_; + _tmp25_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp26_ = (PlayerItem*) _tmp25_; + md = IS_METADATA_MENUITEM (_tmp26_) ? ((MetadataMenuitem*) _tmp26_) : NULL; + _tmp27_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp28_ = _tmp27_; + metadata_menuitem_alter_label (md, _tmp28_); + _g_free0 (_tmp28_); + _g_object_unref0 (md); + } + _g_variant_unref0 (identity_v); + _g_variant_unref0 (playlist_orderings_v); + _g_variant_unref0 (playlist_count_v); + _g_variant_unref0 (playlist_v); + _g_variant_unref0 (meta_v); + _g_variant_unref0 (play_v); +} + + +static gboolean mpris2_controller_ensure_correct_metadata (Mpris2Controller* self) { + gboolean result = FALSE; + GHashTable* _tmp0_ = NULL; + GHashTable* changed_updates; + gpointer _tmp1_ = NULL; + PlayerItem* metadata; + GeeHashSet* _tmp2_ = NULL; + GeeHashSet* _tmp3_; + GeeHashSet* _tmp4_ = NULL; + GeeHashSet* _tmp5_; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; + MetadataMenuitem* md; + GeeHashSet* _tmp8_ = NULL; + GeeHashSet* _tmp9_; + gboolean _tmp10_; + gboolean _tmp11_; + gboolean collapsing; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = mpris2_controller_clean_metadata (self); + changed_updates = _tmp0_; + _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + metadata = (PlayerItem*) _tmp1_; + _tmp2_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp3_ = _tmp2_; + player_item_reset (metadata, _tmp3_); + _g_object_unref0 (_tmp3_); + _tmp4_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp5_ = _tmp4_; + player_item_update (metadata, changed_updates, _tmp5_); + _g_object_unref0 (_tmp5_); + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp7_ = (PlayerItem*) _tmp6_; + md = IS_METADATA_MENUITEM (_tmp7_) ? ((MetadataMenuitem*) _tmp7_) : NULL; + _tmp8_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp9_ = _tmp8_; + _tmp10_ = player_item_populated (metadata, _tmp9_); + _tmp11_ = !_tmp10_; + _g_object_unref0 (_tmp9_); + collapsing = _tmp11_; + metadata_menuitem_should_collapse (md, collapsing); + result = FALSE; + _g_object_unref0 (md); + _g_object_unref0 (metadata); + _g_hash_table_unref0 (changed_updates); + return result; +} + + +static gboolean mpris2_controller_ensure_correct_playback_status (Mpris2Controller* self) { + gboolean result = FALSE; + gchar* _tmp0_ = NULL; + gchar* _tmp1_; + TransportState _tmp2_; + TransportState _tmp3_; + TransportState p; + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; + TransportMenuitem* _tmp6_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp1_ = _tmp0_; + _tmp2_ = mpris2_controller_determine_play_state (self, _tmp1_); + _tmp3_ = (TransportState) _tmp2_; + _g_free0 (_tmp1_); + p = _tmp3_; + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp5_ = (PlayerItem*) _tmp4_; + _tmp6_ = IS_TRANSPORT_MENUITEM (_tmp5_) ? ((TransportMenuitem*) _tmp5_) : NULL; + transport_menuitem_change_play_state (_tmp6_, p); + _g_object_unref0 (_tmp6_); + result = FALSE; + return result; +} + + +static GVariant* _variant_new1 (const gchar* value) { + return g_variant_ref_sink (g_variant_new_string (value)); +} + + +static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self) { + GHashTable* result = NULL; + GHashTable* _tmp0_ = NULL; + GHashTable* changed_updates; + GHashTable* _tmp1_ = NULL; + GHashTable* _tmp2_; + gconstpointer _tmp3_ = NULL; + GVariant* _tmp4_; + GVariant* _tmp5_; + GVariant* artist_v; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = mpris_player_get_Metadata (self->priv->_player); + changed_updates = _tmp0_; + _tmp1_ = mpris_player_get_Metadata (self->priv->_player); + _tmp2_ = _tmp1_; + _tmp3_ = g_hash_table_lookup (_tmp2_, "xesam:artist"); + _tmp4_ = _g_variant_ref0 ((GVariant*) _tmp3_); + _tmp5_ = _tmp4_; + _g_hash_table_unref0 (_tmp2_); + artist_v = _tmp5_; + if (artist_v != NULL) { + gchar* display_artists = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp12_; + _tmp6_ = g_variant_get_type_string (artist_v); + if (g_strcmp0 (_tmp6_, "s") == 0) { + const gchar* _tmp7_ = NULL; + gchar* _tmp8_; + _tmp7_ = g_variant_get_string (artist_v, NULL); + _tmp8_ = g_strdup (_tmp7_); + _g_free0 (display_artists); + display_artists = _tmp8_; + } else { + size_t _tmp9_; + gchar** _tmp10_ = NULL; + gchar** artists; + gint artists_length1; + gint _artists_size_; + gchar* _tmp11_ = NULL; + _tmp10_ = g_variant_dup_strv (artist_v, &_tmp9_); + artists = _tmp10_; + artists_length1 = _tmp9_; + _artists_size_ = _tmp9_; + _tmp11_ = g_strjoinv (", ", artists); + _g_free0 (display_artists); + display_artists = _tmp11_; + artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL); + } + _tmp12_ = g_strdup ("xesam:artist"); + g_hash_table_replace (changed_updates, _tmp12_, _variant_new1 (display_artists)); + _g_free0 (display_artists); + } + result = changed_updates; + _g_variant_unref0 (artist_v); + return result; +} + + +static TransportState mpris2_controller_determine_play_state (Mpris2Controller* self, const gchar* status) { + TransportState result = 0; + gboolean _tmp0_ = FALSE; + g_return_val_if_fail (self != NULL, 0); + if (status != NULL) { + _tmp0_ = g_strcmp0 (status, "Playing") == 0; + } else { + _tmp0_ = FALSE; + } + if (_tmp0_) { + result = TRANSPORT_STATE_PLAYING; + return result; + } + result = TRANSPORT_STATE_PAUSED; + return result; +} + + +void mpris2_controller_initial_update (Mpris2Controller* self) { + TransportState update = 0; + gchar* _tmp0_ = NULL; + gchar* _tmp1_; + gboolean _tmp2_; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gboolean _tmp8_; + gpointer _tmp13_ = NULL; + PlayerItem* _tmp14_; + TransportMenuitem* _tmp15_; + GHashTable* _tmp16_ = NULL; + GHashTable* cleaned_metadata; + gpointer _tmp17_ = NULL; + PlayerItem* _tmp18_; + GeeHashSet* _tmp19_ = NULL; + GeeHashSet* _tmp20_; + gboolean _tmp21_; + g_return_if_fail (self != NULL); + _tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_ == NULL; + _g_free0 (_tmp1_); + if (_tmp2_) { + update = TRANSPORT_STATE_PAUSED; + } else { + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + TransportState _tmp5_; + _tmp3_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp4_ = _tmp3_; + _tmp5_ = mpris2_controller_determine_play_state (self, _tmp4_); + update = _tmp5_; + _g_free0 (_tmp4_); + } + _tmp6_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp7_ = _tmp6_; + _tmp8_ = _tmp7_ != NULL; + _g_free0 (_tmp7_); + if (_tmp8_) { + gpointer _tmp9_ = NULL; + PlayerItem* _tmp10_; + MetadataMenuitem* md; + gchar* _tmp11_ = NULL; + gchar* _tmp12_; + _tmp9_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp10_ = (PlayerItem*) _tmp9_; + md = IS_METADATA_MENUITEM (_tmp10_) ? ((MetadataMenuitem*) _tmp10_) : NULL; + _tmp11_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp12_ = _tmp11_; + metadata_menuitem_alter_label (md, _tmp12_); + _g_free0 (_tmp12_); + _g_object_unref0 (md); + } + _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp14_ = (PlayerItem*) _tmp13_; + _tmp15_ = IS_TRANSPORT_MENUITEM (_tmp14_) ? ((TransportMenuitem*) _tmp14_) : NULL; + transport_menuitem_change_play_state (_tmp15_, update); + _g_object_unref0 (_tmp15_); + _tmp16_ = mpris2_controller_clean_metadata (self); + cleaned_metadata = _tmp16_; + _tmp17_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp18_ = (PlayerItem*) _tmp17_; + _tmp19_ = metadata_menuitem_attributes_format (); + _tmp20_ = _tmp19_; + player_item_update (_tmp18_, cleaned_metadata, _tmp20_); + _g_object_unref0 (_tmp20_); + _g_object_unref0 (_tmp18_); + _tmp21_ = TRUE; + if (_bool_equal (self->priv->_owner->use_playlists, &_tmp21_) == TRUE) { + mpris2_controller_fetch_playlists (self, NULL, NULL); + mpris2_controller_fetch_active_playlist (self); + } + _g_hash_table_unref0 (cleaned_metadata); +} + + +void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction command) { + g_return_if_fail (self != NULL); + if (command == TRANSPORT_ACTION_PLAY_PAUSE) { + mpris_player_PlayPause (self->priv->_player, NULL, NULL); + } else { + if (command == TRANSPORT_ACTION_PREVIOUS) { + mpris_player_Previous (self->priv->_player, NULL, NULL); + } else { + if (command == TRANSPORT_ACTION_NEXT) { + mpris_player_Next (self->priv->_player, NULL, NULL); + } else { + if (command == TRANSPORT_ACTION_REWIND) { + mpris_player_Seek (self->priv->_player, (gint64) (-500000), NULL, NULL); + } else { + if (command == TRANSPORT_ACTION_FORWIND) { + mpris_player_Seek (self->priv->_player, (gint64) 400000, NULL, NULL); + } + } + } + } + } +} + + +gboolean mpris2_controller_connected (Mpris2Controller* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + if (self->priv->_player != NULL) { + _tmp0_ = self->priv->_mpris2_root != NULL; + } else { + _tmp0_ = FALSE; + } + result = _tmp0_; + return result; +} + + +void mpris2_controller_expose (Mpris2Controller* self) { + gboolean _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = mpris2_controller_connected (self); + if (_tmp0_ == TRUE) { + mpris_root_Raise (self->priv->_mpris2_root, NULL, NULL); + } +} + + +static void mpris2_controller_on_playlistdetails_changed (Mpris2Controller* self, PlaylistDetails* details) { + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; + PlaylistsMenuitem* playlists_item; + g_return_if_fail (self != NULL); + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp1_ = (PlayerItem*) _tmp0_; + playlists_item = IS_PLAYLISTS_MENUITEM (_tmp1_) ? ((PlaylistsMenuitem*) _tmp1_) : NULL; + playlists_menuitem_update_individual_playlist (playlists_item, details); + _g_object_unref0 (playlists_item); +} + + +static void mpris2_controller_fetch_playlists_data_free (gpointer _data) { + Mpris2ControllerFetchPlaylistsData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (Mpris2ControllerFetchPlaylistsData, data); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void mpris2_controller_fetch_playlists (Mpris2Controller* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + Mpris2ControllerFetchPlaylistsData* _data_; + _data_ = g_slice_new0 (Mpris2ControllerFetchPlaylistsData); + _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, mpris2_controller_fetch_playlists); + g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, mpris2_controller_fetch_playlists_data_free); + _data_->self = _g_object_ref0 (self); + mpris2_controller_fetch_playlists_co (_data_); +} + + +void mpris2_controller_fetch_playlists_finish (Mpris2Controller* self, GAsyncResult* _res_) { + Mpris2ControllerFetchPlaylistsData* _data_; + _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); +} + + +static void mpris2_controller_fetch_playlists_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { + Mpris2ControllerFetchPlaylistsData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + mpris2_controller_fetch_playlists_co (data); +} + + +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length) { + if (array != NULL) { + int i; + for (i = 0; i < array_length; i = i + 1) { + playlist_details_destroy (&array[i]); + } + } + g_free (array); +} + + +static gboolean* _bool_dup (gboolean* self) { + gboolean* dup; + dup = g_new0 (gboolean, 1); + memcpy (dup, self, sizeof (gboolean)); + return dup; +} + + +static gpointer __bool_dup0 (gpointer self) { + return self ? _bool_dup (self) : NULL; +} + + +static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* data) { + switch (data->_state_) { + case 0: + goto _state_0; + case 1: + goto _state_1; + default: + g_assert_not_reached (); + } + _state_0: + data->current_playlists = NULL; + data->current_playlists_length1 = 0; + data->_current_playlists_size_ = 0; + data->_state_ = 1; + mpris_playlists_GetPlaylists (data->self->priv->_playlists, (guint32) 0, (guint32) 10, "Alphabetical", FALSE, mpris2_controller_fetch_playlists_ready, data); + return FALSE; + _state_1: + data->_tmp1_ = NULL; + data->_tmp1_ = mpris_playlists_GetPlaylists_finish (data->self->priv->_playlists, data->_res_, &data->_tmp0_, &data->_inner_error_); + data->_tmp2_ = data->_tmp1_; + data->_tmp2__length1 = data->_tmp0_; + data->__tmp2__size_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + if (data->_inner_error_->domain == G_IO_ERROR) { + goto __catch11_g_io_error; + } + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + data->current_playlists = data->_tmp2_; + data->current_playlists_length1 = data->_tmp2__length1; + data->_current_playlists_size_ = data->_tmp2__length1; + goto __finally11; + __catch11_g_io_error: + { + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + _g_error_free0 (data->e); + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; + } + __finally11: + if (data->_inner_error_ != NULL) { + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + if (data->current_playlists != NULL) { + data->_tmp3_ = NULL; + data->_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) data->self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + data->_tmp4_ = (PlayerItem*) data->_tmp3_; + data->playlists_item = IS_PLAYLISTS_MENUITEM (data->_tmp4_) ? ((PlaylistsMenuitem*) data->_tmp4_) : NULL; + playlists_menuitem_update (data->playlists_item, data->current_playlists, data->current_playlists_length1); + _g_object_unref0 (data->playlists_item); + } else { + g_warning ("mpris2-controller.vala:242: Playlists are on but its returning no cur" \ +"rent_playlists"); + data->_tmp5_ = FALSE; + data->_tmp6_ = __bool_dup0 (&data->_tmp5_); + _g_free0 (data->self->priv->_owner->use_playlists); + data->self->priv->_owner->use_playlists = data->_tmp6_; + } + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; +} + + +static gboolean mpris2_controller_fetch_active_playlist (Mpris2Controller* self) { + gboolean result = FALSE; + ActivePlaylistContainer _tmp0_ = {0}; + ActivePlaylistContainer _tmp1_; + gboolean _tmp2_; + gpointer _tmp3_ = NULL; + PlayerItem* _tmp4_; + PlaylistsMenuitem* playlists_item; + ActivePlaylistContainer _tmp5_ = {0}; + ActivePlaylistContainer _tmp6_; + g_return_val_if_fail (self != NULL, FALSE); + mpris_playlists_get_ActivePlaylist (self->priv->_playlists, &_tmp0_); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_.valid == FALSE; + active_playlist_container_destroy (&_tmp1_); + if (_tmp2_) { + } + _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp4_ = (PlayerItem*) _tmp3_; + playlists_item = IS_PLAYLISTS_MENUITEM (_tmp4_) ? ((PlaylistsMenuitem*) _tmp4_) : NULL; + mpris_playlists_get_ActivePlaylist (self->priv->_playlists, &_tmp5_); + _tmp6_ = _tmp5_; + playlists_menuitem_active_playlist_update (playlists_item, &_tmp6_.details); + active_playlist_container_destroy (&_tmp6_); + result = FALSE; + _g_object_unref0 (playlists_item); + return result; +} + + +void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* path) { + GError * _inner_error_ = NULL; + g_return_if_fail (self != NULL); + g_return_if_fail (path != NULL); + mpris_playlists_ActivatePlaylist (self->priv->_playlists, path, NULL, NULL); + goto __finally12; + __catch12_g_io_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("mpris2-controller.vala:264: Could not activate playlist %s because %s", (const gchar*) path, e->message); + _g_error_free0 (e); + } + __finally12: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } +} + + +MprisRoot* mpris2_controller_get_mpris2_root (Mpris2Controller* self) { + MprisRoot* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_mpris2_root; + return result; +} + + +static void mpris2_controller_set_mpris2_root (Mpris2Controller* self, MprisRoot* value) { + MprisRoot* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_mpris2_root); + self->priv->_mpris2_root = _tmp0_; + g_object_notify ((GObject *) self, "mpris2-root"); +} + + +MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self) { + MprisPlayer* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_player; + return result; +} + + +static void mpris2_controller_set_player (Mpris2Controller* self, MprisPlayer* value) { + MprisPlayer* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_player); + self->priv->_player = _tmp0_; + g_object_notify ((GObject *) self, "player"); +} + + +MprisPlaylists* mpris2_controller_get_playlists (Mpris2Controller* self) { + MprisPlaylists* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_playlists; + return result; +} + + +static void mpris2_controller_set_playlists (Mpris2Controller* self, MprisPlaylists* value) { + MprisPlaylists* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_playlists); + self->priv->_playlists = _tmp0_; + g_object_notify ((GObject *) self, "playlists"); +} + + +FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self) { + FreeDesktopProperties* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_properties_interface; + return result; +} + + +static void mpris2_controller_set_properties_interface (Mpris2Controller* self, FreeDesktopProperties* value) { + FreeDesktopProperties* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_properties_interface); + self->priv->_properties_interface = _tmp0_; + g_object_notify ((GObject *) self, "properties-interface"); +} + + +PlayerController* mpris2_controller_get_owner (Mpris2Controller* self) { + PlayerController* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_owner; + return result; +} + + +static void mpris2_controller_set_owner (Mpris2Controller* self, PlayerController* value) { + PlayerController* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_owner); + self->priv->_owner = _tmp0_; + g_object_notify ((GObject *) self, "owner"); +} + + +static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer self) { + mpris2_controller_property_changed_cb (self, source, changed_properties, invalid, invalid_length1); +} + + +static void _mpris2_controller_on_playlistdetails_changed_mpris_playlists_playlist_changed (MprisPlaylists* _sender, PlaylistDetails* details, gpointer self) { + mpris2_controller_on_playlistdetails_changed (self, details); +} + + +static GObject * mpris2_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + Mpris2Controller * self; + const gchar* _tmp0_ = NULL; + MprisRoot* _tmp1_ = NULL; + MprisRoot* _tmp2_; + MprisRoot* _tmp3_; + const gchar* _tmp4_ = NULL; + MprisPlayer* _tmp5_ = NULL; + MprisPlayer* _tmp6_; + MprisPlayer* _tmp7_; + FreeDesktopProperties* _tmp8_ = NULL; + FreeDesktopProperties* _tmp9_; + FreeDesktopProperties* _tmp10_; + gboolean _tmp11_; + GError * _inner_error_ = NULL; + parent_class = G_OBJECT_CLASS (mpris2_controller_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = MPRIS2_CONTROLLER (obj); + _tmp0_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp1_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp0_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2", NULL); + _tmp2_ = (MprisRoot*) _tmp1_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; + } + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + _tmp3_ = _tmp2_; + mpris2_controller_set_mpris2_root (self, _tmp3_); + _g_object_unref0 (_tmp3_); + _tmp4_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp5_ = g_initable_new (TYPE_MPRIS_PLAYER_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp4_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Player", NULL); + _tmp6_ = (MprisPlayer*) _tmp5_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; + } + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + _tmp7_ = _tmp6_; + mpris2_controller_set_player (self, _tmp7_); + _g_object_unref0 (_tmp7_); + _tmp8_ = g_initable_new (TYPE_FREE_DESKTOP_PROPERTIES_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", "org.freedesktop.Properties.PropertiesChanged", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.freedesktop.DBus.Properties", NULL); + _tmp9_ = (FreeDesktopProperties*) _tmp8_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; + } + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + _tmp10_ = _tmp9_; + mpris2_controller_set_properties_interface (self, _tmp10_); + _g_object_unref0 (_tmp10_); + g_signal_connect_object (self->priv->_properties_interface, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0); + _tmp11_ = TRUE; + if (_bool_equal (self->priv->_owner->use_playlists, &_tmp11_) == TRUE) { + const gchar* _tmp12_ = NULL; + MprisPlaylists* _tmp13_ = NULL; + MprisPlaylists* _tmp14_; + MprisPlaylists* _tmp15_; + _tmp12_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp13_ = g_initable_new (TYPE_MPRIS_PLAYLISTS_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp12_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Playlists", NULL); + _tmp14_ = (MprisPlaylists*) _tmp13_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; + } + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + _tmp15_ = _tmp14_; + mpris2_controller_set_playlists (self, _tmp15_); + _g_object_unref0 (_tmp15_); + g_signal_connect_object (self->priv->_playlists, "playlist-changed", (GCallback) _mpris2_controller_on_playlistdetails_changed_mpris_playlists_playlist_changed, self, 0); + } + goto __finally13; + __catch13_g_io_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_critical ("mpris2-controller.vala:56: Problems connecting to the session bus - %s", e->message); + _g_error_free0 (e); + } + __finally13: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + return obj; +} + + +static void mpris2_controller_class_init (Mpris2ControllerClass * klass) { + mpris2_controller_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (Mpris2ControllerPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_mpris2_controller_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_mpris2_controller_set_property; + G_OBJECT_CLASS (klass)->constructor = mpris2_controller_constructor; + G_OBJECT_CLASS (klass)->finalize = mpris2_controller_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_MPRIS2_ROOT, g_param_spec_object ("mpris2-root", "mpris2-root", "mpris2-root", TYPE_MPRIS_ROOT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_PLAYER, g_param_spec_object ("player", "player", "player", TYPE_MPRIS_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_PLAYLISTS, g_param_spec_object ("playlists", "playlists", "playlists", TYPE_MPRIS_PLAYLISTS, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_PROPERTIES_INTERFACE, g_param_spec_object ("properties-interface", "properties-interface", "properties-interface", TYPE_FREE_DESKTOP_PROPERTIES, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_OWNER, g_param_spec_object ("owner", "owner", "owner", TYPE_PLAYER_CONTROLLER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static void mpris2_controller_instance_init (Mpris2Controller * self) { + self->priv = MPRIS2_CONTROLLER_GET_PRIVATE (self); +} + + +static void mpris2_controller_finalize (GObject* obj) { + Mpris2Controller * self; + self = MPRIS2_CONTROLLER (obj); + _g_object_unref0 (self->priv->_mpris2_root); + _g_object_unref0 (self->priv->_player); + _g_object_unref0 (self->priv->_playlists); + _g_object_unref0 (self->priv->_properties_interface); + _g_object_unref0 (self->priv->_owner); + G_OBJECT_CLASS (mpris2_controller_parent_class)->finalize (obj); +} + + +GType mpris2_controller_get_type (void) { + static volatile gsize mpris2_controller_type_id__volatile = 0; + if (g_once_init_enter (&mpris2_controller_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (Mpris2ControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mpris2_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Mpris2Controller), 0, (GInstanceInitFunc) mpris2_controller_instance_init, NULL }; + GType mpris2_controller_type_id; + mpris2_controller_type_id = g_type_register_static (G_TYPE_OBJECT, "Mpris2Controller", &g_define_type_info, 0); + g_once_init_leave (&mpris2_controller_type_id__volatile, mpris2_controller_type_id); + } + return mpris2_controller_type_id__volatile; +} + + +static void _vala_mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + Mpris2Controller * self; + self = MPRIS2_CONTROLLER (object); + switch (property_id) { + case MPRIS2_CONTROLLER_MPRIS2_ROOT: + g_value_set_object (value, mpris2_controller_get_mpris2_root (self)); + break; + case MPRIS2_CONTROLLER_PLAYER: + g_value_set_object (value, mpris2_controller_get_player (self)); + break; + case MPRIS2_CONTROLLER_PLAYLISTS: + g_value_set_object (value, mpris2_controller_get_playlists (self)); + break; + case MPRIS2_CONTROLLER_PROPERTIES_INTERFACE: + g_value_set_object (value, mpris2_controller_get_properties_interface (self)); + break; + case MPRIS2_CONTROLLER_OWNER: + g_value_set_object (value, mpris2_controller_get_owner (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + Mpris2Controller * self; + self = MPRIS2_CONTROLLER (object); + switch (property_id) { + case MPRIS2_CONTROLLER_MPRIS2_ROOT: + mpris2_controller_set_mpris2_root (self, g_value_get_object (value)); + break; + case MPRIS2_CONTROLLER_PLAYER: + mpris2_controller_set_player (self, g_value_get_object (value)); + break; + case MPRIS2_CONTROLLER_PLAYLISTS: + mpris2_controller_set_playlists (self, g_value_get_object (value)); + break; + case MPRIS2_CONTROLLER_PROPERTIES_INTERFACE: + mpris2_controller_set_properties_interface (self, g_value_get_object (value)); + break; + case MPRIS2_CONTROLLER_OWNER: + mpris2_controller_set_owner (self, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/src/mpris2-interfaces.c b/src/mpris2-interfaces.c new file mode 100644 index 0000000..b288a8f --- /dev/null +++ b/src/mpris2-interfaces.c @@ -0,0 +1,2601 @@ +/* mpris2-interfaces.c generated by valac 0.12.1, the Vala compiler + * generated from mpris2-interfaces.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <gio/gio.h> + + +#define TYPE_MPRIS_ROOT (mpris_root_get_type ()) +#define MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_ROOT, MprisRoot)) +#define IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_ROOT)) +#define MPRIS_ROOT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_ROOT, MprisRootIface)) + +typedef struct _MprisRoot MprisRoot; +typedef struct _MprisRootIface MprisRootIface; + +#define TYPE_MPRIS_ROOT_PROXY (mpris_root_proxy_get_type ()) +typedef GDBusProxy MprisRootProxy; +typedef GDBusProxyClass MprisRootProxyClass; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define TYPE_MPRIS_PLAYER (mpris_player_get_type ()) +#define MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYER, MprisPlayer)) +#define IS_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYER)) +#define MPRIS_PLAYER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYER, MprisPlayerIface)) + +typedef struct _MprisPlayer MprisPlayer; +typedef struct _MprisPlayerIface MprisPlayerIface; + +#define TYPE_MPRIS_PLAYER_PROXY (mpris_player_proxy_get_type ()) +typedef GDBusProxy MprisPlayerProxy; +typedef GDBusProxyClass MprisPlayerProxyClass; +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) + +#define TYPE_PLAYLIST_DETAILS (playlist_details_get_type ()) +typedef struct _PlaylistDetails PlaylistDetails; + +#define TYPE_ACTIVE_PLAYLIST_CONTAINER (active_playlist_container_get_type ()) +typedef struct _ActivePlaylistContainer ActivePlaylistContainer; + +#define TYPE_MPRIS_PLAYLISTS (mpris_playlists_get_type ()) +#define MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylists)) +#define IS_MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYLISTS)) +#define MPRIS_PLAYLISTS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylistsIface)) + +typedef struct _MprisPlaylists MprisPlaylists; +typedef struct _MprisPlaylistsIface MprisPlaylistsIface; + +#define TYPE_MPRIS_PLAYLISTS_PROXY (mpris_playlists_proxy_get_type ()) +typedef GDBusProxy MprisPlaylistsProxy; +typedef GDBusProxyClass MprisPlaylistsProxyClass; + +struct _MprisRootIface { + GTypeInterface parent_iface; + void (*Quit) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Quit_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + void (*Raise) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Raise_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + gboolean (*get_HasTracklist) (MprisRoot* self); + void (*set_HasTracklist) (MprisRoot* self, gboolean value); + gboolean (*get_CanQuit) (MprisRoot* self); + void (*set_CanQuit) (MprisRoot* self, gboolean value); + gboolean (*get_CanRaise) (MprisRoot* self); + void (*set_CanRaise) (MprisRoot* self, gboolean value); + gchar* (*get_Identity) (MprisRoot* self); + void (*set_Identity) (MprisRoot* self, const gchar* value); + gchar* (*get_DesktopEntry) (MprisRoot* self); + void (*set_DesktopEntry) (MprisRoot* self, const gchar* value); +}; + +struct _MprisPlayerIface { + GTypeInterface parent_iface; + void (*PlayPause) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*PlayPause_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Next) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Next_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Previous) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Previous_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Seek) (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Seek_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + GHashTable* (*get_Metadata) (MprisPlayer* self); + void (*set_Metadata) (MprisPlayer* self, GHashTable* value); + gint32 (*get_Position) (MprisPlayer* self); + void (*set_Position) (MprisPlayer* self, gint32 value); + gchar* (*get_PlaybackStatus) (MprisPlayer* self); + void (*set_PlaybackStatus) (MprisPlayer* self, const gchar* value); +}; + +struct _PlaylistDetails { + char* path; + gchar* name; + gchar* icon_path; +}; + +struct _ActivePlaylistContainer { + gboolean valid; + PlaylistDetails details; +}; + +struct _MprisPlaylistsIface { + GTypeInterface parent_iface; + void (*ActivatePlaylist) (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*ActivatePlaylist_finish) (MprisPlaylists* self, GAsyncResult* _res_, GError** error); + void (*GetPlaylists) (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); + PlaylistDetails* (*GetPlaylists_finish) (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); + gchar** (*get_Orderings) (MprisPlaylists* self, int* result_length1); + void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); + guint32 (*get_PlaylistCount) (MprisPlaylists* self); + void (*set_PlaylistCount) (MprisPlaylists* self, guint32 value); + void (*get_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); + void (*set_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); +}; + + + +#define MPRIS_PREFIX "org.mpris.MediaPlayer2." +#define MPRIS_MEDIA_PLAYER_PATH "/org/mpris/MediaPlayer2" +GType mpris_root_proxy_get_type (void) G_GNUC_CONST; +guint mpris_root_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_root_get_type (void) G_GNUC_CONST; +void mpris_root_Quit (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_root_Quit_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +void mpris_root_Raise (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_root_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +gboolean mpris_root_get_HasTracklist (MprisRoot* self); +void mpris_root_set_HasTracklist (MprisRoot* self, gboolean value); +gboolean mpris_root_get_CanQuit (MprisRoot* self); +void mpris_root_set_CanQuit (MprisRoot* self, gboolean value); +gboolean mpris_root_get_CanRaise (MprisRoot* self); +void mpris_root_set_CanRaise (MprisRoot* self, gboolean value); +gchar* mpris_root_get_Identity (MprisRoot* self); +void mpris_root_set_Identity (MprisRoot* self, const gchar* value); +gchar* mpris_root_get_DesktopEntry (MprisRoot* self); +void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value); +static void mpris_root_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data); +static void mpris_root_proxy_Quit_async (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_root_proxy_Quit_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +static void mpris_root_proxy_Raise_async (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_root_proxy_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +static gboolean mpris_root_dbus_proxy_get_HasTracklist (MprisRoot* self); +static void mpris_root_dbus_proxy_set_HasTracklist (MprisRoot* self, gboolean value); +static gboolean mpris_root_dbus_proxy_get_CanQuit (MprisRoot* self); +static void mpris_root_dbus_proxy_set_CanQuit (MprisRoot* self, gboolean value); +static gboolean mpris_root_dbus_proxy_get_CanRaise (MprisRoot* self); +static void mpris_root_dbus_proxy_set_CanRaise (MprisRoot* self, gboolean value); +static gchar* mpris_root_dbus_proxy_get_Identity (MprisRoot* self); +static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const gchar* value); +static gchar* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self); +static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const gchar* value); +static void mpris_root_proxy_mpris_root_interface_init (MprisRootIface* iface); +static void _dbus_mpris_root_Quit (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_root_Quit_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void _dbus_mpris_root_Raise (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_root_Raise_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void mpris_root_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* mpris_root_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static GVariant* _dbus_mpris_root_get_HasTracklist (MprisRoot* self); +static GVariant* _dbus_mpris_root_get_CanQuit (MprisRoot* self); +static GVariant* _dbus_mpris_root_get_CanRaise (MprisRoot* self); +static GVariant* _dbus_mpris_root_get_Identity (MprisRoot* self); +static GVariant* _dbus_mpris_root_get_DesktopEntry (MprisRoot* self); +static gboolean mpris_root_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _dbus_mpris_root_set_HasTracklist (MprisRoot* self, GVariant* _value); +static void _dbus_mpris_root_set_CanQuit (MprisRoot* self, GVariant* _value); +static void _dbus_mpris_root_set_CanRaise (MprisRoot* self, GVariant* _value); +static void _dbus_mpris_root_set_Identity (MprisRoot* self, GVariant* _value); +static void _dbus_mpris_root_set_DesktopEntry (MprisRoot* self, GVariant* _value); +static void _mpris_root_unregister_object (gpointer user_data); +GType mpris_player_proxy_get_type (void) G_GNUC_CONST; +guint mpris_player_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_player_get_type (void) G_GNUC_CONST; +void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Next (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Previous (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Seek (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +GHashTable* mpris_player_get_Metadata (MprisPlayer* self); +void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value); +gint32 mpris_player_get_Position (MprisPlayer* self); +void mpris_player_set_Position (MprisPlayer* self, gint32 value); +gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self); +void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value); +static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static void mpris_player_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static void _dbus_handle_mpris_player_seeked (MprisPlayer* self, GVariant* parameters); +static void mpris_player_proxy_PlayPause_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_player_proxy_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +static void mpris_player_proxy_Next_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_player_proxy_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +static void mpris_player_proxy_Previous_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_player_proxy_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +static void mpris_player_proxy_Seek_async (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_player_proxy_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self); +static void mpris_player_dbus_proxy_set_Metadata (MprisPlayer* self, GHashTable* value); +static gint32 mpris_player_dbus_proxy_get_Position (MprisPlayer* self); +static void mpris_player_dbus_proxy_set_Position (MprisPlayer* self, gint32 value); +static gchar* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self); +static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const gchar* value); +static void mpris_player_proxy_mpris_player_interface_init (MprisPlayerIface* iface); +static void _dbus_mpris_player_PlayPause (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_player_PlayPause_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void _dbus_mpris_player_Next (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_player_Next_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void _dbus_mpris_player_Previous (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_player_Previous_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void _dbus_mpris_player_Seek (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_player_Seek_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void mpris_player_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* mpris_player_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static GVariant* _dbus_mpris_player_get_Metadata (MprisPlayer* self); +static GVariant* _dbus_mpris_player_get_Position (MprisPlayer* self); +static GVariant* _dbus_mpris_player_get_PlaybackStatus (MprisPlayer* self); +static gboolean mpris_player_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _dbus_mpris_player_set_Metadata (MprisPlayer* self, GVariant* _value); +static void _dbus_mpris_player_set_Position (MprisPlayer* self, GVariant* _value); +static void _dbus_mpris_player_set_PlaybackStatus (MprisPlayer* self, GVariant* _value); +static void _dbus_mpris_player_seeked (GObject* _sender, gint64 new_position, gpointer* _data); +static void _mpris_player_unregister_object (gpointer user_data); +GType playlist_details_get_type (void) G_GNUC_CONST; +PlaylistDetails* playlist_details_dup (const PlaylistDetails* self); +void playlist_details_free (PlaylistDetails* self); +void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest); +void playlist_details_destroy (PlaylistDetails* self); +GType active_playlist_container_get_type (void) G_GNUC_CONST; +ActivePlaylistContainer* active_playlist_container_dup (const ActivePlaylistContainer* self); +void active_playlist_container_free (ActivePlaylistContainer* self); +void active_playlist_container_copy (const ActivePlaylistContainer* self, ActivePlaylistContainer* dest); +void active_playlist_container_destroy (ActivePlaylistContainer* self); +GType mpris_playlists_proxy_get_type (void) G_GNUC_CONST; +guint mpris_playlists_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_playlists_get_type (void) G_GNUC_CONST; +void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); +gchar** mpris_playlists_get_Orderings (MprisPlaylists* self, int* result_length1); +void mpris_playlists_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1); +guint32 mpris_playlists_get_PlaylistCount (MprisPlaylists* self); +void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value); +void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value); +static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static void mpris_playlists_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); +static void _dbus_handle_mpris_playlists_playlist_changed (MprisPlaylists* self, GVariant* parameters); +static void mpris_playlists_proxy_ActivatePlaylist_async (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); +static void mpris_playlists_proxy_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); +static void mpris_playlists_proxy_GetPlaylists_async (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +static PlaylistDetails* mpris_playlists_proxy_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); +static gchar** mpris_playlists_dbus_proxy_get_Orderings (MprisPlaylists* self, int* result_length1); +static void mpris_playlists_dbus_proxy_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1); +static guint32 mpris_playlists_dbus_proxy_get_PlaylistCount (MprisPlaylists* self); +static void mpris_playlists_dbus_proxy_set_PlaylistCount (MprisPlaylists* self, guint32 value); +static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +static void mpris_playlists_dbus_proxy_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value); +static void mpris_playlists_proxy_mpris_playlists_interface_init (MprisPlaylistsIface* iface); +static void _dbus_mpris_playlists_ActivatePlaylist (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _dbus_mpris_playlists_ActivatePlaylist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length); +static void _dbus_mpris_playlists_GetPlaylists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); +static void mpris_playlists_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); +static GVariant* mpris_playlists_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); +static GVariant* _dbus_mpris_playlists_get_Orderings (MprisPlaylists* self); +static GVariant* _dbus_mpris_playlists_get_PlaylistCount (MprisPlaylists* self); +static GVariant* _dbus_mpris_playlists_get_ActivePlaylist (MprisPlaylists* self); +static gboolean mpris_playlists_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); +static void _dbus_mpris_playlists_set_Orderings (MprisPlaylists* self, GVariant* _value); +static void _dbus_mpris_playlists_set_PlaylistCount (MprisPlaylists* self, GVariant* _value); +static void _dbus_mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, GVariant* _value); +static void _dbus_mpris_playlists_playlist_changed (GObject* _sender, PlaylistDetails* details, gpointer* _data); +static void _mpris_playlists_unregister_object (gpointer user_data); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + +static const GDBusArgInfo * const _mpris_root_dbus_arg_info_Quit_in[] = {NULL}; +static const GDBusArgInfo * const _mpris_root_dbus_arg_info_Quit_out[] = {NULL}; +static const GDBusMethodInfo _mpris_root_dbus_method_info_Quit = {-1, "Quit", (GDBusArgInfo **) (&_mpris_root_dbus_arg_info_Quit_in), (GDBusArgInfo **) (&_mpris_root_dbus_arg_info_Quit_out)}; +static const GDBusArgInfo * const _mpris_root_dbus_arg_info_Raise_in[] = {NULL}; +static const GDBusArgInfo * const _mpris_root_dbus_arg_info_Raise_out[] = {NULL}; +static const GDBusMethodInfo _mpris_root_dbus_method_info_Raise = {-1, "Raise", (GDBusArgInfo **) (&_mpris_root_dbus_arg_info_Raise_in), (GDBusArgInfo **) (&_mpris_root_dbus_arg_info_Raise_out)}; +static const GDBusMethodInfo * const _mpris_root_dbus_method_info[] = {&_mpris_root_dbus_method_info_Quit, &_mpris_root_dbus_method_info_Raise, NULL}; +static const GDBusSignalInfo * const _mpris_root_dbus_signal_info[] = {NULL}; +static const GDBusPropertyInfo _mpris_root_dbus_property_info_HasTracklist = {-1, "HasTracklist", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_root_dbus_property_info_CanQuit = {-1, "CanQuit", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_root_dbus_property_info_CanRaise = {-1, "CanRaise", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_root_dbus_property_info_Identity = {-1, "Identity", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_root_dbus_property_info_DesktopEntry = {-1, "DesktopEntry", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo * const _mpris_root_dbus_property_info[] = {&_mpris_root_dbus_property_info_HasTracklist, &_mpris_root_dbus_property_info_CanQuit, &_mpris_root_dbus_property_info_CanRaise, &_mpris_root_dbus_property_info_Identity, &_mpris_root_dbus_property_info_DesktopEntry, NULL}; +static const GDBusInterfaceInfo _mpris_root_dbus_interface_info = {-1, "org.mpris.MediaPlayer2", (GDBusMethodInfo **) (&_mpris_root_dbus_method_info), (GDBusSignalInfo **) (&_mpris_root_dbus_signal_info), (GDBusPropertyInfo **) (&_mpris_root_dbus_property_info)}; +static const GDBusInterfaceVTable _mpris_root_dbus_interface_vtable = {mpris_root_dbus_interface_method_call, mpris_root_dbus_interface_get_property, mpris_root_dbus_interface_set_property}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_PlayPause_in[] = {NULL}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_PlayPause_out[] = {NULL}; +static const GDBusMethodInfo _mpris_player_dbus_method_info_PlayPause = {-1, "PlayPause", (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_PlayPause_in), (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_PlayPause_out)}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Next_in[] = {NULL}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Next_out[] = {NULL}; +static const GDBusMethodInfo _mpris_player_dbus_method_info_Next = {-1, "Next", (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Next_in), (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Next_out)}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Previous_in[] = {NULL}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Previous_out[] = {NULL}; +static const GDBusMethodInfo _mpris_player_dbus_method_info_Previous = {-1, "Previous", (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Previous_in), (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Previous_out)}; +static const GDBusArgInfo _mpris_player_dbus_arg_info_Seek_offset = {-1, "offset", "x"}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Seek_in[] = {&_mpris_player_dbus_arg_info_Seek_offset, NULL}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_Seek_out[] = {NULL}; +static const GDBusMethodInfo _mpris_player_dbus_method_info_Seek = {-1, "Seek", (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Seek_in), (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_Seek_out)}; +static const GDBusMethodInfo * const _mpris_player_dbus_method_info[] = {&_mpris_player_dbus_method_info_PlayPause, &_mpris_player_dbus_method_info_Next, &_mpris_player_dbus_method_info_Previous, &_mpris_player_dbus_method_info_Seek, NULL}; +static const GDBusArgInfo _mpris_player_dbus_arg_info_seeked_new_position = {-1, "new_position", "x"}; +static const GDBusArgInfo * const _mpris_player_dbus_arg_info_seeked[] = {&_mpris_player_dbus_arg_info_seeked_new_position, NULL}; +static const GDBusSignalInfo _mpris_player_dbus_signal_info_seeked = {-1, "Seeked", (GDBusArgInfo **) (&_mpris_player_dbus_arg_info_seeked)}; +static const GDBusSignalInfo * const _mpris_player_dbus_signal_info[] = {&_mpris_player_dbus_signal_info_seeked, NULL}; +static const GDBusPropertyInfo _mpris_player_dbus_property_info_Metadata = {-1, "Metadata", "a{sv}", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_player_dbus_property_info_Position = {-1, "Position", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_player_dbus_property_info_PlaybackStatus = {-1, "PlaybackStatus", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo * const _mpris_player_dbus_property_info[] = {&_mpris_player_dbus_property_info_Metadata, &_mpris_player_dbus_property_info_Position, &_mpris_player_dbus_property_info_PlaybackStatus, NULL}; +static const GDBusInterfaceInfo _mpris_player_dbus_interface_info = {-1, "org.mpris.MediaPlayer2.Player", (GDBusMethodInfo **) (&_mpris_player_dbus_method_info), (GDBusSignalInfo **) (&_mpris_player_dbus_signal_info), (GDBusPropertyInfo **) (&_mpris_player_dbus_property_info)}; +static const GDBusInterfaceVTable _mpris_player_dbus_interface_vtable = {mpris_player_dbus_interface_method_call, mpris_player_dbus_interface_get_property, mpris_player_dbus_interface_set_property}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_ActivatePlaylist_playlist_id = {-1, "playlist_id", "o"}; +static const GDBusArgInfo * const _mpris_playlists_dbus_arg_info_ActivatePlaylist_in[] = {&_mpris_playlists_dbus_arg_info_ActivatePlaylist_playlist_id, NULL}; +static const GDBusArgInfo * const _mpris_playlists_dbus_arg_info_ActivatePlaylist_out[] = {NULL}; +static const GDBusMethodInfo _mpris_playlists_dbus_method_info_ActivatePlaylist = {-1, "ActivatePlaylist", (GDBusArgInfo **) (&_mpris_playlists_dbus_arg_info_ActivatePlaylist_in), (GDBusArgInfo **) (&_mpris_playlists_dbus_arg_info_ActivatePlaylist_out)}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_GetPlaylists_index = {-1, "index", "u"}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_GetPlaylists_max_count = {-1, "max_count", "u"}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_GetPlaylists_order = {-1, "order", "s"}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_GetPlaylists_reverse_order = {-1, "reverse_order", "b"}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_GetPlaylists_result = {-1, "result", "a(oss)"}; +static const GDBusArgInfo * const _mpris_playlists_dbus_arg_info_GetPlaylists_in[] = {&_mpris_playlists_dbus_arg_info_GetPlaylists_index, &_mpris_playlists_dbus_arg_info_GetPlaylists_max_count, &_mpris_playlists_dbus_arg_info_GetPlaylists_order, &_mpris_playlists_dbus_arg_info_GetPlaylists_reverse_order, NULL}; +static const GDBusArgInfo * const _mpris_playlists_dbus_arg_info_GetPlaylists_out[] = {&_mpris_playlists_dbus_arg_info_GetPlaylists_result, NULL}; +static const GDBusMethodInfo _mpris_playlists_dbus_method_info_GetPlaylists = {-1, "GetPlaylists", (GDBusArgInfo **) (&_mpris_playlists_dbus_arg_info_GetPlaylists_in), (GDBusArgInfo **) (&_mpris_playlists_dbus_arg_info_GetPlaylists_out)}; +static const GDBusMethodInfo * const _mpris_playlists_dbus_method_info[] = {&_mpris_playlists_dbus_method_info_ActivatePlaylist, &_mpris_playlists_dbus_method_info_GetPlaylists, NULL}; +static const GDBusArgInfo _mpris_playlists_dbus_arg_info_playlist_changed_details = {-1, "details", "(oss)"}; +static const GDBusArgInfo * const _mpris_playlists_dbus_arg_info_playlist_changed[] = {&_mpris_playlists_dbus_arg_info_playlist_changed_details, NULL}; +static const GDBusSignalInfo _mpris_playlists_dbus_signal_info_playlist_changed = {-1, "PlaylistChanged", (GDBusArgInfo **) (&_mpris_playlists_dbus_arg_info_playlist_changed)}; +static const GDBusSignalInfo * const _mpris_playlists_dbus_signal_info[] = {&_mpris_playlists_dbus_signal_info_playlist_changed, NULL}; +static const GDBusPropertyInfo _mpris_playlists_dbus_property_info_Orderings = {-1, "Orderings", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_playlists_dbus_property_info_PlaylistCount = {-1, "PlaylistCount", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo _mpris_playlists_dbus_property_info_ActivePlaylist = {-1, "ActivePlaylist", "(b(oss))", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE}; +static const GDBusPropertyInfo * const _mpris_playlists_dbus_property_info[] = {&_mpris_playlists_dbus_property_info_Orderings, &_mpris_playlists_dbus_property_info_PlaylistCount, &_mpris_playlists_dbus_property_info_ActivePlaylist, NULL}; +static const GDBusInterfaceInfo _mpris_playlists_dbus_interface_info = {-1, "org.mpris.MediaPlayer2.Playlists", (GDBusMethodInfo **) (&_mpris_playlists_dbus_method_info), (GDBusSignalInfo **) (&_mpris_playlists_dbus_signal_info), (GDBusPropertyInfo **) (&_mpris_playlists_dbus_property_info)}; +static const GDBusInterfaceVTable _mpris_playlists_dbus_interface_vtable = {mpris_playlists_dbus_interface_method_call, mpris_playlists_dbus_interface_get_property, mpris_playlists_dbus_interface_set_property}; + +void mpris_root_Quit (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_ROOT_GET_INTERFACE (self)->Quit (self, _callback_, _user_data_); +} + + +void mpris_root_Quit_finish (MprisRoot* self, GAsyncResult* _res_, GError** error) { + MPRIS_ROOT_GET_INTERFACE (self)->Quit_finish (self, _res_, error); +} + + +void mpris_root_Raise (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_ROOT_GET_INTERFACE (self)->Raise (self, _callback_, _user_data_); +} + + +void mpris_root_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error) { + MPRIS_ROOT_GET_INTERFACE (self)->Raise_finish (self, _res_, error); +} + + +gboolean mpris_root_get_HasTracklist (MprisRoot* self) { + return MPRIS_ROOT_GET_INTERFACE (self)->get_HasTracklist (self); +} + + +void mpris_root_set_HasTracklist (MprisRoot* self, gboolean value) { + MPRIS_ROOT_GET_INTERFACE (self)->set_HasTracklist (self, value); +} + + +gboolean mpris_root_get_CanQuit (MprisRoot* self) { + return MPRIS_ROOT_GET_INTERFACE (self)->get_CanQuit (self); +} + + +void mpris_root_set_CanQuit (MprisRoot* self, gboolean value) { + MPRIS_ROOT_GET_INTERFACE (self)->set_CanQuit (self, value); +} + + +gboolean mpris_root_get_CanRaise (MprisRoot* self) { + return MPRIS_ROOT_GET_INTERFACE (self)->get_CanRaise (self); +} + + +void mpris_root_set_CanRaise (MprisRoot* self, gboolean value) { + MPRIS_ROOT_GET_INTERFACE (self)->set_CanRaise (self, value); +} + + +gchar* mpris_root_get_Identity (MprisRoot* self) { + return MPRIS_ROOT_GET_INTERFACE (self)->get_Identity (self); +} + + +void mpris_root_set_Identity (MprisRoot* self, const gchar* value) { + MPRIS_ROOT_GET_INTERFACE (self)->set_Identity (self, value); +} + + +gchar* mpris_root_get_DesktopEntry (MprisRoot* self) { + return MPRIS_ROOT_GET_INTERFACE (self)->get_DesktopEntry (self); +} + + +void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value) { + MPRIS_ROOT_GET_INTERFACE (self)->set_DesktopEntry (self, value); +} + + +static void mpris_root_base_init (MprisRootIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + } +} + + +GType mpris_root_get_type (void) { + static volatile gsize mpris_root_type_id__volatile = 0; + if (g_once_init_enter (&mpris_root_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (MprisRootIface), (GBaseInitFunc) mpris_root_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType mpris_root_type_id; + mpris_root_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisRoot", &g_define_type_info, 0); + g_type_interface_add_prerequisite (mpris_root_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_root_proxy_get_type); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2"); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_root_register_object); + g_once_init_leave (&mpris_root_type_id__volatile, mpris_root_type_id); + } + return mpris_root_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (MprisRootProxy, mpris_root_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_MPRIS_ROOT, mpris_root_proxy_mpris_root_interface_init) ) +static void mpris_root_proxy_class_init (MprisRootProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = mpris_root_proxy_g_signal; +} + + +static void mpris_root_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { +} + + +static void mpris_root_proxy_init (MprisRootProxy* self) { +} + + +static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data) { + g_simple_async_result_set_op_res_gpointer (user_data, g_object_ref (res), g_object_unref); + g_simple_async_result_complete (user_data); + g_object_unref (user_data); +} + + +static void mpris_root_proxy_Quit_async (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2", "Quit"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_root_proxy_Quit_finish (MprisRoot* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static void mpris_root_proxy_Raise_async (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2", "Raise"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_root_proxy_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static gboolean mpris_root_dbus_proxy_get_HasTracklist (MprisRoot* self) { + GVariant *_inner_reply; + gboolean _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "HasTracklist"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("HasTracklist")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return FALSE; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_get_boolean (_inner_reply); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_root_dbus_proxy_set_HasTracklist (MprisRoot* self, gboolean value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("HasTracklist")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gboolean mpris_root_dbus_proxy_get_CanQuit (MprisRoot* self) { + GVariant *_inner_reply; + gboolean _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "CanQuit"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("CanQuit")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return FALSE; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_get_boolean (_inner_reply); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_root_dbus_proxy_set_CanQuit (MprisRoot* self, gboolean value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("CanQuit")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gboolean mpris_root_dbus_proxy_get_CanRaise (MprisRoot* self) { + GVariant *_inner_reply; + gboolean _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "CanRaise"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("CanRaise")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return FALSE; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_get_boolean (_inner_reply); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_root_dbus_proxy_set_CanRaise (MprisRoot* self, gboolean value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("CanRaise")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gchar* mpris_root_dbus_proxy_get_Identity (MprisRoot* self) { + GVariant *_inner_reply; + gchar* _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Identity"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Identity")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return NULL; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_dup_string (_inner_reply, NULL); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const gchar* value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Identity")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gchar* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self) { + GVariant *_inner_reply; + gchar* _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "DesktopEntry"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("DesktopEntry")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return NULL; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_dup_string (_inner_reply, NULL); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const gchar* value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("DesktopEntry")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static void mpris_root_proxy_mpris_root_interface_init (MprisRootIface* iface) { + iface->Quit = mpris_root_proxy_Quit_async; + iface->Quit_finish = mpris_root_proxy_Quit_finish; + iface->Raise = mpris_root_proxy_Raise_async; + iface->Raise_finish = mpris_root_proxy_Raise_finish; + iface->get_HasTracklist = mpris_root_dbus_proxy_get_HasTracklist; + iface->set_HasTracklist = mpris_root_dbus_proxy_set_HasTracklist; + iface->get_CanQuit = mpris_root_dbus_proxy_get_CanQuit; + iface->set_CanQuit = mpris_root_dbus_proxy_set_CanQuit; + iface->get_CanRaise = mpris_root_dbus_proxy_get_CanRaise; + iface->set_CanRaise = mpris_root_dbus_proxy_set_CanRaise; + iface->get_Identity = mpris_root_dbus_proxy_get_Identity; + iface->set_Identity = mpris_root_dbus_proxy_set_Identity; + iface->get_DesktopEntry = mpris_root_dbus_proxy_get_DesktopEntry; + iface->set_DesktopEntry = mpris_root_dbus_proxy_set_DesktopEntry; +} + + +static void _dbus_mpris_root_Quit (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + mpris_root_Quit (self, (GAsyncReadyCallback) _dbus_mpris_root_Quit_ready, invocation); +} + + +static void _dbus_mpris_root_Quit_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_root_Quit_finish ((MprisRoot*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void _dbus_mpris_root_Raise (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + mpris_root_Raise (self, (GAsyncReadyCallback) _dbus_mpris_root_Raise_ready, invocation); +} + + +static void _dbus_mpris_root_Raise_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_root_Raise_finish ((MprisRoot*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void mpris_root_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (method_name, "Quit") == 0) { + _dbus_mpris_root_Quit (object, parameters, invocation); + } else if (strcmp (method_name, "Raise") == 0) { + _dbus_mpris_root_Raise (object, parameters, invocation); + } else { + g_object_unref (invocation); + } +} + + +static GVariant* _dbus_mpris_root_get_HasTracklist (MprisRoot* self) { + gboolean result; + GVariant* _reply; + result = mpris_root_get_HasTracklist (self); + _reply = g_variant_new_boolean (result); + return _reply; +} + + +static GVariant* _dbus_mpris_root_get_CanQuit (MprisRoot* self) { + gboolean result; + GVariant* _reply; + result = mpris_root_get_CanQuit (self); + _reply = g_variant_new_boolean (result); + return _reply; +} + + +static GVariant* _dbus_mpris_root_get_CanRaise (MprisRoot* self) { + gboolean result; + GVariant* _reply; + result = mpris_root_get_CanRaise (self); + _reply = g_variant_new_boolean (result); + return _reply; +} + + +static GVariant* _dbus_mpris_root_get_Identity (MprisRoot* self) { + gchar* result; + GVariant* _reply; + result = mpris_root_get_Identity (self); + _reply = g_variant_new_string (result); + _g_free0 ( result); + return _reply; +} + + +static GVariant* _dbus_mpris_root_get_DesktopEntry (MprisRoot* self) { + gchar* result; + GVariant* _reply; + result = mpris_root_get_DesktopEntry (self); + _reply = g_variant_new_string (result); + _g_free0 ( result); + return _reply; +} + + +static GVariant* mpris_root_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "HasTracklist") == 0) { + return _dbus_mpris_root_get_HasTracklist (object); + } else if (strcmp (property_name, "CanQuit") == 0) { + return _dbus_mpris_root_get_CanQuit (object); + } else if (strcmp (property_name, "CanRaise") == 0) { + return _dbus_mpris_root_get_CanRaise (object); + } else if (strcmp (property_name, "Identity") == 0) { + return _dbus_mpris_root_get_Identity (object); + } else if (strcmp (property_name, "DesktopEntry") == 0) { + return _dbus_mpris_root_get_DesktopEntry (object); + } + return NULL; +} + + +static void _dbus_mpris_root_set_HasTracklist (MprisRoot* self, GVariant* _value) { + gboolean value = FALSE; + value = g_variant_get_boolean (_value); + mpris_root_set_HasTracklist (self, value); +} + + +static void _dbus_mpris_root_set_CanQuit (MprisRoot* self, GVariant* _value) { + gboolean value = FALSE; + value = g_variant_get_boolean (_value); + mpris_root_set_CanQuit (self, value); +} + + +static void _dbus_mpris_root_set_CanRaise (MprisRoot* self, GVariant* _value) { + gboolean value = FALSE; + value = g_variant_get_boolean (_value); + mpris_root_set_CanRaise (self, value); +} + + +static void _dbus_mpris_root_set_Identity (MprisRoot* self, GVariant* _value) { + gchar* value = NULL; + value = g_variant_dup_string (_value, NULL); + mpris_root_set_Identity (self, value); + _g_free0 (value); +} + + +static void _dbus_mpris_root_set_DesktopEntry (MprisRoot* self, GVariant* _value) { + gchar* value = NULL; + value = g_variant_dup_string (_value, NULL); + mpris_root_set_DesktopEntry (self, value); + _g_free0 (value); +} + + +static gboolean mpris_root_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "HasTracklist") == 0) { + _dbus_mpris_root_set_HasTracklist (object, value); + return TRUE; + } else if (strcmp (property_name, "CanQuit") == 0) { + _dbus_mpris_root_set_CanQuit (object, value); + return TRUE; + } else if (strcmp (property_name, "CanRaise") == 0) { + _dbus_mpris_root_set_CanRaise (object, value); + return TRUE; + } else if (strcmp (property_name, "Identity") == 0) { + _dbus_mpris_root_set_Identity (object, value); + return TRUE; + } else if (strcmp (property_name, "DesktopEntry") == 0) { + _dbus_mpris_root_set_DesktopEntry (object, value); + return TRUE; + } + return FALSE; +} + + +guint mpris_root_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_mpris_root_dbus_interface_info), &_mpris_root_dbus_interface_vtable, data, _mpris_root_unregister_object, error); + if (!result) { + return 0; + } + return result; +} + + +static void _mpris_root_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYER_GET_INTERFACE (self)->PlayPause (self, _callback_, _user_data_); +} + + +void mpris_player_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + MPRIS_PLAYER_GET_INTERFACE (self)->PlayPause_finish (self, _res_, error); +} + + +void mpris_player_Next (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYER_GET_INTERFACE (self)->Next (self, _callback_, _user_data_); +} + + +void mpris_player_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + MPRIS_PLAYER_GET_INTERFACE (self)->Next_finish (self, _res_, error); +} + + +void mpris_player_Previous (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYER_GET_INTERFACE (self)->Previous (self, _callback_, _user_data_); +} + + +void mpris_player_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + MPRIS_PLAYER_GET_INTERFACE (self)->Previous_finish (self, _res_, error); +} + + +void mpris_player_Seek (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYER_GET_INTERFACE (self)->Seek (self, offset, _callback_, _user_data_); +} + + +void mpris_player_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + MPRIS_PLAYER_GET_INTERFACE (self)->Seek_finish (self, _res_, error); +} + + +GHashTable* mpris_player_get_Metadata (MprisPlayer* self) { + return MPRIS_PLAYER_GET_INTERFACE (self)->get_Metadata (self); +} + + +void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value) { + MPRIS_PLAYER_GET_INTERFACE (self)->set_Metadata (self, value); +} + + +gint32 mpris_player_get_Position (MprisPlayer* self) { + return MPRIS_PLAYER_GET_INTERFACE (self)->get_Position (self); +} + + +void mpris_player_set_Position (MprisPlayer* self, gint32 value) { + MPRIS_PLAYER_GET_INTERFACE (self)->set_Position (self, value); +} + + +gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self) { + return MPRIS_PLAYER_GET_INTERFACE (self)->get_PlaybackStatus (self); +} + + +void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value) { + MPRIS_PLAYER_GET_INTERFACE (self)->set_PlaybackStatus (self, value); +} + + +static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2); + register GMarshalFunc_VOID__INT64 callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 2); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_int64 (param_values + 1), data2); +} + + +static void mpris_player_base_init (MprisPlayerIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + g_signal_new ("seeked", TYPE_MPRIS_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT64, G_TYPE_NONE, 1, G_TYPE_INT64); + } +} + + +GType mpris_player_get_type (void) { + static volatile gsize mpris_player_type_id__volatile = 0; + if (g_once_init_enter (&mpris_player_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (MprisPlayerIface), (GBaseInitFunc) mpris_player_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType mpris_player_type_id; + mpris_player_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisPlayer", &g_define_type_info, 0); + g_type_interface_add_prerequisite (mpris_player_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_player_proxy_get_type); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2.Player"); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_player_register_object); + g_once_init_leave (&mpris_player_type_id__volatile, mpris_player_type_id); + } + return mpris_player_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (MprisPlayerProxy, mpris_player_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_MPRIS_PLAYER, mpris_player_proxy_mpris_player_interface_init) ) +static void mpris_player_proxy_class_init (MprisPlayerProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = mpris_player_proxy_g_signal; +} + + +static void _dbus_handle_mpris_player_seeked (MprisPlayer* self, GVariant* parameters) { + GVariantIter _arguments_iter; + gint64 new_position = 0LL; + GVariant* _tmp0_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp0_ = g_variant_iter_next_value (&_arguments_iter); + new_position = g_variant_get_int64 (_tmp0_); + g_variant_unref (_tmp0_); + g_signal_emit_by_name (self, "seeked", new_position); +} + + +static void mpris_player_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { + if (strcmp (signal_name, "Seeked") == 0) { + _dbus_handle_mpris_player_seeked ((MprisPlayer*) proxy, parameters); + } +} + + +static void mpris_player_proxy_init (MprisPlayerProxy* self) { +} + + +static void mpris_player_proxy_PlayPause_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Player", "PlayPause"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_player_proxy_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static void mpris_player_proxy_Next_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Player", "Next"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_player_proxy_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static void mpris_player_proxy_Previous_async (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Player", "Previous"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_player_proxy_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static void mpris_player_proxy_Seek_async (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Player", "Seek"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_int64 (offset)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_player_proxy_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self) { + GVariant *_inner_reply; + GHashTable* _result; + GHashTable* _tmp1_; + GVariantIter _tmp2_; + GVariant* _tmp3_; + GVariant* _tmp4_; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Metadata"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Metadata")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return NULL; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _tmp1_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + g_variant_iter_init (&_tmp2_, _inner_reply); + while (g_variant_iter_loop (&_tmp2_, "{?*}", &_tmp3_, &_tmp4_)) { + g_hash_table_insert (_tmp1_, g_variant_dup_string (_tmp3_, NULL), g_variant_get_variant (_tmp4_)); + } + _result = _tmp1_; + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_player_dbus_proxy_set_Metadata (MprisPlayer* self, GHashTable* value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + GVariantBuilder _tmp5_; + GHashTableIter _tmp6_; + gpointer _tmp7_; + gpointer _tmp8_; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Metadata")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_hash_table_iter_init (&_tmp6_, value); + g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE ("a{sv}")); + while (g_hash_table_iter_next (&_tmp6_, &_tmp7_, &_tmp8_)) { + gchar* _key; + GVariant* _value; + _key = (gchar*) _tmp7_; + _value = (GVariant*) _tmp8_; + g_variant_builder_add (&_tmp5_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value)); + } + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp5_)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gint32 mpris_player_dbus_proxy_get_Position (MprisPlayer* self) { + GVariant *_inner_reply; + gint32 _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Position"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Position")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return 0; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_get_int32 (_inner_reply); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_player_dbus_proxy_set_Position (MprisPlayer* self, gint32 value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Position")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static gchar* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self) { + GVariant *_inner_reply; + gchar* _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "PlaybackStatus"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PlaybackStatus")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return NULL; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_dup_string (_inner_reply, NULL); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const gchar* value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Player")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PlaybackStatus")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static void mpris_player_proxy_mpris_player_interface_init (MprisPlayerIface* iface) { + iface->PlayPause = mpris_player_proxy_PlayPause_async; + iface->PlayPause_finish = mpris_player_proxy_PlayPause_finish; + iface->Next = mpris_player_proxy_Next_async; + iface->Next_finish = mpris_player_proxy_Next_finish; + iface->Previous = mpris_player_proxy_Previous_async; + iface->Previous_finish = mpris_player_proxy_Previous_finish; + iface->Seek = mpris_player_proxy_Seek_async; + iface->Seek_finish = mpris_player_proxy_Seek_finish; + iface->get_Metadata = mpris_player_dbus_proxy_get_Metadata; + iface->set_Metadata = mpris_player_dbus_proxy_set_Metadata; + iface->get_Position = mpris_player_dbus_proxy_get_Position; + iface->set_Position = mpris_player_dbus_proxy_set_Position; + iface->get_PlaybackStatus = mpris_player_dbus_proxy_get_PlaybackStatus; + iface->set_PlaybackStatus = mpris_player_dbus_proxy_set_PlaybackStatus; +} + + +static void _dbus_mpris_player_PlayPause (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + mpris_player_PlayPause (self, (GAsyncReadyCallback) _dbus_mpris_player_PlayPause_ready, invocation); +} + + +static void _dbus_mpris_player_PlayPause_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_player_PlayPause_finish ((MprisPlayer*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void _dbus_mpris_player_Next (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + mpris_player_Next (self, (GAsyncReadyCallback) _dbus_mpris_player_Next_ready, invocation); +} + + +static void _dbus_mpris_player_Next_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_player_Next_finish ((MprisPlayer*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void _dbus_mpris_player_Previous (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + g_variant_iter_init (&_arguments_iter, parameters); + mpris_player_Previous (self, (GAsyncReadyCallback) _dbus_mpris_player_Previous_ready, invocation); +} + + +static void _dbus_mpris_player_Previous_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_player_Previous_finish ((MprisPlayer*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void _dbus_mpris_player_Seek (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + gint64 offset = 0LL; + GVariant* _tmp9_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp9_ = g_variant_iter_next_value (&_arguments_iter); + offset = g_variant_get_int64 (_tmp9_); + g_variant_unref (_tmp9_); + mpris_player_Seek (self, offset, (GAsyncReadyCallback) _dbus_mpris_player_Seek_ready, invocation); +} + + +static void _dbus_mpris_player_Seek_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_player_Seek_finish ((MprisPlayer*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void mpris_player_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (method_name, "PlayPause") == 0) { + _dbus_mpris_player_PlayPause (object, parameters, invocation); + } else if (strcmp (method_name, "Next") == 0) { + _dbus_mpris_player_Next (object, parameters, invocation); + } else if (strcmp (method_name, "Previous") == 0) { + _dbus_mpris_player_Previous (object, parameters, invocation); + } else if (strcmp (method_name, "Seek") == 0) { + _dbus_mpris_player_Seek (object, parameters, invocation); + } else { + g_object_unref (invocation); + } +} + + +static GVariant* _dbus_mpris_player_get_Metadata (MprisPlayer* self) { + GHashTable* result; + GVariantBuilder _tmp10_; + GHashTableIter _tmp11_; + gpointer _tmp12_; + gpointer _tmp13_; + GVariant* _reply; + result = mpris_player_get_Metadata (self); + g_hash_table_iter_init (&_tmp11_, result); + g_variant_builder_init (&_tmp10_, G_VARIANT_TYPE ("a{sv}")); + while (g_hash_table_iter_next (&_tmp11_, &_tmp12_, &_tmp13_)) { + gchar* _key; + GVariant* _value; + _key = (gchar*) _tmp12_; + _value = (GVariant*) _tmp13_; + g_variant_builder_add (&_tmp10_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value)); + } + _reply = g_variant_builder_end (&_tmp10_); + _g_hash_table_unref0 ( result); + return _reply; +} + + +static GVariant* _dbus_mpris_player_get_Position (MprisPlayer* self) { + gint32 result; + GVariant* _reply; + result = mpris_player_get_Position (self); + _reply = g_variant_new_int32 (result); + return _reply; +} + + +static GVariant* _dbus_mpris_player_get_PlaybackStatus (MprisPlayer* self) { + gchar* result; + GVariant* _reply; + result = mpris_player_get_PlaybackStatus (self); + _reply = g_variant_new_string (result); + _g_free0 ( result); + return _reply; +} + + +static GVariant* mpris_player_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "Metadata") == 0) { + return _dbus_mpris_player_get_Metadata (object); + } else if (strcmp (property_name, "Position") == 0) { + return _dbus_mpris_player_get_Position (object); + } else if (strcmp (property_name, "PlaybackStatus") == 0) { + return _dbus_mpris_player_get_PlaybackStatus (object); + } + return NULL; +} + + +static void _dbus_mpris_player_set_Metadata (MprisPlayer* self, GVariant* _value) { + GHashTable* value = NULL; + GHashTable* _tmp14_; + GVariantIter _tmp15_; + GVariant* _tmp16_; + GVariant* _tmp17_; + _tmp14_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + g_variant_iter_init (&_tmp15_, _value); + while (g_variant_iter_loop (&_tmp15_, "{?*}", &_tmp16_, &_tmp17_)) { + g_hash_table_insert (_tmp14_, g_variant_dup_string (_tmp16_, NULL), g_variant_get_variant (_tmp17_)); + } + value = _tmp14_; + mpris_player_set_Metadata (self, value); + _g_hash_table_unref0 (value); +} + + +static void _dbus_mpris_player_set_Position (MprisPlayer* self, GVariant* _value) { + gint32 value = 0; + value = g_variant_get_int32 (_value); + mpris_player_set_Position (self, value); +} + + +static void _dbus_mpris_player_set_PlaybackStatus (MprisPlayer* self, GVariant* _value) { + gchar* value = NULL; + value = g_variant_dup_string (_value, NULL); + mpris_player_set_PlaybackStatus (self, value); + _g_free0 (value); +} + + +static gboolean mpris_player_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "Metadata") == 0) { + _dbus_mpris_player_set_Metadata (object, value); + return TRUE; + } else if (strcmp (property_name, "Position") == 0) { + _dbus_mpris_player_set_Position (object, value); + return TRUE; + } else if (strcmp (property_name, "PlaybackStatus") == 0) { + _dbus_mpris_player_set_PlaybackStatus (object, value); + return TRUE; + } + return FALSE; +} + + +static void _dbus_mpris_player_seeked (GObject* _sender, gint64 new_position, gpointer* _data) { + GDBusConnection * _connection; + const gchar * _path; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + _connection = _data[1]; + _path = _data[2]; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_int64 (new_position)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_connection_emit_signal (_connection, NULL, _path, "org.mpris.MediaPlayer2.Player", "Seeked", _arguments, NULL); +} + + +guint mpris_player_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_mpris_player_dbus_interface_info), &_mpris_player_dbus_interface_vtable, data, _mpris_player_unregister_object, error); + if (!result) { + return 0; + } + g_signal_connect (object, "seeked", (GCallback) _dbus_mpris_player_seeked, data); + return result; +} + + +static void _mpris_player_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest) { + dest->path = g_strdup (self->path); + dest->name = g_strdup (self->name); + dest->icon_path = g_strdup (self->icon_path); +} + + +void playlist_details_destroy (PlaylistDetails* self) { + _g_free0 ((*self).path); + _g_free0 ((*self).name); + _g_free0 ((*self).icon_path); +} + + +PlaylistDetails* playlist_details_dup (const PlaylistDetails* self) { + PlaylistDetails* dup; + dup = g_new0 (PlaylistDetails, 1); + playlist_details_copy (self, dup); + return dup; +} + + +void playlist_details_free (PlaylistDetails* self) { + playlist_details_destroy (self); + g_free (self); +} + + +GType playlist_details_get_type (void) { + static volatile gsize playlist_details_type_id__volatile = 0; + if (g_once_init_enter (&playlist_details_type_id__volatile)) { + GType playlist_details_type_id; + playlist_details_type_id = g_boxed_type_register_static ("PlaylistDetails", (GBoxedCopyFunc) playlist_details_dup, (GBoxedFreeFunc) playlist_details_free); + g_once_init_leave (&playlist_details_type_id__volatile, playlist_details_type_id); + } + return playlist_details_type_id__volatile; +} + + +void active_playlist_container_copy (const ActivePlaylistContainer* self, ActivePlaylistContainer* dest) { + PlaylistDetails _tmp0_ = {0}; + dest->valid = self->valid; + playlist_details_copy (&self->details, &_tmp0_); + dest->details = _tmp0_; +} + + +void active_playlist_container_destroy (ActivePlaylistContainer* self) { + playlist_details_destroy (&(*self).details); +} + + +ActivePlaylistContainer* active_playlist_container_dup (const ActivePlaylistContainer* self) { + ActivePlaylistContainer* dup; + dup = g_new0 (ActivePlaylistContainer, 1); + active_playlist_container_copy (self, dup); + return dup; +} + + +void active_playlist_container_free (ActivePlaylistContainer* self) { + active_playlist_container_destroy (self); + g_free (self); +} + + +GType active_playlist_container_get_type (void) { + static volatile gsize active_playlist_container_type_id__volatile = 0; + if (g_once_init_enter (&active_playlist_container_type_id__volatile)) { + GType active_playlist_container_type_id; + active_playlist_container_type_id = g_boxed_type_register_static ("ActivePlaylistContainer", (GBoxedCopyFunc) active_playlist_container_dup, (GBoxedFreeFunc) active_playlist_container_free); + g_once_init_leave (&active_playlist_container_type_id__volatile, active_playlist_container_type_id); + } + return active_playlist_container_type_id__volatile; +} + + +void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->ActivatePlaylist (self, playlist_id, _callback_, _user_data_); +} + + +void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->ActivatePlaylist_finish (self, _res_, error); +} + + +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->GetPlaylists (self, index, max_count, order, reverse_order, _callback_, _user_data_); +} + + +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error) { + return MPRIS_PLAYLISTS_GET_INTERFACE (self)->GetPlaylists_finish (self, _res_, result_length1, error); +} + + +gchar** mpris_playlists_get_Orderings (MprisPlaylists* self, int* result_length1) { + return MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_Orderings (self, result_length1); +} + + +void mpris_playlists_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_Orderings (self, value, value_length1); +} + + +guint32 mpris_playlists_get_PlaylistCount (MprisPlaylists* self) { + return MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_PlaylistCount (self); +} + + +void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_PlaylistCount (self, value); +} + + +void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_ActivePlaylist (self, result); +} + + +void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_ActivePlaylist (self, value); +} + + +static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__BOXED) (gpointer data1, gpointer arg_1, gpointer data2); + register GMarshalFunc_VOID__BOXED callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 2); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__BOXED) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_boxed (param_values + 1), data2); +} + + +static void mpris_playlists_base_init (MprisPlaylistsIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + g_signal_new ("playlist_changed", TYPE_MPRIS_PLAYLISTS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED, G_TYPE_NONE, 1, TYPE_PLAYLIST_DETAILS); + } +} + + +GType mpris_playlists_get_type (void) { + static volatile gsize mpris_playlists_type_id__volatile = 0; + if (g_once_init_enter (&mpris_playlists_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (MprisPlaylistsIface), (GBaseInitFunc) mpris_playlists_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType mpris_playlists_type_id; + mpris_playlists_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisPlaylists", &g_define_type_info, 0); + g_type_interface_add_prerequisite (mpris_playlists_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_playlists_proxy_get_type); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2.Playlists"); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_playlists_register_object); + g_once_init_leave (&mpris_playlists_type_id__volatile, mpris_playlists_type_id); + } + return mpris_playlists_type_id__volatile; +} + + +G_DEFINE_TYPE_EXTENDED (MprisPlaylistsProxy, mpris_playlists_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_MPRIS_PLAYLISTS, mpris_playlists_proxy_mpris_playlists_interface_init) ) +static void mpris_playlists_proxy_class_init (MprisPlaylistsProxyClass* klass) { + G_DBUS_PROXY_CLASS (klass)->g_signal = mpris_playlists_proxy_g_signal; +} + + +static void _dbus_handle_mpris_playlists_playlist_changed (MprisPlaylists* self, GVariant* parameters) { + GVariantIter _arguments_iter; + PlaylistDetails details = {0}; + GVariant* _tmp18_; + PlaylistDetails _tmp19_; + GVariantIter _tmp20_; + GVariant* _tmp21_; + GVariant* _tmp22_; + GVariant* _tmp23_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp18_ = g_variant_iter_next_value (&_arguments_iter); + g_variant_iter_init (&_tmp20_, _tmp18_); + _tmp21_ = g_variant_iter_next_value (&_tmp20_); + _tmp19_.path = g_variant_dup_string (_tmp21_, NULL); + g_variant_unref (_tmp21_); + _tmp22_ = g_variant_iter_next_value (&_tmp20_); + _tmp19_.name = g_variant_dup_string (_tmp22_, NULL); + g_variant_unref (_tmp22_); + _tmp23_ = g_variant_iter_next_value (&_tmp20_); + _tmp19_.icon_path = g_variant_dup_string (_tmp23_, NULL); + g_variant_unref (_tmp23_); + details = _tmp19_; + g_variant_unref (_tmp18_); + g_signal_emit_by_name (self, "playlist-changed", &details); + playlist_details_destroy (&details); +} + + +static void mpris_playlists_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { + if (strcmp (signal_name, "PlaylistChanged") == 0) { + _dbus_handle_mpris_playlists_playlist_changed ((MprisPlaylists*) proxy, parameters); + } +} + + +static void mpris_playlists_proxy_init (MprisPlaylistsProxy* self) { +} + + +static void mpris_playlists_proxy_ActivatePlaylist_async (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Playlists", "ActivatePlaylist"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (playlist_id)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static void mpris_playlists_proxy_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error) { + GDBusMessage *_reply_message; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return; + } + g_object_unref (_reply_message); +} + + +static void mpris_playlists_proxy_GetPlaylists_async (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_) { + GDBusMessage *_message; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Playlists", "GetPlaylists"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (index)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (max_count)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (order)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (reverse_order)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static PlaylistDetails* mpris_playlists_proxy_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error) { + GDBusMessage *_reply_message; + GVariant *_reply; + GVariantIter _reply_iter; + PlaylistDetails* _result; + int _result_length1; + GVariant* _tmp24_; + PlaylistDetails* _tmp25_; + int _tmp25__length; + int _tmp25__size; + int _tmp25__length1; + GVariantIter _tmp26_; + GVariant* _tmp27_; + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); + if (!_reply_message) { + return NULL; + } + if (g_dbus_message_to_gerror (_reply_message, error)) { + g_object_unref (_reply_message); + return NULL; + } + _reply = g_dbus_message_get_body (_reply_message); + g_variant_iter_init (&_reply_iter, _reply); + _result_length1 = 0; + _tmp24_ = g_variant_iter_next_value (&_reply_iter); + _tmp25_ = g_new (PlaylistDetails, 5); + _tmp25__length = 0; + _tmp25__size = 4; + _tmp25__length1 = 0; + g_variant_iter_init (&_tmp26_, _tmp24_); + for (; (_tmp27_ = g_variant_iter_next_value (&_tmp26_)) != NULL; _tmp25__length1++) { + PlaylistDetails _tmp28_; + GVariantIter _tmp29_; + GVariant* _tmp30_; + GVariant* _tmp31_; + GVariant* _tmp32_; + if (_tmp25__size == _tmp25__length) { + _tmp25__size = 2 * _tmp25__size; + _tmp25_ = g_renew (PlaylistDetails, _tmp25_, _tmp25__size + 1); + } + g_variant_iter_init (&_tmp29_, _tmp27_); + _tmp30_ = g_variant_iter_next_value (&_tmp29_); + _tmp28_.path = g_variant_dup_string (_tmp30_, NULL); + g_variant_unref (_tmp30_); + _tmp31_ = g_variant_iter_next_value (&_tmp29_); + _tmp28_.name = g_variant_dup_string (_tmp31_, NULL); + g_variant_unref (_tmp31_); + _tmp32_ = g_variant_iter_next_value (&_tmp29_); + _tmp28_.icon_path = g_variant_dup_string (_tmp32_, NULL); + g_variant_unref (_tmp32_); + _tmp25_[_tmp25__length++] = _tmp28_; + g_variant_unref (_tmp27_); + } + _result_length1 = _tmp25__length1; + _result = _tmp25_; + g_variant_unref (_tmp24_); + *result_length1 = _result_length1; + g_object_unref (_reply_message); + return _result; +} + + +static gchar** mpris_playlists_dbus_proxy_get_Orderings (MprisPlaylists* self, int* result_length1) { + GVariant *_inner_reply; + gchar** _result; + int _result_length1; + gchar** _tmp33_; + int _tmp33__length; + int _tmp33__size; + int _tmp33__length1; + GVariantIter _tmp34_; + GVariant* _tmp35_; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Orderings"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Orderings")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return NULL; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result_length1 = 0; + _tmp33_ = g_new (gchar*, 5); + _tmp33__length = 0; + _tmp33__size = 4; + _tmp33__length1 = 0; + g_variant_iter_init (&_tmp34_, _inner_reply); + for (; (_tmp35_ = g_variant_iter_next_value (&_tmp34_)) != NULL; _tmp33__length1++) { + if (_tmp33__size == _tmp33__length) { + _tmp33__size = 2 * _tmp33__size; + _tmp33_ = g_renew (gchar*, _tmp33_, _tmp33__size + 1); + } + _tmp33_[_tmp33__length++] = g_variant_dup_string (_tmp35_, NULL); + g_variant_unref (_tmp35_); + } + _result_length1 = _tmp33__length1; + _tmp33_[_tmp33__length] = NULL; + _result = _tmp33_; + *result_length1 = _result_length1; + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_playlists_dbus_proxy_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + gchar** _tmp36_; + GVariantBuilder _tmp37_; + int _tmp38_; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Orderings")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + _tmp36_ = value; + g_variant_builder_init (&_tmp37_, G_VARIANT_TYPE ("as")); + for (_tmp38_ = 0; _tmp38_ < value_length1; _tmp38_++) { + g_variant_builder_add_value (&_tmp37_, g_variant_new_string (*_tmp36_)); + _tmp36_++; + } + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp37_)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static guint32 mpris_playlists_dbus_proxy_get_PlaylistCount (MprisPlaylists* self) { + GVariant *_inner_reply; + guint32 _result; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "PlaylistCount"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PlaylistCount")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return 0U; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + _result = g_variant_get_uint32 (_inner_reply); + g_variant_unref (_inner_reply); + return _result; +} + + +static void mpris_playlists_dbus_proxy_set_PlaylistCount (MprisPlaylists* self, guint32 value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PlaylistCount")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (value)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result) { + GVariant *_inner_reply; + ActivePlaylistContainer _tmp39_; + GVariantIter _tmp40_; + GVariant* _tmp41_; + GVariant* _tmp42_; + PlaylistDetails _tmp43_; + GVariantIter _tmp44_; + GVariant* _tmp45_; + GVariant* _tmp46_; + GVariant* _tmp47_; + _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "ActivePlaylist"); + if (!_inner_reply) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ActivePlaylist")); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_get (_reply, "(v)", &_inner_reply); + g_variant_unref (_reply); + } + g_variant_iter_init (&_tmp40_, _inner_reply); + _tmp41_ = g_variant_iter_next_value (&_tmp40_); + _tmp39_.valid = g_variant_get_boolean (_tmp41_); + g_variant_unref (_tmp41_); + _tmp42_ = g_variant_iter_next_value (&_tmp40_); + g_variant_iter_init (&_tmp44_, _tmp42_); + _tmp45_ = g_variant_iter_next_value (&_tmp44_); + _tmp43_.path = g_variant_dup_string (_tmp45_, NULL); + g_variant_unref (_tmp45_); + _tmp46_ = g_variant_iter_next_value (&_tmp44_); + _tmp43_.name = g_variant_dup_string (_tmp46_, NULL); + g_variant_unref (_tmp46_); + _tmp47_ = g_variant_iter_next_value (&_tmp44_); + _tmp43_.icon_path = g_variant_dup_string (_tmp47_, NULL); + g_variant_unref (_tmp47_); + _tmp39_.details = _tmp43_; + g_variant_unref (_tmp42_); + *result = _tmp39_; + g_variant_unref (_inner_reply); + return; +} + + +static void mpris_playlists_dbus_proxy_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value) { + GVariant *_arguments; + GVariant *_reply; + GVariantBuilder _arguments_builder; + GVariantBuilder _tmp48_; + GVariantBuilder _tmp49_; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.mpris.MediaPlayer2.Playlists")); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ActivePlaylist")); + g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_init (&_tmp48_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp48_, g_variant_new_boolean ((*value).valid)); + g_variant_builder_init (&_tmp49_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp49_, g_variant_new_object_path ((*value).details.path)); + g_variant_builder_add_value (&_tmp49_, g_variant_new_string ((*value).details.name)); + g_variant_builder_add_value (&_tmp49_, g_variant_new_string ((*value).details.icon_path)); + g_variant_builder_add_value (&_tmp48_, g_variant_builder_end (&_tmp49_)); + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp48_)); + g_variant_builder_close (&_arguments_builder); + _arguments = g_variant_builder_end (&_arguments_builder); + _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); + if (!_reply) { + return; + } + g_variant_unref (_reply); +} + + +static void mpris_playlists_proxy_mpris_playlists_interface_init (MprisPlaylistsIface* iface) { + iface->ActivatePlaylist = mpris_playlists_proxy_ActivatePlaylist_async; + iface->ActivatePlaylist_finish = mpris_playlists_proxy_ActivatePlaylist_finish; + iface->GetPlaylists = mpris_playlists_proxy_GetPlaylists_async; + iface->GetPlaylists_finish = mpris_playlists_proxy_GetPlaylists_finish; + iface->get_Orderings = mpris_playlists_dbus_proxy_get_Orderings; + iface->set_Orderings = mpris_playlists_dbus_proxy_set_Orderings; + iface->get_PlaylistCount = mpris_playlists_dbus_proxy_get_PlaylistCount; + iface->set_PlaylistCount = mpris_playlists_dbus_proxy_set_PlaylistCount; + iface->get_ActivePlaylist = mpris_playlists_dbus_proxy_get_ActivePlaylist; + iface->set_ActivePlaylist = mpris_playlists_dbus_proxy_set_ActivePlaylist; +} + + +static void _dbus_mpris_playlists_ActivatePlaylist (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + char* playlist_id = NULL; + GVariant* _tmp50_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp50_ = g_variant_iter_next_value (&_arguments_iter); + playlist_id = g_variant_dup_string (_tmp50_, NULL); + g_variant_unref (_tmp50_); + mpris_playlists_ActivatePlaylist (self, playlist_id, (GAsyncReadyCallback) _dbus_mpris_playlists_ActivatePlaylist_ready, invocation); + _g_free0 (playlist_id); +} + + +static void _dbus_mpris_playlists_ActivatePlaylist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + invocation = _user_data_; + mpris_playlists_ActivatePlaylist_finish ((MprisPlaylists*) source_object, _res_, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation) { + GVariantIter _arguments_iter; + guint32 index = 0U; + GVariant* _tmp51_; + guint32 max_count = 0U; + GVariant* _tmp52_; + gchar* order = NULL; + GVariant* _tmp53_; + gboolean reverse_order = FALSE; + GVariant* _tmp54_; + g_variant_iter_init (&_arguments_iter, parameters); + _tmp51_ = g_variant_iter_next_value (&_arguments_iter); + index = g_variant_get_uint32 (_tmp51_); + g_variant_unref (_tmp51_); + _tmp52_ = g_variant_iter_next_value (&_arguments_iter); + max_count = g_variant_get_uint32 (_tmp52_); + g_variant_unref (_tmp52_); + _tmp53_ = g_variant_iter_next_value (&_arguments_iter); + order = g_variant_dup_string (_tmp53_, NULL); + g_variant_unref (_tmp53_); + _tmp54_ = g_variant_iter_next_value (&_arguments_iter); + reverse_order = g_variant_get_boolean (_tmp54_); + g_variant_unref (_tmp54_); + mpris_playlists_GetPlaylists (self, index, max_count, order, reverse_order, (GAsyncReadyCallback) _dbus_mpris_playlists_GetPlaylists_ready, invocation); + _g_free0 (order); +} + + +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length) { + if (array != NULL) { + int i; + for (i = 0; i < array_length; i = i + 1) { + playlist_details_destroy (&array[i]); + } + } + g_free (array); +} + + +static void _dbus_mpris_playlists_GetPlaylists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + PlaylistDetails* result; + int result_length1 = 0; + PlaylistDetails* _tmp55_; + GVariantBuilder _tmp56_; + int _tmp57_; + invocation = _user_data_; + result = mpris_playlists_GetPlaylists_finish ((MprisPlaylists*) source_object, _res_, &result_length1, &error); + if (error) { + g_dbus_method_invocation_return_gerror (invocation, error); + return; + } + _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); + _tmp55_ = result; + g_variant_builder_init (&_tmp56_, G_VARIANT_TYPE ("a(oss)")); + for (_tmp57_ = 0; _tmp57_ < result_length1; _tmp57_++) { + GVariantBuilder _tmp58_; + g_variant_builder_init (&_tmp58_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp58_, g_variant_new_object_path ((*_tmp55_).path)); + g_variant_builder_add_value (&_tmp58_, g_variant_new_string ((*_tmp55_).name)); + g_variant_builder_add_value (&_tmp58_, g_variant_new_string ((*_tmp55_).icon_path)); + g_variant_builder_add_value (&_tmp56_, g_variant_builder_end (&_tmp58_)); + _tmp55_++; + } + g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp56_)); + result = (_vala_PlaylistDetails_array_free ( result, result_length1), NULL); + _reply = g_variant_builder_end (&_reply_builder); + g_dbus_message_set_body (_reply_message, _reply); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); + g_object_unref (_reply_message); +} + + +static void mpris_playlists_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (method_name, "ActivatePlaylist") == 0) { + _dbus_mpris_playlists_ActivatePlaylist (object, parameters, invocation); + } else if (strcmp (method_name, "GetPlaylists") == 0) { + _dbus_mpris_playlists_GetPlaylists (object, parameters, invocation); + } else { + g_object_unref (invocation); + } +} + + +static GVariant* _dbus_mpris_playlists_get_Orderings (MprisPlaylists* self) { + gchar** result; + int result_length1; + gchar** _tmp59_; + GVariantBuilder _tmp60_; + int _tmp61_; + GVariant* _reply; + result = mpris_playlists_get_Orderings (self, &result_length1); + _tmp59_ = result; + g_variant_builder_init (&_tmp60_, G_VARIANT_TYPE ("as")); + for (_tmp61_ = 0; _tmp61_ < result_length1; _tmp61_++) { + g_variant_builder_add_value (&_tmp60_, g_variant_new_string (*_tmp59_)); + _tmp59_++; + } + _reply = g_variant_builder_end (&_tmp60_); + result = (_vala_array_free ( result, result_length1, (GDestroyNotify) g_free), NULL); + return _reply; +} + + +static GVariant* _dbus_mpris_playlists_get_PlaylistCount (MprisPlaylists* self) { + guint32 result; + GVariant* _reply; + result = mpris_playlists_get_PlaylistCount (self); + _reply = g_variant_new_uint32 (result); + return _reply; +} + + +static GVariant* _dbus_mpris_playlists_get_ActivePlaylist (MprisPlaylists* self) { + ActivePlaylistContainer result = {0}; + GVariantBuilder _tmp62_; + GVariantBuilder _tmp63_; + GVariant* _reply; + mpris_playlists_get_ActivePlaylist (self, &result); + g_variant_builder_init (&_tmp62_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp62_, g_variant_new_boolean (result.valid)); + g_variant_builder_init (&_tmp63_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp63_, g_variant_new_object_path (result.details.path)); + g_variant_builder_add_value (&_tmp63_, g_variant_new_string (result.details.name)); + g_variant_builder_add_value (&_tmp63_, g_variant_new_string (result.details.icon_path)); + g_variant_builder_add_value (&_tmp62_, g_variant_builder_end (&_tmp63_)); + _reply = g_variant_builder_end (&_tmp62_); + active_playlist_container_destroy (& result); + return _reply; +} + + +static GVariant* mpris_playlists_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "Orderings") == 0) { + return _dbus_mpris_playlists_get_Orderings (object); + } else if (strcmp (property_name, "PlaylistCount") == 0) { + return _dbus_mpris_playlists_get_PlaylistCount (object); + } else if (strcmp (property_name, "ActivePlaylist") == 0) { + return _dbus_mpris_playlists_get_ActivePlaylist (object); + } + return NULL; +} + + +static void _dbus_mpris_playlists_set_Orderings (MprisPlaylists* self, GVariant* _value) { + gchar** value = NULL; + int value_length1; + gchar** _tmp64_; + int _tmp64__length; + int _tmp64__size; + int _tmp64__length1; + GVariantIter _tmp65_; + GVariant* _tmp66_; + _tmp64_ = g_new (gchar*, 5); + _tmp64__length = 0; + _tmp64__size = 4; + _tmp64__length1 = 0; + g_variant_iter_init (&_tmp65_, _value); + for (; (_tmp66_ = g_variant_iter_next_value (&_tmp65_)) != NULL; _tmp64__length1++) { + if (_tmp64__size == _tmp64__length) { + _tmp64__size = 2 * _tmp64__size; + _tmp64_ = g_renew (gchar*, _tmp64_, _tmp64__size + 1); + } + _tmp64_[_tmp64__length++] = g_variant_dup_string (_tmp66_, NULL); + g_variant_unref (_tmp66_); + } + value_length1 = _tmp64__length1; + _tmp64_[_tmp64__length] = NULL; + value = _tmp64_; + mpris_playlists_set_Orderings (self, value, value_length1); + value = (_vala_array_free (value, value_length1, (GDestroyNotify) g_free), NULL); +} + + +static void _dbus_mpris_playlists_set_PlaylistCount (MprisPlaylists* self, GVariant* _value) { + guint32 value = 0U; + value = g_variant_get_uint32 (_value); + mpris_playlists_set_PlaylistCount (self, value); +} + + +static void _dbus_mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, GVariant* _value) { + ActivePlaylistContainer value = {0}; + ActivePlaylistContainer _tmp67_; + GVariantIter _tmp68_; + GVariant* _tmp69_; + GVariant* _tmp70_; + PlaylistDetails _tmp71_; + GVariantIter _tmp72_; + GVariant* _tmp73_; + GVariant* _tmp74_; + GVariant* _tmp75_; + g_variant_iter_init (&_tmp68_, _value); + _tmp69_ = g_variant_iter_next_value (&_tmp68_); + _tmp67_.valid = g_variant_get_boolean (_tmp69_); + g_variant_unref (_tmp69_); + _tmp70_ = g_variant_iter_next_value (&_tmp68_); + g_variant_iter_init (&_tmp72_, _tmp70_); + _tmp73_ = g_variant_iter_next_value (&_tmp72_); + _tmp71_.path = g_variant_dup_string (_tmp73_, NULL); + g_variant_unref (_tmp73_); + _tmp74_ = g_variant_iter_next_value (&_tmp72_); + _tmp71_.name = g_variant_dup_string (_tmp74_, NULL); + g_variant_unref (_tmp74_); + _tmp75_ = g_variant_iter_next_value (&_tmp72_); + _tmp71_.icon_path = g_variant_dup_string (_tmp75_, NULL); + g_variant_unref (_tmp75_); + _tmp67_.details = _tmp71_; + g_variant_unref (_tmp70_); + value = _tmp67_; + mpris_playlists_set_ActivePlaylist (self, &value); + active_playlist_container_destroy (&value); +} + + +static gboolean mpris_playlists_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { + gpointer* data; + gpointer object; + data = user_data; + object = data[0]; + if (strcmp (property_name, "Orderings") == 0) { + _dbus_mpris_playlists_set_Orderings (object, value); + return TRUE; + } else if (strcmp (property_name, "PlaylistCount") == 0) { + _dbus_mpris_playlists_set_PlaylistCount (object, value); + return TRUE; + } else if (strcmp (property_name, "ActivePlaylist") == 0) { + _dbus_mpris_playlists_set_ActivePlaylist (object, value); + return TRUE; + } + return FALSE; +} + + +static void _dbus_mpris_playlists_playlist_changed (GObject* _sender, PlaylistDetails* details, gpointer* _data) { + GDBusConnection * _connection; + const gchar * _path; + GVariant *_arguments; + GVariantBuilder _arguments_builder; + GVariantBuilder _tmp76_; + _connection = _data[1]; + _path = _data[2]; + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_init (&_tmp76_, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_tmp76_, g_variant_new_object_path ((*details).path)); + g_variant_builder_add_value (&_tmp76_, g_variant_new_string ((*details).name)); + g_variant_builder_add_value (&_tmp76_, g_variant_new_string ((*details).icon_path)); + g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp76_)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_connection_emit_signal (_connection, NULL, _path, "org.mpris.MediaPlayer2.Playlists", "PlaylistChanged", _arguments, NULL); +} + + +guint mpris_playlists_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { + guint result; + gpointer *data; + data = g_new (gpointer, 3); + data[0] = g_object_ref (object); + data[1] = g_object_ref (connection); + data[2] = g_strdup (path); + result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_mpris_playlists_dbus_interface_info), &_mpris_playlists_dbus_interface_vtable, data, _mpris_playlists_unregister_object, error); + if (!result) { + return 0; + } + g_signal_connect (object, "playlist-changed", (GCallback) _dbus_mpris_playlists_playlist_changed, data); + return result; +} + + +static void _mpris_playlists_unregister_object (gpointer user_data) { + gpointer* data; + data = user_data; + g_object_unref (data[0]); + g_object_unref (data[1]); + g_free (data[2]); + g_free (data); +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/src/mpris2-watcher.c b/src/mpris2-watcher.c new file mode 100644 index 0000000..3b4c72d --- /dev/null +++ b/src/mpris2-watcher.c @@ -0,0 +1,698 @@ +/* mpris2-watcher.c generated by valac 0.12.1, the Vala compiler + * generated from mpris2-watcher.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <stdlib.h> +#include <string.h> +#include <libxml/parser.h> +#include <libxml/tree.h> + + +#define TYPE_MPRIS2_WATCHER (mpris2_watcher_get_type ()) +#define MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_WATCHER, Mpris2Watcher)) +#define MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) +#define IS_MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_WATCHER)) +#define IS_MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_WATCHER)) +#define MPRIS2_WATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) + +typedef struct _Mpris2Watcher Mpris2Watcher; +typedef struct _Mpris2WatcherClass Mpris2WatcherClass; +typedef struct _Mpris2WatcherPrivate Mpris2WatcherPrivate; + +#define TYPE_FREE_DESKTOP_OBJECT (free_desktop_object_get_type ()) +#define FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObject)) +#define IS_FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_OBJECT)) +#define FREE_DESKTOP_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObjectIface)) + +typedef struct _FreeDesktopObject FreeDesktopObject; +typedef struct _FreeDesktopObjectIface FreeDesktopObjectIface; + +#define TYPE_FREE_DESKTOP_OBJECT_PROXY (free_desktop_object_proxy_get_type ()) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +#define TYPE_MPRIS_ROOT (mpris_root_get_type ()) +#define MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_ROOT, MprisRoot)) +#define IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_ROOT)) +#define MPRIS_ROOT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_ROOT, MprisRootIface)) + +typedef struct _MprisRoot MprisRoot; +typedef struct _MprisRootIface MprisRootIface; + +#define TYPE_MPRIS_ROOT_PROXY (mpris_root_proxy_get_type ()) +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _Mpris2WatcherCheckForActiveClientsData Mpris2WatcherCheckForActiveClientsData; + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE (free_desktop_introspectable_get_type ()) +#define FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectable)) +#define IS_FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE)) +#define FREE_DESKTOP_INTROSPECTABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectableIface)) + +typedef struct _FreeDesktopIntrospectable FreeDesktopIntrospectable; +typedef struct _FreeDesktopIntrospectableIface FreeDesktopIntrospectableIface; + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY (free_desktop_introspectable_proxy_get_type ()) + +struct _Mpris2Watcher { + GObject parent_instance; + Mpris2WatcherPrivate * priv; +}; + +struct _Mpris2WatcherClass { + GObjectClass parent_class; +}; + +struct _FreeDesktopObjectIface { + GTypeInterface parent_iface; + void (*list_names) (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + gchar** (*list_names_finish) (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +}; + +struct _Mpris2WatcherPrivate { + FreeDesktopObject* fdesktop_obj; +}; + +struct _MprisRootIface { + GTypeInterface parent_iface; + void (*Quit) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Quit_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + void (*Raise) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Raise_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + gboolean (*get_HasTracklist) (MprisRoot* self); + void (*set_HasTracklist) (MprisRoot* self, gboolean value); + gboolean (*get_CanQuit) (MprisRoot* self); + void (*set_CanQuit) (MprisRoot* self, gboolean value); + gboolean (*get_CanRaise) (MprisRoot* self); + void (*set_CanRaise) (MprisRoot* self, gboolean value); + gchar* (*get_Identity) (MprisRoot* self); + void (*set_Identity) (MprisRoot* self, const gchar* value); + gchar* (*get_DesktopEntry) (MprisRoot* self); + void (*set_DesktopEntry) (MprisRoot* self, const gchar* value); +}; + +struct _Mpris2WatcherCheckForActiveClientsData { + int _state_; + GObject* _source_object_; + GAsyncResult* _res_; + GSimpleAsyncResult* _async_result; + Mpris2Watcher* self; + gchar** interfaces; + gint interfaces_length1; + gint _interfaces_size_; + gint _tmp0_; + gchar** _tmp1_; + gchar** _tmp2_; + gint _tmp2__length1; + gint __tmp2__size_; + GError * e; + gchar** address_collection; + int address_collection_length1; + int address_it; + gchar* _tmp3_; + gchar* address; + gboolean _tmp4_; + MprisRoot* _tmp5_; + MprisRoot* mpris2_root; + gboolean _tmp6_; + gboolean use_playlists; + gchar* _tmp7_; + gchar* _tmp8_; + GError * _inner_error_; +}; + +struct _FreeDesktopIntrospectableIface { + GTypeInterface parent_iface; + gchar* (*Introspect) (FreeDesktopIntrospectable* self, GError** error); +}; + + +static gpointer mpris2_watcher_parent_class = NULL; + +GType mpris2_watcher_get_type (void) G_GNUC_CONST; +GType free_desktop_object_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_object_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_object_get_type (void) G_GNUC_CONST; +#define MPRIS2_WATCHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MPRIS2_WATCHER, Mpris2WatcherPrivate)) +enum { + MPRIS2_WATCHER_DUMMY_PROPERTY +}; +Mpris2Watcher* mpris2_watcher_new (void); +Mpris2Watcher* mpris2_watcher_construct (GType object_type); +static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data); +void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_); +static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data); +void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); +#define MPRIS_PREFIX "org.mpris.MediaPlayer2." +GType mpris_root_proxy_get_type (void) G_GNUC_CONST; +guint mpris_root_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_root_get_type (void) G_GNUC_CONST; +static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const gchar* name); +static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gchar* name); +gchar* mpris_root_get_DesktopEntry (MprisRoot* self); +static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDesktopObject* dbus_obj, const gchar* name, const gchar* previous_owner, const gchar* current_owner); +#define MPRIS_MEDIA_PLAYER_PATH "/org/mpris/MediaPlayer2" +GType free_desktop_introspectable_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_introspectable_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_introspectable_get_type (void) G_GNUC_CONST; +gchar* free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GError** error); +static gboolean mpris2_watcher_parse_interfaces (Mpris2Watcher* self, const gchar* interface_info); +static void g_cclosure_user_marshal_VOID__STRING_STRING_BOOLEAN (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static GObject * mpris2_watcher_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +#define FREEDESKTOP_SERVICE "org.freedesktop.DBus" +#define FREEDESKTOP_OBJECT "/org/freedesktop/DBus" +static void _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed (FreeDesktopObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer self); +static void mpris2_watcher_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +Mpris2Watcher* mpris2_watcher_construct (GType object_type) { + Mpris2Watcher * self = NULL; + self = (Mpris2Watcher*) g_object_new (object_type, NULL); + return self; +} + + +Mpris2Watcher* mpris2_watcher_new (void) { + return mpris2_watcher_construct (TYPE_MPRIS2_WATCHER); +} + + +static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data) { + Mpris2WatcherCheckForActiveClientsData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (Mpris2WatcherCheckForActiveClientsData, data); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { + Mpris2WatcherCheckForActiveClientsData* _data_; + _data_ = g_slice_new0 (Mpris2WatcherCheckForActiveClientsData); + _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, mpris2_watcher_check_for_active_clients); + g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, mpris2_watcher_check_for_active_clients_data_free); + _data_->self = _g_object_ref0 (self); + mpris2_watcher_check_for_active_clients_co (_data_); +} + + +void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_) { + Mpris2WatcherCheckForActiveClientsData* _data_; + _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); +} + + +static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { + Mpris2WatcherCheckForActiveClientsData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + mpris2_watcher_check_for_active_clients_co (data); +} + + +static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data) { + switch (data->_state_) { + case 0: + goto _state_0; + case 1: + goto _state_1; + default: + g_assert_not_reached (); + } + _state_0: + data->interfaces_length1 = 0; + data->_interfaces_size_ = 0; + data->_state_ = 1; + free_desktop_object_list_names (data->self->priv->fdesktop_obj, mpris2_watcher_check_for_active_clients_ready, data); + return FALSE; + _state_1: + data->_tmp1_ = NULL; + data->_tmp1_ = free_desktop_object_list_names_finish (data->self->priv->fdesktop_obj, data->_res_, &data->_tmp0_, &data->_inner_error_); + data->_tmp2_ = data->_tmp1_; + data->_tmp2__length1 = data->_tmp0_; + data->__tmp2__size_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + if (data->_inner_error_->domain == G_IO_ERROR) { + goto __catch7_g_io_error; + } + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + data->interfaces = data->_tmp2_; + data->interfaces_length1 = data->_tmp2__length1; + data->_interfaces_size_ = data->_tmp2__length1; + goto __finally7; + __catch7_g_io_error: + { + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + g_warning ("mpris2-watcher.vala:60: Mpris2watcher could fetch active interfaces at" \ +" startup: %s", data->e->message); + _g_error_free0 (data->e); + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; + } + __finally7: + if (data->_inner_error_ != NULL) { + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; + } + { + data->address_collection = data->interfaces; + data->address_collection_length1 = data->interfaces_length1; + for (data->address_it = 0; data->address_it < data->interfaces_length1; data->address_it = data->address_it + 1) { + data->_tmp3_ = g_strdup (data->address_collection[data->address_it]); + data->address = data->_tmp3_; + { + data->_tmp4_ = g_str_has_prefix (data->address, MPRIS_PREFIX); + if (data->_tmp4_) { + data->_tmp5_ = NULL; + data->_tmp5_ = mpris2_watcher_create_mpris_root (data->self, data->address); + data->mpris2_root = data->_tmp5_; + if (data->mpris2_root == NULL) { + _g_object_unref0 (data->mpris2_root); + _g_free0 (data->address); + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; + } + data->_tmp6_ = mpris2_watcher_supports_playlists (data->self, data->address); + data->use_playlists = data->_tmp6_; + data->_tmp7_ = NULL; + data->_tmp7_ = mpris_root_get_DesktopEntry (data->mpris2_root); + data->_tmp8_ = data->_tmp7_; + g_signal_emit_by_name (data->self, "client-appeared", data->_tmp8_, data->address, data->use_playlists); + _g_free0 (data->_tmp8_); + _g_object_unref0 (data->mpris2_root); + } + _g_free0 (data->address); + } + } + } + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); + } else { + g_simple_async_result_complete (data->_async_result); + } + g_object_unref (data->_async_result); + return FALSE; +} + + +static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDesktopObject* dbus_obj, const gchar* name, const gchar* previous_owner, const gchar* current_owner) { + MprisRoot* _tmp0_ = NULL; + MprisRoot* mpris2_root; + gboolean _tmp1_ = FALSE; + g_return_if_fail (self != NULL); + g_return_if_fail (dbus_obj != NULL); + g_return_if_fail (name != NULL); + g_return_if_fail (previous_owner != NULL); + g_return_if_fail (current_owner != NULL); + _tmp0_ = mpris2_watcher_create_mpris_root (self, name); + mpris2_root = _tmp0_; + if (mpris2_root == NULL) { + _g_object_unref0 (mpris2_root); + return; + } + if (g_strcmp0 (previous_owner, "") != 0) { + _tmp1_ = g_strcmp0 (current_owner, "") == 0; + } else { + _tmp1_ = FALSE; + } + if (_tmp1_) { + g_debug ("mpris2-watcher.vala:84: Client '%s' gone down", name); + g_signal_emit_by_name (self, "client-disappeared", name); + } else { + gboolean _tmp2_ = FALSE; + if (g_strcmp0 (previous_owner, "") == 0) { + _tmp2_ = g_strcmp0 (current_owner, "") != 0; + } else { + _tmp2_ = FALSE; + } + if (_tmp2_) { + gboolean _tmp3_; + gboolean use_playlists; + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + g_debug ("mpris2-watcher.vala:88: Client '%s' has appeared", name); + _tmp3_ = mpris2_watcher_supports_playlists (self, name); + use_playlists = _tmp3_; + _tmp4_ = mpris_root_get_DesktopEntry (mpris2_root); + _tmp5_ = _tmp4_; + g_signal_emit_by_name (self, "client-appeared", _tmp5_, name, use_playlists); + _g_free0 (_tmp5_); + } + } + _g_object_unref0 (mpris2_root); +} + + +static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const gchar* name) { + MprisRoot* result = NULL; + MprisRoot* mpris2_root; + gboolean _tmp0_; + GError * _inner_error_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (name != NULL, NULL); + mpris2_root = NULL; + _tmp0_ = g_str_has_prefix (name, MPRIS_PREFIX); + if (_tmp0_) { + MprisRoot* _tmp1_ = NULL; + MprisRoot* _tmp2_; + _tmp1_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.mpris.MediaPlayer2", NULL); + _tmp2_ = (MprisRoot*) _tmp1_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch8_g_io_error; + } + _g_object_unref0 (mpris2_root); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; + } + _g_object_unref0 (mpris2_root); + mpris2_root = _tmp2_; + goto __finally8; + __catch8_g_io_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("mpris2-watcher.vala:103: Mpris2watcher could not create a root interfa" \ +"ce: %s", e->message); + _g_error_free0 (e); + } + __finally8: + if (_inner_error_ != NULL) { + _g_object_unref0 (mpris2_root); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; + } + } + result = mpris2_root; + return result; +} + + +static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gchar* name) { + gboolean result = FALSE; + FreeDesktopIntrospectable* introspectable = NULL; + FreeDesktopIntrospectable* _tmp0_ = NULL; + FreeDesktopIntrospectable* _tmp1_; + gchar* _tmp2_ = NULL; + gchar* results; + gboolean _tmp3_; + GError * _inner_error_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (name != NULL, FALSE); + _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL); + _tmp1_ = (FreeDesktopIntrospectable*) _tmp0_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch9_g_io_error; + } + _g_object_unref0 (introspectable); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return FALSE; + } + _g_object_unref0 (introspectable); + introspectable = _tmp1_; + _tmp2_ = free_desktop_introspectable_Introspect (introspectable, &_inner_error_); + results = _tmp2_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch9_g_io_error; + } + _g_object_unref0 (introspectable); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return FALSE; + } + _tmp3_ = mpris2_watcher_parse_interfaces (self, results); + result = _tmp3_; + _g_free0 (results); + _g_object_unref0 (introspectable); + return result; + _g_free0 (results); + goto __finally9; + __catch9_g_io_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("mpris2-watcher.vala:131: Could not create an introspectable object: %s", e->message); + _g_error_free0 (e); + } + __finally9: + if (_inner_error_ != NULL) { + _g_object_unref0 (introspectable); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return FALSE; + } + result = FALSE; + _g_object_unref0 (introspectable); + return result; +} + + +static gboolean mpris2_watcher_parse_interfaces (Mpris2Watcher* self, const gchar* interface_info) { + gboolean result = FALSE; + gboolean _result_; + xmlDoc* _tmp0_ = NULL; + xmlDoc* xml_doc; + xmlNode* _tmp1_ = NULL; + xmlNode* root_node; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (interface_info != NULL, FALSE); + _result_ = FALSE; + _tmp0_ = xmlParseDoc (interface_info); + xml_doc = _tmp0_; + if (xml_doc == NULL) { + g_warning ("mpris2-watcher.vala:143: Mpris2Watcher - parse-interfaces - failed to " \ +"instantiate xml doc"); + result = FALSE; + return result; + } + _tmp1_ = xmlDocGetRootElement (xml_doc); + root_node = _tmp1_; + if (root_node == NULL) { + xmlFreeDoc (xml_doc); + g_warning ("mpris2-watcher.vala:151: Mpris2Watcher - the interface info xml is emp" \ +"ty"); + result = FALSE; + return result; + } + { + xmlNode* iter; + iter = root_node->children; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + xmlAttr* attributes; + gchar* _tmp3_; + gchar* interface_name; + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + gboolean _tmp6_; + if (!_tmp2_) { + iter = iter->next; + } + _tmp2_ = FALSE; + if (!(iter != NULL)) { + break; + } + if (iter->type != XML_ELEMENT_NODE) { + continue; + } + attributes = iter->properties; + _tmp3_ = g_strdup (attributes->children->content); + interface_name = _tmp3_; + g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", interface_name); + _tmp4_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL); + _tmp5_ = _tmp4_; + _tmp6_ = g_strcmp0 (interface_name, _tmp5_) == 0; + _g_free0 (_tmp5_); + if (_tmp6_) { + _result_ = TRUE; + } + _g_free0 (interface_name); + } + } + } + xmlFreeDoc (xml_doc); + result = _result_; + return result; +} + + +static void g_cclosure_user_marshal_VOID__STRING_STRING_BOOLEAN (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__STRING_STRING_BOOLEAN) (gpointer data1, const char* arg_1, const char* arg_2, gboolean arg_3, gpointer data2); + register GMarshalFunc_VOID__STRING_STRING_BOOLEAN callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 4); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_boolean (param_values + 3), data2); +} + + +static void _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed (FreeDesktopObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer self) { + mpris2_watcher_name_changes_detected (self, _sender, name, old_owner, new_owner); +} + + +static GObject * mpris2_watcher_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + Mpris2Watcher * self; + FreeDesktopObject* _tmp0_ = NULL; + FreeDesktopObject* _tmp1_; + GError * _inner_error_ = NULL; + parent_class = G_OBJECT_CLASS (mpris2_watcher_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = MPRIS2_WATCHER (obj); + _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", FREEDESKTOP_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", FREEDESKTOP_OBJECT, "g-interface-name", "org.freedesktop.DBus", NULL); + _tmp1_ = (FreeDesktopObject*) _tmp0_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch10_g_io_error; + } + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + _g_object_unref0 (self->priv->fdesktop_obj); + self->priv->fdesktop_obj = _tmp1_; + g_signal_connect_object (self->priv->fdesktop_obj, "name-owner-changed", (GCallback) _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed, self, 0); + mpris2_watcher_check_for_active_clients (self, NULL, NULL); + goto __finally10; + __catch10_g_io_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + g_warning ("mpris2-watcher.vala:46: Mpris2watcher could not set up a watch for mpr" \ +"is clients appearing on the bus: %s", e->message); + _g_error_free0 (e); + } + __finally10: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + } + return obj; +} + + +static void mpris2_watcher_class_init (Mpris2WatcherClass * klass) { + mpris2_watcher_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (Mpris2WatcherPrivate)); + G_OBJECT_CLASS (klass)->constructor = mpris2_watcher_constructor; + G_OBJECT_CLASS (klass)->finalize = mpris2_watcher_finalize; + g_signal_new ("client_appeared", TYPE_MPRIS2_WATCHER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_BOOLEAN, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); + g_signal_new ("client_disappeared", TYPE_MPRIS2_WATCHER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); +} + + +static void mpris2_watcher_instance_init (Mpris2Watcher * self) { + self->priv = MPRIS2_WATCHER_GET_PRIVATE (self); +} + + +static void mpris2_watcher_finalize (GObject* obj) { + Mpris2Watcher * self; + self = MPRIS2_WATCHER (obj); + _g_object_unref0 (self->priv->fdesktop_obj); + G_OBJECT_CLASS (mpris2_watcher_parent_class)->finalize (obj); +} + + +GType mpris2_watcher_get_type (void) { + static volatile gsize mpris2_watcher_type_id__volatile = 0; + if (g_once_init_enter (&mpris2_watcher_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (Mpris2WatcherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mpris2_watcher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Mpris2Watcher), 0, (GInstanceInitFunc) mpris2_watcher_instance_init, NULL }; + GType mpris2_watcher_type_id; + mpris2_watcher_type_id = g_type_register_static (G_TYPE_OBJECT, "Mpris2Watcher", &g_define_type_info, 0); + g_once_init_leave (&mpris2_watcher_type_id__volatile, mpris2_watcher_type_id); + } + return mpris2_watcher_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c new file mode 100644 index 0000000..852acd5 --- /dev/null +++ b/src/music-player-bridge.c @@ -0,0 +1,819 @@ +/* music-player-bridge.c generated by valac 0.12.1, the Vala compiler + * generated from music-player-bridge.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <gee.h> +#include <stdlib.h> +#include <string.h> +#include <gio/gio.h> +#include <gio/gdesktopappinfo.h> + + +#define TYPE_MUSIC_PLAYER_BRIDGE (music_player_bridge_get_type ()) +#define MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridge)) +#define MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass)) +#define IS_MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MUSIC_PLAYER_BRIDGE)) +#define IS_MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MUSIC_PLAYER_BRIDGE)) +#define MUSIC_PLAYER_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass)) + +typedef struct _MusicPlayerBridge MusicPlayerBridge; +typedef struct _MusicPlayerBridgeClass MusicPlayerBridgeClass; +typedef struct _MusicPlayerBridgePrivate MusicPlayerBridgePrivate; + +#define TYPE_SETTINGS_MANAGER (settings_manager_get_type ()) +#define SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SETTINGS_MANAGER, SettingsManager)) +#define SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) +#define IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SETTINGS_MANAGER)) +#define IS_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SETTINGS_MANAGER)) +#define SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) + +typedef struct _SettingsManager SettingsManager; +typedef struct _SettingsManagerClass SettingsManagerClass; + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; + +#define TYPE_MPRIS2_WATCHER (mpris2_watcher_get_type ()) +#define MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_WATCHER, Mpris2Watcher)) +#define MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) +#define IS_MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_WATCHER)) +#define IS_MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_WATCHER)) +#define MPRIS2_WATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) + +typedef struct _Mpris2Watcher Mpris2Watcher; +typedef struct _Mpris2WatcherClass Mpris2WatcherClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; +#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +struct _MusicPlayerBridge { + GObject parent_instance; + MusicPlayerBridgePrivate * priv; +}; + +struct _MusicPlayerBridgeClass { + GObjectClass parent_class; +}; + +struct _MusicPlayerBridgePrivate { + SettingsManager* settings_manager; + DbusmenuMenuitem* root_menu; + GeeHashMap* registered_clients; + Mpris2Watcher* watcher; +}; + +typedef enum { + PLAYER_CONTROLLER_STATE_OFFLINE, + PLAYER_CONTROLLER_STATE_INSTANTIATING, + PLAYER_CONTROLLER_STATE_READY, + PLAYER_CONTROLLER_STATE_CONNECTED, + PLAYER_CONTROLLER_STATE_DISCONNECTED +} PlayerControllerstate; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + + +static gpointer music_player_bridge_parent_class = NULL; + +GType music_player_bridge_get_type (void) G_GNUC_CONST; +GType settings_manager_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; +GType mpris2_watcher_get_type (void) G_GNUC_CONST; +#define MUSIC_PLAYER_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgePrivate)) +enum { + MUSIC_PLAYER_BRIDGE_DUMMY_PROPERTY +}; +#define MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT 3 +MusicPlayerBridge* music_player_bridge_new (void); +MusicPlayerBridge* music_player_bridge_construct (GType object_type); +static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gchar** blacklist, int blacklist_length1); +static gchar* music_player_bridge_determine_key (gchar* desktop_or_interface); +void player_controller_remove_from_menu (PlayerController* self); +void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_); +static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self); +GeeArrayList* settings_manager_fetch_interested (SettingsManager* self); +static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop); +static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop); +static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self); +GType player_controller_state_get_type (void) G_GNUC_CONST; +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4 +void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, const gchar* desktop, const gchar* dbus_name, gboolean use_playlists); +gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1); +static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle); +void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name); +static gboolean* _bool_dup (gboolean* self); +GType player_item_get_type (void) G_GNUC_CONST; +GType mpris2_controller_get_type (void) G_GNUC_CONST; +void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state); +void player_controller_activate (PlayerController* self, const gchar* dbus_name); +void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gchar* mpris_root_interface); +void player_controller_hibernate (PlayerController* self); +void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu); +Mpris2Watcher* mpris2_watcher_new (void); +Mpris2Watcher* mpris2_watcher_construct (GType object_type); +static void _music_player_bridge_client_has_become_available_mpris2_watcher_client_appeared (Mpris2Watcher* _sender, const gchar* desktop_file_name, const gchar* dbus_name, gboolean use_playlists, gpointer self); +static void _music_player_bridge_client_has_vanished_mpris2_watcher_client_disappeared (Mpris2Watcher* _sender, const gchar* dbus_name, gpointer self); +static GObject * music_player_bridge_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +SettingsManager* settings_manager_new (void); +SettingsManager* settings_manager_construct (GType object_type); +static void _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates (SettingsManager* _sender, gchar** new_blacklist, int new_blacklist_length1, gpointer self); +static void music_player_bridge_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static gint _vala_array_length (gpointer array); + + +MusicPlayerBridge* music_player_bridge_construct (GType object_type) { + MusicPlayerBridge * self = NULL; + self = (MusicPlayerBridge*) g_object_new (object_type, NULL); + return self; +} + + +MusicPlayerBridge* music_player_bridge_new (void) { + return music_player_bridge_construct (TYPE_MUSIC_PLAYER_BRIDGE); +} + + +static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gchar** blacklist, int blacklist_length1) { + g_return_if_fail (self != NULL); + g_debug ("music-player-bridge.vala:45: some blacklist update"); + { + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = blacklist; + s_collection_length1 = blacklist_length1; + for (s_it = 0; s_it < blacklist_length1; s_it = s_it + 1) { + gchar* _tmp0_; + gchar* s; + _tmp0_ = g_strdup (s_collection[s_it]); + s = _tmp0_; + { + gchar* _tmp1_; + gchar* _tmp2_ = NULL; + gchar* key; + gboolean _tmp3_; + _tmp1_ = g_strdup (s); + _tmp2_ = music_player_bridge_determine_key (_tmp1_); + key = _tmp2_; + _tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, key); + if (_tmp3_) { + gpointer _tmp4_ = NULL; + PlayerController* _tmp5_; + g_debug ("music-player-bridge.vala:50: Apparently %s is now blacklisted - remove" \ +" thy self", key); + _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, key); + _tmp5_ = (PlayerController*) _tmp4_; + player_controller_remove_from_menu (_tmp5_); + _g_object_unref0 (_tmp5_); + gee_abstract_map_unset ((GeeAbstractMap*) self->priv->registered_clients, key, NULL); + } + _g_free0 (key); + _g_free0 (s); + } + } + } + mpris2_watcher_check_for_active_clients (self->priv->watcher, NULL, NULL); +} + + +static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) { + g_return_if_fail (self != NULL); + { + GeeArrayList* _tmp0_ = NULL; + GeeArrayList* _desktop_list; + gint _tmp1_; + gint _desktop_size; + gint _desktop_index; + _tmp0_ = settings_manager_fetch_interested (self->priv->settings_manager); + _desktop_list = _tmp0_; + _tmp1_ = gee_collection_get_size ((GeeCollection*) _desktop_list); + _desktop_size = _tmp1_; + _desktop_index = -1; + while (TRUE) { + gpointer _tmp2_ = NULL; + gchar* desktop; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + GAppInfo* _tmp5_ = NULL; + GAppInfo* _tmp6_; + GAppInfo* app_info; + gchar* _tmp7_; + gchar* _tmp8_ = NULL; + gchar* mpris_key; + gchar* _tmp9_ = NULL; + gchar* _tmp10_; + gint _tmp11_; + PlayerController* _tmp12_ = NULL; + PlayerController* _tmp13_; + PlayerController* ctrl; + _desktop_index = _desktop_index + 1; + if (!(_desktop_index < _desktop_size)) { + break; + } + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _desktop_list, _desktop_index); + desktop = (gchar*) _tmp2_; + g_debug ("music-player-bridge.vala:62: interested client found : %s", desktop); + _tmp3_ = g_strconcat (desktop, ".desktop", NULL); + _tmp4_ = _tmp3_; + _tmp5_ = music_player_bridge_create_app_info (_tmp4_); + _tmp6_ = _tmp5_; + _g_free0 (_tmp4_); + app_info = _tmp6_; + if (app_info == NULL) { + g_warning ("music-player-bridge.vala:65: Could not create app_info for path %s \n" \ +" Getting out of here ", desktop); + _g_object_unref0 (app_info); + _g_free0 (desktop); + continue; + } + _tmp7_ = g_strdup (desktop); + _tmp8_ = music_player_bridge_determine_key (_tmp7_); + mpris_key = _tmp8_; + _tmp9_ = music_player_bridge_fetch_icon_name (desktop); + _tmp10_ = _tmp9_; + _tmp11_ = music_player_bridge_calculate_menu_position (self); + _tmp12_ = player_controller_new (self->priv->root_menu, app_info, NULL, _tmp10_, _tmp11_, NULL, PLAYER_CONTROLLER_STATE_OFFLINE); + _tmp13_ = _tmp12_; + _g_free0 (_tmp10_); + ctrl = _tmp13_; + gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl); + _g_object_unref0 (ctrl); + _g_free0 (mpris_key); + _g_object_unref0 (app_info); + _g_free0 (desktop); + } + _g_object_unref0 (_desktop_list); + } +} + + +static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (self != NULL, 0); + _tmp0_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + if (_tmp0_ == 0) { + result = MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT; + return result; + } else { + gint _tmp1_; + _tmp1_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + result = MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT + (_tmp1_ * PLAYER_CONTROLLER_WIDGET_QUANTITY); + return result; + } +} + + +static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) { + int i; + for (i = 0; i < stack_length; i++) { + if (g_strcmp0 (stack[i], needle) == 0) { + return TRUE; + } + } + return FALSE; +} + + +static gboolean* _bool_dup (gboolean* self) { + gboolean* dup; + dup = g_new0 (gboolean, 1); + memcpy (dup, self, sizeof (gboolean)); + return dup; +} + + +static gpointer __bool_dup0 (gpointer self) { + return self ? _bool_dup (self) : NULL; +} + + +void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, const gchar* desktop, const gchar* dbus_name, gboolean use_playlists) { + gboolean _tmp0_ = FALSE; + gint _tmp1_; + gchar** _tmp2_ = NULL; + gchar** _tmp3_; + gint _tmp3__length1; + gboolean _tmp4_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + GAppInfo* _tmp7_ = NULL; + GAppInfo* _tmp8_; + GAppInfo* app_info; + gchar* _tmp9_; + gchar* _tmp10_ = NULL; + gchar* mpris_key; + gboolean _tmp11_; + g_return_if_fail (self != NULL); + g_return_if_fail (desktop != NULL); + g_return_if_fail (dbus_name != NULL); + if (desktop == NULL) { + _tmp0_ = TRUE; + } else { + _tmp0_ = g_strcmp0 (desktop, "") == 0; + } + if (_tmp0_) { + g_warning ("music-player-bridge.vala:96: Client %s attempting to register without " \ +"desktop entry being set on the mpris root", dbus_name); + return; + } + _tmp2_ = settings_manager_fetch_blacklist (self->priv->settings_manager, &_tmp1_); + _tmp3_ = _tmp2_; + _tmp3__length1 = _tmp1_; + _tmp4_ = _vala_string_array_contains (_tmp3_, _tmp1_, desktop); + _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL); + if (_tmp4_) { + g_debug ("music-player-bridge.vala:101: Client %s attempting to register but I'm" \ +" afraid it is blacklisted", desktop); + return; + } + g_debug ("music-player-bridge.vala:106: client_has_become_available %s", desktop); + _tmp5_ = g_strconcat (desktop, ".desktop", NULL); + _tmp6_ = _tmp5_; + _tmp7_ = music_player_bridge_create_app_info (_tmp6_); + _tmp8_ = _tmp7_; + _g_free0 (_tmp6_); + app_info = _tmp8_; + if (app_info == NULL) { + g_warning ("music-player-bridge.vala:109: Could not create app_info for path %s \n" \ +" Getting out of here ", desktop); + _g_object_unref0 (app_info); + return; + } + _tmp9_ = g_strdup (desktop); + _tmp10_ = music_player_bridge_determine_key (_tmp9_); + mpris_key = _tmp10_; + _tmp11_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + if (_tmp11_ == FALSE) { + gchar* _tmp12_ = NULL; + gchar* _tmp13_; + gint _tmp14_; + PlayerController* _tmp15_ = NULL; + PlayerController* _tmp16_; + PlayerController* ctrl; + g_debug ("music-player-bridge.vala:117: New client has registered that we have n" \ +"ot seen before: %s", dbus_name); + _tmp12_ = music_player_bridge_fetch_icon_name (desktop); + _tmp13_ = _tmp12_; + _tmp14_ = music_player_bridge_calculate_menu_position (self); + _tmp15_ = player_controller_new (self->priv->root_menu, app_info, dbus_name, _tmp13_, _tmp14_, &use_playlists, PLAYER_CONTROLLER_STATE_READY); + _tmp16_ = _tmp15_; + _g_free0 (_tmp13_); + ctrl = _tmp16_; + gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl); + g_debug ("music-player-bridge.vala:126: Have not seen this %s before, new contro" \ +"ller created.", desktop); + settings_manager_add_interested (self->priv->settings_manager, desktop); + g_debug ("music-player-bridge.vala:128: application added to the interested list"); + _g_object_unref0 (ctrl); + } else { + gpointer _tmp17_ = NULL; + PlayerController* _tmp18_; + gboolean* _tmp19_; + gpointer _tmp20_ = NULL; + PlayerController* _tmp21_; + gpointer _tmp22_ = NULL; + PlayerController* _tmp23_; + _tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp18_ = (PlayerController*) _tmp17_; + _tmp19_ = __bool_dup0 (&use_playlists); + _g_free0 (_tmp18_->use_playlists); + _tmp18_->use_playlists = _tmp19_; + _g_object_unref0 (_tmp18_); + _tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp21_ = (PlayerController*) _tmp20_; + player_controller_update_state (_tmp21_, PLAYER_CONTROLLER_STATE_READY); + _g_object_unref0 (_tmp21_); + _tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp23_ = (PlayerController*) _tmp22_; + player_controller_activate (_tmp23_, dbus_name); + _g_object_unref0 (_tmp23_); + g_debug ("music-player-bridge.vala:134: Application has already registered - awa" \ +"ken the hibernation: %s \n", dbus_name); + } + _g_free0 (mpris_key); + _g_object_unref0 (app_info); +} + + +void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gchar* mpris_root_interface) { + g_return_if_fail (self != NULL); + g_return_if_fail (mpris_root_interface != NULL); + g_debug ("music-player-bridge.vala:140: MusicPlayerBridge -> client with dbus in" \ +"terface %s has vanished", mpris_root_interface); + if (self->priv->root_menu != NULL) { + gchar* _tmp0_; + gchar* _tmp1_ = NULL; + gchar* mpris_key; + gboolean _tmp2_ = FALSE; + g_debug ("music-player-bridge.vala:143: attempt to remove %s", mpris_root_interface); + _tmp0_ = g_strdup (mpris_root_interface); + _tmp1_ = music_player_bridge_determine_key (_tmp0_); + mpris_key = _tmp1_; + if (mpris_key != NULL) { + gboolean _tmp3_; + _tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp2_ = _tmp3_; + } else { + _tmp2_ = FALSE; + } + if (_tmp2_) { + gpointer _tmp4_ = NULL; + PlayerController* _tmp5_; + _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp5_ = (PlayerController*) _tmp4_; + player_controller_hibernate (_tmp5_); + _g_object_unref0 (_tmp5_); + g_debug ("music-player-bridge.vala:147: Successively offlined client %s", mpris_key); + } + _g_free0 (mpris_key); + } +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static void _music_player_bridge_client_has_become_available_mpris2_watcher_client_appeared (Mpris2Watcher* _sender, const gchar* desktop_file_name, const gchar* dbus_name, gboolean use_playlists, gpointer self) { + music_player_bridge_client_has_become_available (self, desktop_file_name, dbus_name, use_playlists); +} + + +static void _music_player_bridge_client_has_vanished_mpris2_watcher_client_disappeared (Mpris2Watcher* _sender, const gchar* dbus_name, gpointer self) { + music_player_bridge_client_has_vanished (self, dbus_name); +} + + +void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu) { + DbusmenuMenuitem* _tmp0_; + Mpris2Watcher* _tmp1_ = NULL; + g_return_if_fail (self != NULL); + g_return_if_fail (menu != NULL); + _tmp0_ = _g_object_ref0 (menu); + _g_object_unref0 (self->priv->root_menu); + self->priv->root_menu = _tmp0_; + music_player_bridge_try_to_add_inactive_familiar_clients (self); + _tmp1_ = mpris2_watcher_new (); + _g_object_unref0 (self->priv->watcher); + self->priv->watcher = _tmp1_; + g_signal_connect_object (self->priv->watcher, "client-appeared", (GCallback) _music_player_bridge_client_has_become_available_mpris2_watcher_client_appeared, self, 0); + g_signal_connect_object (self->priv->watcher, "client-disappeared", (GCallback) _music_player_bridge_client_has_vanished_mpris2_watcher_client_disappeared, self, 0); +} + + +static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop) { + GAppInfo* result = NULL; + GDesktopAppInfo* _tmp0_ = NULL; + GDesktopAppInfo* info; + gboolean _tmp1_ = FALSE; + GDesktopAppInfo* _tmp2_; + GAppInfo* _tmp3_; + GAppInfo* app_info; + g_return_val_if_fail (desktop != NULL, NULL); + _tmp0_ = g_desktop_app_info_new (desktop); + info = _tmp0_; + if (desktop == NULL) { + _tmp1_ = TRUE; + } else { + _tmp1_ = info == NULL; + } + if (_tmp1_) { + g_warning ("music-player-bridge.vala:166: Could not create a desktopappinfo instan" \ +"ce from app: %s", desktop); + result = NULL; + _g_object_unref0 (info); + return result; + } + _tmp2_ = info; + _tmp3_ = _g_object_ref0 (G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL); + app_info = _tmp3_; + result = app_info; + _g_object_unref0 (info); + return result; +} + + +static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_; + GDesktopAppInfo* _tmp2_ = NULL; + GDesktopAppInfo* _tmp3_; + GDesktopAppInfo* info; + GKeyFile* _tmp4_ = NULL; + GKeyFile* desktop_keyfile; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + GError * _inner_error_ = NULL; + g_return_val_if_fail (desktop != NULL, NULL); + _tmp0_ = g_strconcat (desktop, ".desktop", NULL); + _tmp1_ = _tmp0_; + _tmp2_ = g_desktop_app_info_new (_tmp1_); + _tmp3_ = _tmp2_; + _g_free0 (_tmp1_); + info = _tmp3_; + _tmp4_ = g_key_file_new (); + desktop_keyfile = _tmp4_; + _tmp5_ = g_desktop_app_info_get_filename (info); + g_key_file_load_from_file (desktop_keyfile, _tmp5_, G_KEY_FILE_NONE, &_inner_error_); + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_FILE_ERROR) { + goto __catch0_g_file_error; + } + if (_inner_error_->domain == G_KEY_FILE_ERROR) { + goto __catch0_g_key_file_error; + } + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; + } + goto __finally0; + __catch0_g_file_error: + { + GError * _error_; + _error_ = _inner_error_; + _inner_error_ = NULL; + g_warning ("music-player-bridge.vala:182: Error loading keyfile - FileError"); + result = NULL; + _g_error_free0 (_error_); + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + return result; + } + goto __finally0; + __catch0_g_key_file_error: + { + GError * _error_; + _error_ = _inner_error_; + _inner_error_ = NULL; + g_warning ("music-player-bridge.vala:186: Error loading keyfile - KeyFileError"); + result = NULL; + _g_error_free0 (_error_); + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + return result; + } + __finally0: + if (_inner_error_ != NULL) { + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; + } + _tmp6_ = g_key_file_get_string (desktop_keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, &_inner_error_); + _tmp7_ = _tmp6_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_KEY_FILE_ERROR) { + goto __catch1_g_key_file_error; + } + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; + } + result = _tmp7_; + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + return result; + goto __finally1; + __catch1_g_key_file_error: + { + GError * _error_; + _error_ = _inner_error_; + _inner_error_ = NULL; + g_warning ("music-player-bridge.vala:195: Error trying to fetch the icon name from" \ +" the keyfile"); + result = NULL; + _g_error_free0 (_error_); + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + return result; + } + __finally1: + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return NULL; +} + + +static gchar* music_player_bridge_determine_key (gchar* desktop_or_interface) { + gchar* result = NULL; + gchar* _tmp0_; + gchar* _result_; + gchar** _tmp1_; + gchar** _tmp2_ = NULL; + gchar** tokens; + gint tokens_length1; + gint _tokens_size_; + gchar** _tmp4_; + gchar** _tmp5_ = NULL; + gchar** temp; + gint temp_length1; + gint _temp_size_; + g_return_val_if_fail (desktop_or_interface != NULL, NULL); + _tmp0_ = g_strdup (desktop_or_interface); + _result_ = _tmp0_; + _tmp2_ = _tmp1_ = g_strsplit (desktop_or_interface, ".", 0); + tokens = _tmp2_; + tokens_length1 = _vala_array_length (_tmp1_); + _tokens_size_ = _vala_array_length (_tmp1_); + if (tokens_length1 > 1) { + gchar* _tmp3_; + _tmp3_ = g_strdup (tokens[tokens_length1 - 1]); + _g_free0 (_result_); + _result_ = _tmp3_; + } + _tmp5_ = _tmp4_ = g_strsplit (_result_, "-", 0); + temp = _tmp5_; + temp_length1 = _vala_array_length (_tmp4_); + _temp_size_ = _vala_array_length (_tmp4_); + if (temp_length1 > 1) { + gchar* _tmp6_; + _tmp6_ = g_strdup (temp[0]); + _g_free0 (_result_); + _result_ = _tmp6_; + } + g_debug ("music-player-bridge.vala:218: determine key result = %s", _result_); + result = _result_; + temp = (_vala_array_free (temp, temp_length1, (GDestroyNotify) g_free), NULL); + tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (desktop_or_interface); + return result; +} + + +static void _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates (SettingsManager* _sender, gchar** new_blacklist, int new_blacklist_length1, gpointer self) { + music_player_bridge_on_blacklist_update (self, new_blacklist, new_blacklist_length1); +} + + +static GObject * music_player_bridge_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + MusicPlayerBridge * self; + GeeHashMap* _tmp0_ = NULL; + SettingsManager* _tmp1_ = NULL; + parent_class = G_OBJECT_CLASS (music_player_bridge_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = MUSIC_PLAYER_BRIDGE (obj); + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); + _g_object_unref0 (self->priv->registered_clients); + self->priv->registered_clients = _tmp0_; + _tmp1_ = settings_manager_new (); + _g_object_unref0 (self->priv->settings_manager); + self->priv->settings_manager = _tmp1_; + g_signal_connect_object (self->priv->settings_manager, "blacklist-updates", (GCallback) _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates, self, 0); + return obj; +} + + +static void music_player_bridge_class_init (MusicPlayerBridgeClass * klass) { + music_player_bridge_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (MusicPlayerBridgePrivate)); + G_OBJECT_CLASS (klass)->constructor = music_player_bridge_constructor; + G_OBJECT_CLASS (klass)->finalize = music_player_bridge_finalize; +} + + +static void music_player_bridge_instance_init (MusicPlayerBridge * self) { + self->priv = MUSIC_PLAYER_BRIDGE_GET_PRIVATE (self); +} + + +static void music_player_bridge_finalize (GObject* obj) { + MusicPlayerBridge * self; + self = MUSIC_PLAYER_BRIDGE (obj); + _g_object_unref0 (self->priv->settings_manager); + _g_object_unref0 (self->priv->root_menu); + _g_object_unref0 (self->priv->registered_clients); + _g_object_unref0 (self->priv->watcher); + G_OBJECT_CLASS (music_player_bridge_parent_class)->finalize (obj); +} + + +GType music_player_bridge_get_type (void) { + static volatile gsize music_player_bridge_type_id__volatile = 0; + if (g_once_init_enter (&music_player_bridge_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (MusicPlayerBridgeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) music_player_bridge_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MusicPlayerBridge), 0, (GInstanceInitFunc) music_player_bridge_instance_init, NULL }; + GType music_player_bridge_type_id; + music_player_bridge_type_id = g_type_register_static (G_TYPE_OBJECT, "MusicPlayerBridge", &g_define_type_info, 0); + g_once_init_leave (&music_player_bridge_type_id__volatile, music_player_bridge_type_id); + } + return music_player_bridge_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static gint _vala_array_length (gpointer array) { + int length; + length = 0; + if (array) { + while (((gpointer*) array)[length]) { + length++; + } + } + return length; +} + + + diff --git a/src/music-player-bridge.h b/src/music-player-bridge.h new file mode 100644 index 0000000..7b7bcd8 --- /dev/null +++ b/src/music-player-bridge.h @@ -0,0 +1,565 @@ +/* music-player-bridge.h generated by valac 0.12.1, the Vala compiler, do not modify */ + + +#ifndef __MUSIC_PLAYER_BRIDGE_H__ +#define __MUSIC_PLAYER_BRIDGE_H__ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <common-defs.h> +#include <gee.h> +#include <gio/gio.h> + +G_BEGIN_DECLS + + +#define TYPE_MUSIC_PLAYER_BRIDGE (music_player_bridge_get_type ()) +#define MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridge)) +#define MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass)) +#define IS_MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MUSIC_PLAYER_BRIDGE)) +#define IS_MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MUSIC_PLAYER_BRIDGE)) +#define MUSIC_PLAYER_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass)) + +typedef struct _MusicPlayerBridge MusicPlayerBridge; +typedef struct _MusicPlayerBridgeClass MusicPlayerBridgeClass; +typedef struct _MusicPlayerBridgePrivate MusicPlayerBridgePrivate; + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; + +#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ()) +#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem)) +#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) +#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM)) +#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM)) +#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) + +typedef struct _TransportMenuitem TransportMenuitem; +typedef struct _TransportMenuitemClass TransportMenuitemClass; +typedef struct _TransportMenuitemPrivate TransportMenuitemPrivate; + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; + +#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ()) +#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem)) +#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) +#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM)) +#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM)) +#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) + +typedef struct _MetadataMenuitem MetadataMenuitem; +typedef struct _MetadataMenuitemClass MetadataMenuitemClass; +typedef struct _MetadataMenuitemPrivate MetadataMenuitemPrivate; +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; + +#define PLAYER_CONTROLLER_TYPE_WIDGET_ORDER (player_controller_widget_order_get_type ()) + +#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) + +#define TYPE_MPRIS_ROOT (mpris_root_get_type ()) +#define MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_ROOT, MprisRoot)) +#define IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_ROOT)) +#define MPRIS_ROOT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_ROOT, MprisRootIface)) + +typedef struct _MprisRoot MprisRoot; +typedef struct _MprisRootIface MprisRootIface; + +#define TYPE_MPRIS_ROOT_PROXY (mpris_root_proxy_get_type ()) + +#define TYPE_MPRIS_PLAYER (mpris_player_get_type ()) +#define MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYER, MprisPlayer)) +#define IS_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYER)) +#define MPRIS_PLAYER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYER, MprisPlayerIface)) + +typedef struct _MprisPlayer MprisPlayer; +typedef struct _MprisPlayerIface MprisPlayerIface; + +#define TYPE_MPRIS_PLAYER_PROXY (mpris_player_proxy_get_type ()) + +#define TYPE_PLAYLIST_DETAILS (playlist_details_get_type ()) +typedef struct _PlaylistDetails PlaylistDetails; + +#define TYPE_ACTIVE_PLAYLIST_CONTAINER (active_playlist_container_get_type ()) +typedef struct _ActivePlaylistContainer ActivePlaylistContainer; + +#define TYPE_MPRIS_PLAYLISTS (mpris_playlists_get_type ()) +#define MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylists)) +#define IS_MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_PLAYLISTS)) +#define MPRIS_PLAYLISTS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MPRIS_PLAYLISTS, MprisPlaylistsIface)) + +typedef struct _MprisPlaylists MprisPlaylists; +typedef struct _MprisPlaylistsIface MprisPlaylistsIface; + +#define TYPE_MPRIS_PLAYLISTS_PROXY (mpris_playlists_proxy_get_type ()) + +#define TYPE_MPRIS2_WATCHER (mpris2_watcher_get_type ()) +#define MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_WATCHER, Mpris2Watcher)) +#define MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) +#define IS_MPRIS2_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_WATCHER)) +#define IS_MPRIS2_WATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_WATCHER)) +#define MPRIS2_WATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_WATCHER, Mpris2WatcherClass)) + +typedef struct _Mpris2Watcher Mpris2Watcher; +typedef struct _Mpris2WatcherClass Mpris2WatcherClass; +typedef struct _Mpris2WatcherPrivate Mpris2WatcherPrivate; +typedef struct _Mpris2ControllerPrivate Mpris2ControllerPrivate; + +#define TYPE_FREE_DESKTOP_PROPERTIES (free_desktop_properties_get_type ()) +#define FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopProperties)) +#define IS_FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_PROPERTIES)) +#define FREE_DESKTOP_PROPERTIES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_PROPERTIES, FreeDesktopPropertiesIface)) + +typedef struct _FreeDesktopProperties FreeDesktopProperties; +typedef struct _FreeDesktopPropertiesIface FreeDesktopPropertiesIface; + +#define TYPE_FREE_DESKTOP_PROPERTIES_PROXY (free_desktop_properties_proxy_get_type ()) + +#define TYPE_SETTINGS_MANAGER (settings_manager_get_type ()) +#define SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SETTINGS_MANAGER, SettingsManager)) +#define SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) +#define IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SETTINGS_MANAGER)) +#define IS_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SETTINGS_MANAGER)) +#define SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) + +typedef struct _SettingsManager SettingsManager; +typedef struct _SettingsManagerClass SettingsManagerClass; +typedef struct _SettingsManagerPrivate SettingsManagerPrivate; + +#define TYPE_PLAYLISTS_MENUITEM (playlists_menuitem_get_type ()) +#define PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitem)) +#define PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) +#define IS_PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYLISTS_MENUITEM)) +#define IS_PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYLISTS_MENUITEM)) +#define PLAYLISTS_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) + +typedef struct _PlaylistsMenuitem PlaylistsMenuitem; +typedef struct _PlaylistsMenuitemClass PlaylistsMenuitemClass; +typedef struct _PlaylistsMenuitemPrivate PlaylistsMenuitemPrivate; + +#define TYPE_FREE_DESKTOP_OBJECT (free_desktop_object_get_type ()) +#define FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObject)) +#define IS_FREE_DESKTOP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_OBJECT)) +#define FREE_DESKTOP_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_OBJECT, FreeDesktopObjectIface)) + +typedef struct _FreeDesktopObject FreeDesktopObject; +typedef struct _FreeDesktopObjectIface FreeDesktopObjectIface; + +#define TYPE_FREE_DESKTOP_OBJECT_PROXY (free_desktop_object_proxy_get_type ()) + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE (free_desktop_introspectable_get_type ()) +#define FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectable)) +#define IS_FREE_DESKTOP_INTROSPECTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE)) +#define FREE_DESKTOP_INTROSPECTABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FREE_DESKTOP_INTROSPECTABLE, FreeDesktopIntrospectableIface)) + +typedef struct _FreeDesktopIntrospectable FreeDesktopIntrospectable; +typedef struct _FreeDesktopIntrospectableIface FreeDesktopIntrospectableIface; + +#define TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY (free_desktop_introspectable_proxy_get_type ()) + +#define TYPE_FETCH_FILE (fetch_file_get_type ()) +#define FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FETCH_FILE, FetchFile)) +#define FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FETCH_FILE, FetchFileClass)) +#define IS_FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FETCH_FILE)) +#define IS_FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FETCH_FILE)) +#define FETCH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FETCH_FILE, FetchFileClass)) + +typedef struct _FetchFile FetchFile; +typedef struct _FetchFileClass FetchFileClass; +typedef struct _FetchFilePrivate FetchFilePrivate; + +struct _MusicPlayerBridge { + GObject parent_instance; + MusicPlayerBridgePrivate * priv; +}; + +struct _MusicPlayerBridgeClass { + GObjectClass parent_class; +}; + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _TransportMenuitem { + PlayerItem parent_instance; + TransportMenuitemPrivate * priv; +}; + +struct _TransportMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _MetadataMenuitem { + PlayerItem parent_instance; + MetadataMenuitemPrivate * priv; +}; + +struct _MetadataMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + +typedef enum { + PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, + PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS +} PlayerControllerwidget_order; + +typedef enum { + PLAYER_CONTROLLER_STATE_OFFLINE, + PLAYER_CONTROLLER_STATE_INSTANTIATING, + PLAYER_CONTROLLER_STATE_READY, + PLAYER_CONTROLLER_STATE_CONNECTED, + PLAYER_CONTROLLER_STATE_DISCONNECTED +} PlayerControllerstate; + +struct _MprisRootIface { + GTypeInterface parent_iface; + void (*Quit) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Quit_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + void (*Raise) (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Raise_finish) (MprisRoot* self, GAsyncResult* _res_, GError** error); + gboolean (*get_HasTracklist) (MprisRoot* self); + void (*set_HasTracklist) (MprisRoot* self, gboolean value); + gboolean (*get_CanQuit) (MprisRoot* self); + void (*set_CanQuit) (MprisRoot* self, gboolean value); + gboolean (*get_CanRaise) (MprisRoot* self); + void (*set_CanRaise) (MprisRoot* self, gboolean value); + gchar* (*get_Identity) (MprisRoot* self); + void (*set_Identity) (MprisRoot* self, const gchar* value); + gchar* (*get_DesktopEntry) (MprisRoot* self); + void (*set_DesktopEntry) (MprisRoot* self, const gchar* value); +}; + +struct _MprisPlayerIface { + GTypeInterface parent_iface; + void (*PlayPause) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*PlayPause_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Next) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Next_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Previous) (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Previous_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + void (*Seek) (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*Seek_finish) (MprisPlayer* self, GAsyncResult* _res_, GError** error); + GHashTable* (*get_Metadata) (MprisPlayer* self); + void (*set_Metadata) (MprisPlayer* self, GHashTable* value); + gint32 (*get_Position) (MprisPlayer* self); + void (*set_Position) (MprisPlayer* self, gint32 value); + gchar* (*get_PlaybackStatus) (MprisPlayer* self); + void (*set_PlaybackStatus) (MprisPlayer* self, const gchar* value); +}; + +struct _PlaylistDetails { + char* path; + gchar* name; + gchar* icon_path; +}; + +struct _ActivePlaylistContainer { + gboolean valid; + PlaylistDetails details; +}; + +struct _MprisPlaylistsIface { + GTypeInterface parent_iface; + void (*ActivatePlaylist) (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); + void (*ActivatePlaylist_finish) (MprisPlaylists* self, GAsyncResult* _res_, GError** error); + void (*GetPlaylists) (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); + PlaylistDetails* (*GetPlaylists_finish) (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); + gchar** (*get_Orderings) (MprisPlaylists* self, int* result_length1); + void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); + guint32 (*get_PlaylistCount) (MprisPlaylists* self); + void (*set_PlaylistCount) (MprisPlaylists* self, guint32 value); + void (*get_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); + void (*set_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); +}; + +struct _Mpris2Watcher { + GObject parent_instance; + Mpris2WatcherPrivate * priv; +}; + +struct _Mpris2WatcherClass { + GObjectClass parent_class; +}; + +struct _Mpris2Controller { + GObject parent_instance; + Mpris2ControllerPrivate * priv; +}; + +struct _Mpris2ControllerClass { + GObjectClass parent_class; +}; + +struct _FreeDesktopPropertiesIface { + GTypeInterface parent_iface; +}; + +struct _SettingsManager { + GObject parent_instance; + SettingsManagerPrivate * priv; +}; + +struct _SettingsManagerClass { + GObjectClass parent_class; +}; + +struct _PlaylistsMenuitem { + PlayerItem parent_instance; + PlaylistsMenuitemPrivate * priv; + DbusmenuMenuitem* root_item; +}; + +struct _PlaylistsMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _FreeDesktopObjectIface { + GTypeInterface parent_iface; + void (*list_names) (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); + gchar** (*list_names_finish) (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +}; + +struct _FreeDesktopIntrospectableIface { + GTypeInterface parent_iface; + gchar* (*Introspect) (FreeDesktopIntrospectable* self, GError** error); +}; + +typedef enum { + XML_ERROR_FILE_NOT_FOUND, + XML_ERROR_XML_DOCUMENT_EMPTY +} XmlError; +#define XML_ERROR xml_error_quark () +struct _FetchFile { + GObject parent_instance; + FetchFilePrivate * priv; +}; + +struct _FetchFileClass { + GObjectClass parent_class; +}; + + +GType music_player_bridge_get_type (void) G_GNUC_CONST; +MusicPlayerBridge* music_player_bridge_new (void); +MusicPlayerBridge* music_player_bridge_construct (GType object_type); +void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, const gchar* desktop, const gchar* dbus_name, gboolean use_playlists); +void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gchar* mpris_root_interface); +void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu); +GType player_item_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; +TransportMenuitem* transport_menuitem_new (PlayerController* parent); +TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent); +void transport_menuitem_handle_cached_action (TransportMenuitem* self); +void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update); +GeeHashSet* transport_menuitem_attributes_format (void); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; +extern gchar* metadata_menuitem_album_art_cache_dir; +#define METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX "indicators/sound/album-art-cache" +MetadataMenuitem* metadata_menuitem_new (PlayerController* parent); +MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent); +void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop); +void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title); +void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update); +void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse); +GeeHashSet* metadata_menuitem_attributes_format (void); +GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void); +GType mpris2_controller_get_type (void) G_GNUC_CONST; +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4 +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state); +void player_controller_activate (PlayerController* self, const gchar* dbus_name); +void player_controller_instantiate (PlayerController* self); +void player_controller_remove_from_menu (PlayerController* self); +void player_controller_hibernate (PlayerController* self); +void player_controller_update_layout (PlayerController* self); +const gchar* player_controller_get_dbus_name (PlayerController* self); +void player_controller_set_dbus_name (PlayerController* self, const gchar* value); +GAppInfo* player_controller_get_app_info (PlayerController* self); +void player_controller_set_app_info (PlayerController* self, GAppInfo* value); +gint player_controller_get_menu_offset (PlayerController* self); +void player_controller_set_menu_offset (PlayerController* self, gint value); +const gchar* player_controller_get_icon_name (PlayerController* self); +void player_controller_set_icon_name (PlayerController* self, const gchar* value); +GType mpris_root_proxy_get_type (void) G_GNUC_CONST; +guint mpris_root_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_root_get_type (void) G_GNUC_CONST; +void mpris_root_Quit (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_root_Quit_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +void mpris_root_Raise (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_root_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** error); +gboolean mpris_root_get_HasTracklist (MprisRoot* self); +void mpris_root_set_HasTracklist (MprisRoot* self, gboolean value); +gboolean mpris_root_get_CanQuit (MprisRoot* self); +void mpris_root_set_CanQuit (MprisRoot* self, gboolean value); +gboolean mpris_root_get_CanRaise (MprisRoot* self); +void mpris_root_set_CanRaise (MprisRoot* self, gboolean value); +gchar* mpris_root_get_Identity (MprisRoot* self); +void mpris_root_set_Identity (MprisRoot* self, const gchar* value); +gchar* mpris_root_get_DesktopEntry (MprisRoot* self); +void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value); +GType mpris_player_proxy_get_type (void) G_GNUC_CONST; +guint mpris_player_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_player_get_type (void) G_GNUC_CONST; +void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_PlayPause_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Next (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Next_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Previous (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Previous_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +void mpris_player_Seek (MprisPlayer* self, gint64 offset, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_player_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** error); +GHashTable* mpris_player_get_Metadata (MprisPlayer* self); +void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value); +gint32 mpris_player_get_Position (MprisPlayer* self); +void mpris_player_set_Position (MprisPlayer* self, gint32 value); +gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self); +void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value); +GType playlist_details_get_type (void) G_GNUC_CONST; +PlaylistDetails* playlist_details_dup (const PlaylistDetails* self); +void playlist_details_free (PlaylistDetails* self); +void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest); +void playlist_details_destroy (PlaylistDetails* self); +GType active_playlist_container_get_type (void) G_GNUC_CONST; +ActivePlaylistContainer* active_playlist_container_dup (const ActivePlaylistContainer* self); +void active_playlist_container_free (ActivePlaylistContainer* self); +void active_playlist_container_copy (const ActivePlaylistContainer* self, ActivePlaylistContainer* dest); +void active_playlist_container_destroy (ActivePlaylistContainer* self); +GType mpris_playlists_proxy_get_type (void) G_GNUC_CONST; +guint mpris_playlists_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType mpris_playlists_get_type (void) G_GNUC_CONST; +void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); +gchar** mpris_playlists_get_Orderings (MprisPlaylists* self, int* result_length1); +void mpris_playlists_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1); +guint32 mpris_playlists_get_PlaylistCount (MprisPlaylists* self); +void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value); +void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value); +GType mpris2_watcher_get_type (void) G_GNUC_CONST; +Mpris2Watcher* mpris2_watcher_new (void); +Mpris2Watcher* mpris2_watcher_construct (GType object_type); +void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_); +Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); +Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); +void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1); +void mpris2_controller_initial_update (Mpris2Controller* self); +void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction command); +gboolean mpris2_controller_connected (Mpris2Controller* self); +void mpris2_controller_expose (Mpris2Controller* self); +void mpris2_controller_fetch_playlists (Mpris2Controller* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void mpris2_controller_fetch_playlists_finish (Mpris2Controller* self, GAsyncResult* _res_); +void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* path); +MprisRoot* mpris2_controller_get_mpris2_root (Mpris2Controller* self); +MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self); +MprisPlaylists* mpris2_controller_get_playlists (Mpris2Controller* self); +GType free_desktop_properties_get_type (void) G_GNUC_CONST; +GType free_desktop_properties_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_properties_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self); +PlayerController* mpris2_controller_get_owner (Mpris2Controller* self); +#define PLAYER_ITEM_EMPTY (-1) +PlayerItem* player_item_new (const gchar* type); +PlayerItem* player_item_construct (GType object_type, const gchar* type); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); +PlayerController* player_item_get_owner (PlayerItem* self); +const gchar* player_item_get_item_type (PlayerItem* self); +GType settings_manager_get_type (void) G_GNUC_CONST; +SettingsManager* settings_manager_new (void); +SettingsManager* settings_manager_construct (GType object_type); +gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1); +GeeArrayList* settings_manager_fetch_interested (SettingsManager* self); +void settings_manager_clear_list (SettingsManager* self); +void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name); +GType playlists_menuitem_get_type (void) G_GNUC_CONST; +PlaylistsMenuitem* playlists_menuitem_new (PlayerController* parent); +PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent); +void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1); +void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail); +void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail); +GeeHashSet* playlists_menuitem_attributes_format (void); +GType free_desktop_object_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_object_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_object_get_type (void) G_GNUC_CONST; +void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); +GType free_desktop_introspectable_proxy_get_type (void) G_GNUC_CONST; +guint free_desktop_introspectable_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); +GType free_desktop_introspectable_get_type (void) G_GNUC_CONST; +gchar* free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GError** error); +GQuark xml_error_quark (void); +GType fetch_file_get_type (void) G_GNUC_CONST; +FetchFile* fetch_file_new (const gchar* uri, const gchar* prop); +FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop); +void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); +void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_); +const gchar* fetch_file_get_uri (FetchFile* self); +const gchar* fetch_file_get_intended_property (FetchFile* self); + + +G_END_DECLS + +#endif diff --git a/src/player-controller.c b/src/player-controller.c new file mode 100644 index 0000000..0510150 --- /dev/null +++ b/src/player-controller.c @@ -0,0 +1,817 @@ +/* player-controller.c generated by valac 0.12.1, the Vala compiler + * generated from player-controller.vala, do not modify */ + +/* +This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel. +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <gee.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <stdlib.h> +#include <string.h> +#include <gio/gio.h> +#include <common-defs.h> + + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; + +#define PLAYER_CONTROLLER_TYPE_WIDGET_ORDER (player_controller_widget_order_get_type ()) + +#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +#define TYPE_PLAYLISTS_MENUITEM (playlists_menuitem_get_type ()) +#define PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitem)) +#define PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) +#define IS_PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYLISTS_MENUITEM)) +#define IS_PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYLISTS_MENUITEM)) +#define PLAYLISTS_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) + +typedef struct _PlaylistsMenuitem PlaylistsMenuitem; +typedef struct _PlaylistsMenuitemClass PlaylistsMenuitemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; +typedef struct _PlaylistsMenuitemPrivate PlaylistsMenuitemPrivate; + +#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ()) +#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem)) +#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) +#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM)) +#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM)) +#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) + +typedef struct _TransportMenuitem TransportMenuitem; +typedef struct _TransportMenuitemClass TransportMenuitemClass; + +#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ()) +#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem)) +#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) +#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM)) +#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM)) +#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) + +typedef struct _MetadataMenuitem MetadataMenuitem; +typedef struct _MetadataMenuitemClass MetadataMenuitemClass; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + +struct _PlayerControllerPrivate { + DbusmenuMenuitem* root_menu; + gchar* _dbus_name; + GAppInfo* _app_info; + gint _menu_offset; + gchar* _icon_name; +}; + +typedef enum { + PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, + PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS +} PlayerControllerwidget_order; + +typedef enum { + PLAYER_CONTROLLER_STATE_OFFLINE, + PLAYER_CONTROLLER_STATE_INSTANTIATING, + PLAYER_CONTROLLER_STATE_READY, + PLAYER_CONTROLLER_STATE_CONNECTED, + PLAYER_CONTROLLER_STATE_DISCONNECTED +} PlayerControllerstate; + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _PlaylistsMenuitem { + PlayerItem parent_instance; + PlaylistsMenuitemPrivate * priv; + DbusmenuMenuitem* root_item; +}; + +struct _PlaylistsMenuitemClass { + PlayerItemClass parent_class; +}; + + +static gpointer player_controller_parent_class = NULL; + +GType player_controller_get_type (void) G_GNUC_CONST; +GType player_item_get_type (void) G_GNUC_CONST; +GType mpris2_controller_get_type (void) G_GNUC_CONST; +#define PLAYER_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYER_CONTROLLER, PlayerControllerPrivate)) +enum { + PLAYER_CONTROLLER_DUMMY_PROPERTY, + PLAYER_CONTROLLER_DBUS_NAME, + PLAYER_CONTROLLER_APP_INFO, + PLAYER_CONTROLLER_MENU_OFFSET, + PLAYER_CONTROLLER_ICON_NAME +}; +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4 +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +static gboolean* _bool_dup (gboolean* self); +void player_controller_set_app_info (PlayerController* self, GAppInfo* value); +void player_controller_set_dbus_name (PlayerController* self, const gchar* value); +void player_controller_set_icon_name (PlayerController* self, const gchar* value); +void player_controller_set_menu_offset (PlayerController* self, gint value); +static void player_controller_construct_widgets (PlayerController* self); +static void player_controller_establish_mpris_connection (PlayerController* self); +void player_controller_update_layout (PlayerController* self); +GAppInfo* player_controller_get_app_info (PlayerController* self); +const gchar* player_controller_get_icon_name (PlayerController* self); +void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state); +void player_controller_activate (PlayerController* self, const gchar* dbus_name); +void player_controller_instantiate (PlayerController* self); +const gchar* player_controller_get_dbus_name (PlayerController* self); +Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); +Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); +static void player_controller_determine_state (PlayerController* self); +void player_controller_remove_from_menu (PlayerController* self); +static gboolean _bool_equal (const gboolean* s1, const gboolean* s2); +GType playlists_menuitem_get_type (void) G_GNUC_CONST; +void player_controller_hibernate (PlayerController* self); +GType transport_menuitem_get_type (void) G_GNUC_CONST; +void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; +void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update); +void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); +void transport_menuitem_handle_cached_action (TransportMenuitem* self); +PlayerItem* player_item_new (const gchar* type); +PlayerItem* player_item_construct (GType object_type, const gchar* type); +MetadataMenuitem* metadata_menuitem_new (PlayerController* parent); +MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent); +TransportMenuitem* transport_menuitem_new (PlayerController* parent); +TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent); +PlaylistsMenuitem* playlists_menuitem_new (PlayerController* parent); +PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent); +gint player_controller_get_menu_offset (PlayerController* self); +gboolean mpris2_controller_connected (Mpris2Controller* self); +void mpris2_controller_initial_update (Mpris2Controller* self); +static void player_controller_finalize (GObject* obj); +static void _vala_player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +GType player_controller_widget_order_get_type (void) { + static volatile gsize player_controller_widget_order_type_id__volatile = 0; + if (g_once_init_enter (&player_controller_widget_order_type_id__volatile)) { + static const GEnumValue values[] = {{PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, "PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR", "separator"}, {PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, "PLAYER_CONTROLLER_WIDGET_ORDER_METADATA", "metadata"}, {PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, "PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT", "transport"}, {PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS, "PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS", "playlists"}, {0, NULL, NULL}}; + GType player_controller_widget_order_type_id; + player_controller_widget_order_type_id = g_enum_register_static ("PlayerControllerwidget_order", values); + g_once_init_leave (&player_controller_widget_order_type_id__volatile, player_controller_widget_order_type_id); + } + return player_controller_widget_order_type_id__volatile; +} + + +GType player_controller_state_get_type (void) { + static volatile gsize player_controller_state_type_id__volatile = 0; + if (g_once_init_enter (&player_controller_state_type_id__volatile)) { + static const GEnumValue values[] = {{PLAYER_CONTROLLER_STATE_OFFLINE, "PLAYER_CONTROLLER_STATE_OFFLINE", "offline"}, {PLAYER_CONTROLLER_STATE_INSTANTIATING, "PLAYER_CONTROLLER_STATE_INSTANTIATING", "instantiating"}, {PLAYER_CONTROLLER_STATE_READY, "PLAYER_CONTROLLER_STATE_READY", "ready"}, {PLAYER_CONTROLLER_STATE_CONNECTED, "PLAYER_CONTROLLER_STATE_CONNECTED", "connected"}, {PLAYER_CONTROLLER_STATE_DISCONNECTED, "PLAYER_CONTROLLER_STATE_DISCONNECTED", "disconnected"}, {0, NULL, NULL}}; + GType player_controller_state_type_id; + player_controller_state_type_id = g_enum_register_static ("PlayerControllerstate", values); + g_once_init_leave (&player_controller_state_type_id__volatile, player_controller_state_type_id); + } + return player_controller_state_type_id__volatile; +} + + +static gboolean* _bool_dup (gboolean* self) { + gboolean* dup; + dup = g_new0 (gboolean, 1); + memcpy (dup, self, sizeof (gboolean)); + return dup; +} + + +static gpointer __bool_dup0 (gpointer self) { + return self ? _bool_dup (self) : NULL; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state) { + PlayerController * self = NULL; + gboolean* _tmp0_; + DbusmenuMenuitem* _tmp1_; + GeeArrayList* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + g_return_val_if_fail (root != NULL, NULL); + g_return_val_if_fail (app != NULL, NULL); + g_return_val_if_fail (icon_name != NULL, NULL); + self = (PlayerController*) g_object_new (object_type, NULL); + _tmp0_ = __bool_dup0 (use_playlists); + _g_free0 (self->use_playlists); + self->use_playlists = _tmp0_; + _tmp1_ = _g_object_ref0 (root); + _g_object_unref0 (self->priv->root_menu); + self->priv->root_menu = _tmp1_; + player_controller_set_app_info (self, app); + player_controller_set_dbus_name (self, dbus_name); + player_controller_set_icon_name (self, icon_name); + _tmp2_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL); + _g_object_unref0 (self->custom_items); + self->custom_items = _tmp2_; + self->current_state = (gint) initial_state; + player_controller_set_menu_offset (self, offset); + player_controller_construct_widgets (self); + player_controller_establish_mpris_connection (self); + player_controller_update_layout (self); + _tmp3_ = g_app_info_get_name (self->priv->_app_info); + g_debug ("player-controller.vala:73: New player controller for %s with icon nam" \ +"e %s", _tmp3_, self->priv->_icon_name); + return self; +} + + +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state) { + return player_controller_construct (TYPE_PLAYER_CONTROLLER, root, app, dbus_name, icon_name, offset, use_playlists, initial_state); +} + + +void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state) { + const gchar* _tmp0_ = NULL; + g_return_if_fail (self != NULL); + _tmp0_ = g_app_info_get_name (self->priv->_app_info); + g_debug ("player-controller.vala:78: update_state - player controller %s : new s" \ +"tate %i", _tmp0_, (gint) new_state); + self->current_state = (gint) new_state; + player_controller_update_layout (self); +} + + +void player_controller_activate (PlayerController* self, const gchar* dbus_name) { + g_return_if_fail (self != NULL); + g_return_if_fail (dbus_name != NULL); + player_controller_set_dbus_name (self, dbus_name); + player_controller_establish_mpris_connection (self); +} + + +void player_controller_instantiate (PlayerController* self) { + const gchar* _tmp0_ = NULL; + GError * _inner_error_ = NULL; + g_return_if_fail (self != NULL); + _tmp0_ = g_app_info_get_name (self->priv->_app_info); + g_debug ("player-controller.vala:98: instantiate in player controller for %s", _tmp0_); + g_app_info_launch (self->priv->_app_info, NULL, NULL, &_inner_error_); + if (_inner_error_ != NULL) { + goto __catch6_g_error; + } + player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING); + goto __finally6; + __catch6_g_error: + { + GError * _error_; + const gchar* _tmp1_ = NULL; + _error_ = _inner_error_; + _inner_error_ = NULL; + _tmp1_ = g_app_info_get_name (self->priv->_app_info); + g_warning ("player-controller.vala:104: Failed to launch app %s with error message" \ +": %s", _tmp1_, _error_->message); + _g_error_free0 (_error_); + } + __finally6: + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } +} + + +static gchar* bool_to_string (gboolean self) { + gchar* result = NULL; + if (self) { + gchar* _tmp0_; + _tmp0_ = g_strdup ("true"); + result = _tmp0_; + return result; + } else { + gchar* _tmp1_; + _tmp1_ = g_strdup ("false"); + result = _tmp1_; + return result; + } +} + + +static void player_controller_establish_mpris_connection (PlayerController* self) { + gboolean _tmp0_ = FALSE; + gchar* _tmp1_ = NULL; + gchar* _tmp2_; + Mpris2Controller* _tmp3_ = NULL; + g_return_if_fail (self != NULL); + if (self->current_state != PLAYER_CONTROLLER_STATE_READY) { + _tmp0_ = TRUE; + } else { + _tmp0_ = self->priv->_dbus_name == NULL; + } + if (_tmp0_) { + g_debug ("player-controller.vala:112: establish_mpris_connection - Not ready to " \ +"connect"); + return; + } + _tmp1_ = bool_to_string (*self->use_playlists); + _tmp2_ = _tmp1_; + g_debug ("player-controller.vala:115: establish mpris connection - use playlist" \ +"s value = %s ", _tmp2_); + _g_free0 (_tmp2_); + _tmp3_ = mpris2_controller_new (self); + _g_object_unref0 (self->mpris_bridge); + self->mpris_bridge = _tmp3_; + player_controller_determine_state (self); +} + + +static gboolean _bool_equal (const gboolean* s1, const gboolean* s2) { + if (s1 == s2) { + return TRUE; + } + if (s1 == NULL) { + return FALSE; + } + if (s2 == NULL) { + return FALSE; + } + return (*s1) == (*s2); +} + + +void player_controller_remove_from_menu (PlayerController* self) { + gboolean _tmp3_; + g_return_if_fail (self != NULL); + { + GeeArrayList* _tmp0_; + GeeArrayList* _item_list; + gint _tmp1_; + gint _item_size; + gint _item_index; + _tmp0_ = _g_object_ref0 (self->custom_items); + _item_list = _tmp0_; + _tmp1_ = gee_collection_get_size ((GeeCollection*) _item_list); + _item_size = _tmp1_; + _item_index = -1; + while (TRUE) { + gpointer _tmp2_ = NULL; + PlayerItem* item; + _item_index = _item_index + 1; + if (!(_item_index < _item_size)) { + break; + } + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index); + item = (PlayerItem*) _tmp2_; + dbusmenu_menuitem_child_delete (self->priv->root_menu, (DbusmenuMenuitem*) item); + _g_object_unref0 (item); + } + _g_object_unref0 (_item_list); + } + _tmp3_ = TRUE; + if (_bool_equal (self->use_playlists, &_tmp3_) == TRUE) { + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; + PlaylistsMenuitem* playlists_menuitem; + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp5_ = (PlayerItem*) _tmp4_; + playlists_menuitem = IS_PLAYLISTS_MENUITEM (_tmp5_) ? ((PlaylistsMenuitem*) _tmp5_) : NULL; + dbusmenu_menuitem_child_delete (self->priv->root_menu, playlists_menuitem->root_item); + _g_object_unref0 (playlists_menuitem); + } +} + + +void player_controller_hibernate (PlayerController* self) { + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; + TransportMenuitem* transport; + gpointer _tmp2_ = NULL; + PlayerItem* _tmp3_; + GeeHashSet* _tmp4_ = NULL; + GeeHashSet* _tmp5_; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; + MetadataMenuitem* md; + g_return_if_fail (self != NULL); + player_controller_update_state (self, PLAYER_CONTROLLER_STATE_OFFLINE); + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp1_ = (PlayerItem*) _tmp0_; + transport = IS_TRANSPORT_MENUITEM (_tmp1_) ? ((TransportMenuitem*) _tmp1_) : NULL; + transport_menuitem_change_play_state (transport, TRANSPORT_STATE_PAUSED); + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp3_ = (PlayerItem*) _tmp2_; + _tmp4_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp5_ = _tmp4_; + player_item_reset (_tmp3_, _tmp5_); + _g_object_unref0 (_tmp5_); + _g_object_unref0 (_tmp3_); + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp7_ = (PlayerItem*) _tmp6_; + md = IS_METADATA_MENUITEM (_tmp7_) ? ((MetadataMenuitem*) _tmp7_) : NULL; + metadata_menuitem_toggle_active_triangle (md, FALSE); + _g_object_unref0 (self->mpris_bridge); + self->mpris_bridge = NULL; + _g_object_unref0 (md); + _g_object_unref0 (transport); +} + + +void player_controller_update_layout (PlayerController* self) { + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; + PlaylistsMenuitem* playlists_menuitem; + gpointer _tmp2_ = NULL; + PlayerItem* _tmp3_; + MetadataMenuitem* metadata_menuitem; + gpointer _tmp7_ = NULL; + PlayerItem* _tmp8_; + GeeHashSet* _tmp9_ = NULL; + GeeHashSet* _tmp10_; + gboolean _tmp11_; + const gchar* _tmp12_ = NULL; + g_return_if_fail (self != NULL); + g_debug ("player-controller.vala:146: a call to update layout"); + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp1_ = (PlayerItem*) _tmp0_; + playlists_menuitem = IS_PLAYLISTS_MENUITEM (_tmp1_) ? ((PlaylistsMenuitem*) _tmp1_) : NULL; + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp3_ = (PlayerItem*) _tmp2_; + metadata_menuitem = IS_METADATA_MENUITEM (_tmp3_) ? ((MetadataMenuitem*) _tmp3_) : NULL; + if (self->current_state != PLAYER_CONTROLLER_STATE_CONNECTED) { + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; + const gchar* _tmp6_ = NULL; + metadata_menuitem_should_collapse (metadata_menuitem, TRUE); + dbusmenu_menuitem_property_set_bool (playlists_menuitem->root_item, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp5_ = (PlayerItem*) _tmp4_; + _tmp6_ = g_app_info_get_id (self->priv->_app_info); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp5_, DBUSMENU_MENUITEM_PROP_VISIBLE, g_strcmp0 (_tmp6_, "banshee.desktop") == 0); + _g_object_unref0 (_tmp5_); + _g_object_unref0 (metadata_menuitem); + _g_object_unref0 (playlists_menuitem); + return; + } + _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp8_ = (PlayerItem*) _tmp7_; + _tmp9_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp10_ = _tmp9_; + _tmp11_ = player_item_populated (_tmp8_, _tmp10_); + metadata_menuitem_should_collapse (metadata_menuitem, !_tmp11_); + _g_object_unref0 (_tmp10_); + _g_object_unref0 (_tmp8_); + _tmp12_ = g_app_info_get_id (self->priv->_app_info); + if (g_strcmp0 (_tmp12_, "banshee.desktop") == 0) { + gpointer _tmp13_ = NULL; + PlayerItem* _tmp14_; + TransportMenuitem* transport; + _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp14_ = (PlayerItem*) _tmp13_; + transport = IS_TRANSPORT_MENUITEM (_tmp14_) ? ((TransportMenuitem*) _tmp14_) : NULL; + transport_menuitem_handle_cached_action (transport); + _g_object_unref0 (transport); + } else { + gpointer _tmp15_ = NULL; + PlayerItem* _tmp16_; + _tmp15_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp16_ = (PlayerItem*) _tmp15_; + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp16_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + _g_object_unref0 (_tmp16_); + } + dbusmenu_menuitem_property_set_bool (playlists_menuitem->root_item, DBUSMENU_MENUITEM_PROP_VISIBLE, *self->use_playlists); + _g_object_unref0 (metadata_menuitem); + _g_object_unref0 (playlists_menuitem); +} + + +static void player_controller_construct_widgets (PlayerController* self) { + PlayerItem* _tmp0_ = NULL; + PlayerItem* _tmp1_; + MetadataMenuitem* _tmp2_ = NULL; + MetadataMenuitem* metadata_item; + TransportMenuitem* _tmp3_ = NULL; + TransportMenuitem* transport_item; + PlaylistsMenuitem* _tmp4_ = NULL; + PlaylistsMenuitem* playlist_menuitem; + g_return_if_fail (self != NULL); + _tmp0_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR); + _tmp1_ = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp1_); + _g_object_unref0 (_tmp1_); + _tmp2_ = metadata_menuitem_new (self); + metadata_item = _tmp2_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) metadata_item); + _tmp3_ = transport_menuitem_new (self); + transport_item = _tmp3_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) transport_item); + _tmp4_ = playlists_menuitem_new (self); + playlist_menuitem = _tmp4_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) playlist_menuitem); + { + GeeArrayList* _tmp5_; + GeeArrayList* _item_list; + gint _tmp6_; + gint _item_size; + gint _item_index; + _tmp5_ = _g_object_ref0 (self->custom_items); + _item_list = _tmp5_; + _tmp6_ = gee_collection_get_size ((GeeCollection*) _item_list); + _item_size = _tmp6_; + _item_index = -1; + while (TRUE) { + gpointer _tmp7_ = NULL; + PlayerItem* item; + gint _tmp8_; + _item_index = _item_index + 1; + if (!(_item_index < _item_size)) { + break; + } + _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index); + item = (PlayerItem*) _tmp7_; + _tmp8_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + if (_tmp8_ == 3) { + PlayerItem* _tmp9_; + PlaylistsMenuitem* _tmp10_; + PlaylistsMenuitem* playlists_menuitem; + gint _tmp11_; + _tmp9_ = item; + _tmp10_ = _g_object_ref0 (IS_PLAYLISTS_MENUITEM (_tmp9_) ? ((PlaylistsMenuitem*) _tmp9_) : NULL); + playlists_menuitem = _tmp10_; + _tmp11_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + dbusmenu_menuitem_child_add_position (self->priv->root_menu, playlists_menuitem->root_item, (guint) (self->priv->_menu_offset + _tmp11_)); + _g_object_unref0 (playlists_menuitem); + } else { + gint _tmp12_; + _tmp12_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + dbusmenu_menuitem_child_add_position (self->priv->root_menu, (DbusmenuMenuitem*) item, (guint) (self->priv->_menu_offset + _tmp12_)); + } + _g_object_unref0 (item); + } + _g_object_unref0 (_item_list); + } + _g_object_unref0 (playlist_menuitem); + _g_object_unref0 (transport_item); + _g_object_unref0 (metadata_item); +} + + +static void player_controller_determine_state (PlayerController* self) { + gboolean _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = mpris2_controller_connected (self->mpris_bridge); + if (_tmp0_ == TRUE) { + gpointer _tmp1_ = NULL; + PlayerItem* _tmp2_; + MetadataMenuitem* md; + player_controller_update_state (self, PLAYER_CONTROLLER_STATE_CONNECTED); + _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp2_ = (PlayerItem*) _tmp1_; + md = IS_METADATA_MENUITEM (_tmp2_) ? ((MetadataMenuitem*) _tmp2_) : NULL; + metadata_menuitem_toggle_active_triangle (md, TRUE); + mpris2_controller_initial_update (self->mpris_bridge); + _g_object_unref0 (md); + } else { + player_controller_update_state (self, PLAYER_CONTROLLER_STATE_DISCONNECTED); + } +} + + +const gchar* player_controller_get_dbus_name (PlayerController* self) { + const gchar* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_dbus_name; + return result; +} + + +void player_controller_set_dbus_name (PlayerController* self, const gchar* value) { + gchar* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup (value); + _g_free0 (self->priv->_dbus_name); + self->priv->_dbus_name = _tmp0_; + g_object_notify ((GObject *) self, "dbus-name"); +} + + +GAppInfo* player_controller_get_app_info (PlayerController* self) { + GAppInfo* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_app_info; + return result; +} + + +void player_controller_set_app_info (PlayerController* self, GAppInfo* value) { + GAppInfo* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_app_info); + self->priv->_app_info = _tmp0_; + g_object_notify ((GObject *) self, "app-info"); +} + + +gint player_controller_get_menu_offset (PlayerController* self) { + gint result; + g_return_val_if_fail (self != NULL, 0); + result = self->priv->_menu_offset; + return result; +} + + +void player_controller_set_menu_offset (PlayerController* self, gint value) { + g_return_if_fail (self != NULL); + self->priv->_menu_offset = value; + g_object_notify ((GObject *) self, "menu-offset"); +} + + +const gchar* player_controller_get_icon_name (PlayerController* self) { + const gchar* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_icon_name; + return result; +} + + +void player_controller_set_icon_name (PlayerController* self, const gchar* value) { + gchar* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup (value); + _g_free0 (self->priv->_icon_name); + self->priv->_icon_name = _tmp0_; + g_object_notify ((GObject *) self, "icon-name"); +} + + +static void player_controller_class_init (PlayerControllerClass * klass) { + player_controller_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (PlayerControllerPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_player_controller_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_player_controller_set_property; + G_OBJECT_CLASS (klass)->finalize = player_controller_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_DBUS_NAME, g_param_spec_string ("dbus-name", "dbus-name", "dbus-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_APP_INFO, g_param_spec_object ("app-info", "app-info", "app-info", G_TYPE_APP_INFO, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_MENU_OFFSET, g_param_spec_int ("menu-offset", "menu-offset", "menu-offset", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_ICON_NAME, g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); +} + + +static void player_controller_instance_init (PlayerController * self) { + self->priv = PLAYER_CONTROLLER_GET_PRIVATE (self); + self->current_state = (gint) PLAYER_CONTROLLER_STATE_OFFLINE; +} + + +static void player_controller_finalize (GObject* obj) { + PlayerController * self; + self = PLAYER_CONTROLLER (obj); + _g_object_unref0 (self->priv->root_menu); + _g_free0 (self->priv->_dbus_name); + _g_object_unref0 (self->custom_items); + _g_object_unref0 (self->mpris_bridge); + _g_object_unref0 (self->priv->_app_info); + _g_free0 (self->priv->_icon_name); + _g_free0 (self->use_playlists); + G_OBJECT_CLASS (player_controller_parent_class)->finalize (obj); +} + + +GType player_controller_get_type (void) { + static volatile gsize player_controller_type_id__volatile = 0; + if (g_once_init_enter (&player_controller_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PlayerControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) player_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlayerController), 0, (GInstanceInitFunc) player_controller_instance_init, NULL }; + GType player_controller_type_id; + player_controller_type_id = g_type_register_static (G_TYPE_OBJECT, "PlayerController", &g_define_type_info, 0); + g_once_init_leave (&player_controller_type_id__volatile, player_controller_type_id); + } + return player_controller_type_id__volatile; +} + + +static void _vala_player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + PlayerController * self; + self = PLAYER_CONTROLLER (object); + switch (property_id) { + case PLAYER_CONTROLLER_DBUS_NAME: + g_value_set_string (value, player_controller_get_dbus_name (self)); + break; + case PLAYER_CONTROLLER_APP_INFO: + g_value_set_object (value, player_controller_get_app_info (self)); + break; + case PLAYER_CONTROLLER_MENU_OFFSET: + g_value_set_int (value, player_controller_get_menu_offset (self)); + break; + case PLAYER_CONTROLLER_ICON_NAME: + g_value_set_string (value, player_controller_get_icon_name (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + PlayerController * self; + self = PLAYER_CONTROLLER (object); + switch (property_id) { + case PLAYER_CONTROLLER_DBUS_NAME: + player_controller_set_dbus_name (self, g_value_get_string (value)); + break; + case PLAYER_CONTROLLER_APP_INFO: + player_controller_set_app_info (self, g_value_get_object (value)); + break; + case PLAYER_CONTROLLER_MENU_OFFSET: + player_controller_set_menu_offset (self, g_value_get_int (value)); + break; + case PLAYER_CONTROLLER_ICON_NAME: + player_controller_set_icon_name (self, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/src/player-item.c b/src/player-item.c new file mode 100644 index 0000000..89c291d --- /dev/null +++ b/src/player-item.c @@ -0,0 +1,496 @@ +/* player-item.c generated by valac 0.12.1, the Vala compiler + * generated from player-item.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <stdlib.h> +#include <string.h> +#include <gee.h> + + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL))) + +#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ()) +#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem)) +#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) +#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM)) +#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM)) +#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass)) + +typedef struct _MetadataMenuitem MetadataMenuitem; +typedef struct _MetadataMenuitemClass MetadataMenuitemClass; + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _PlayerItemPrivate { + PlayerController* _owner; + gchar* _item_type; +}; + + +static gpointer player_item_parent_class = NULL; + +GType player_item_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; +#define PLAYER_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYER_ITEM, PlayerItemPrivate)) +enum { + PLAYER_ITEM_DUMMY_PROPERTY, + PLAYER_ITEM_OWNER, + PLAYER_ITEM_ITEM_TYPE +}; +#define PLAYER_ITEM_EMPTY (-1) +PlayerItem* player_item_new (const gchar* type); +PlayerItem* player_item_construct (GType object_type, const gchar* type); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; +void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); +PlayerController* player_item_get_owner (PlayerItem* self); +static void player_item_set_owner (PlayerItem* self, PlayerController* value); +const gchar* player_item_get_item_type (PlayerItem* self); +static void player_item_set_item_type (PlayerItem* self, const gchar* value); +static GObject * player_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +static void player_item_finalize (GObject* obj); +static void _vala_player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static gint _vala_array_length (gpointer array); + + +PlayerItem* player_item_construct (GType object_type, const gchar* type) { + PlayerItem * self = NULL; + g_return_val_if_fail (type != NULL, NULL); + self = (PlayerItem*) g_object_new (object_type, "item-type", type, NULL); + return self; +} + + +PlayerItem* player_item_new (const gchar* type) { + return player_item_construct (TYPE_PLAYER_ITEM, type); +} + + +void player_item_reset (PlayerItem* self, GeeHashSet* attrs) { + g_return_if_fail (self != NULL); + g_return_if_fail (attrs != NULL); + { + GeeIterator* _tmp0_ = NULL; + GeeIterator* _s_it; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs); + _s_it = _tmp0_; + while (TRUE) { + gboolean _tmp1_; + gpointer _tmp2_ = NULL; + gchar* s; + _tmp1_ = gee_iterator_next (_s_it); + if (!_tmp1_) { + break; + } + _tmp2_ = gee_iterator_get (_s_it); + s = (gchar*) _tmp2_; + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, PLAYER_ITEM_EMPTY); + _g_free0 (s); + } + _g_object_unref0 (_s_it); + } +} + + +/** + * update() + * Base update method for playeritems, takes the attributes and the incoming updates + * and attmepts to update the appropriate props on the object. + * Album art is handled separately to deal with remote and local file paths. + */ +static gpointer _g_variant_ref0 (gpointer self) { + return self ? g_variant_ref (self) : NULL; +} + + +static gchar* string_strip (const gchar* self) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gchar* _result_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = g_strdup (self); + _result_ = _tmp0_; + g_strstrip (_result_); + result = _result_; + return result; +} + + +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + gchar* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + _tmp0_ = strstr ((gchar*) self, (gchar*) needle); + result = _tmp0_ != NULL; + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes) { + g_return_if_fail (self != NULL); + g_return_if_fail (data != NULL); + g_return_if_fail (attributes != NULL); + if (data == NULL) { + g_warning ("player-item.vala:54: PlayerItem::Update -> The hashtable was null - ju" \ +"st leave it!"); + return; + } + { + GeeIterator* _tmp0_ = NULL; + GeeIterator* _property_it; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes); + _property_it = _tmp0_; + while (TRUE) { + gboolean _tmp1_; + gpointer _tmp2_ = NULL; + gchar* property; + gchar** _tmp3_; + gchar** _tmp4_ = NULL; + gchar** input_keys; + gint input_keys_length1; + gint _input_keys_size_; + gchar* _tmp5_; + gchar* search_key; + gconstpointer _tmp6_ = NULL; + GVariant* _tmp7_; + GVariant* v; + gboolean _tmp8_; + _tmp1_ = gee_iterator_next (_property_it); + if (!_tmp1_) { + break; + } + _tmp2_ = gee_iterator_get (_property_it); + property = (gchar*) _tmp2_; + _tmp4_ = _tmp3_ = g_strsplit (property, "-", 0); + input_keys = _tmp4_; + input_keys_length1 = _vala_array_length (_tmp3_); + _input_keys_size_ = _vala_array_length (_tmp3_); + _tmp5_ = g_strdup ((input_keys + (input_keys_length1 - 1))[0]); + search_key = _tmp5_; + _tmp6_ = g_hash_table_lookup (data, search_key); + _tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_); + v = _tmp7_; + if (v == NULL) { + _g_variant_unref0 (v); + _g_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); + continue; + } + _tmp8_ = g_variant_is_of_type (v, G_VARIANT_TYPE_STRING); + if (_tmp8_) { + const gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; + gchar* update; + gboolean _tmp11_; + _tmp9_ = g_variant_get_string (v, NULL); + _tmp10_ = string_strip (_tmp9_); + update = _tmp10_; + _tmp11_ = string_contains (property, "mpris:artUrl"); + if (_tmp11_) { + PlayerItem* _tmp12_; + MetadataMenuitem* _tmp13_; + MetadataMenuitem* metadata; + _tmp12_ = self; + _tmp13_ = _g_object_ref0 (IS_METADATA_MENUITEM (_tmp12_) ? ((MetadataMenuitem*) _tmp12_) : NULL); + metadata = _tmp13_; + metadata_menuitem_fetch_art (metadata, update, property); + _g_object_unref0 (metadata); + _g_free0 (update); + _g_variant_unref0 (v); + _g_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); + continue; + } + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, update); + _g_free0 (update); + } else { + gboolean _tmp14_; + _tmp14_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT32); + if (_tmp14_) { + gint32 _tmp15_; + _tmp15_ = g_variant_get_int32 (v); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp15_); + } else { + gboolean _tmp16_; + _tmp16_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT64); + if (_tmp16_) { + gint64 _tmp17_; + _tmp17_ = g_variant_get_int64 (v); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp17_); + } else { + gboolean _tmp18_; + _tmp18_ = g_variant_is_of_type (v, G_VARIANT_TYPE_BOOLEAN); + if (_tmp18_) { + gboolean _tmp19_; + _tmp19_ = g_variant_get_boolean (v); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, _tmp19_); + } + } + } + } + _g_variant_unref0 (v); + _g_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); + } + _g_object_unref0 (_property_it); + } +} + + +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (attrs != NULL, FALSE); + { + GeeIterator* _tmp0_ = NULL; + GeeIterator* _prop_it; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs); + _prop_it = _tmp0_; + while (TRUE) { + gboolean _tmp1_; + gpointer _tmp2_ = NULL; + gchar* prop; + gint _tmp3_; + _tmp1_ = gee_iterator_next (_prop_it); + if (!_tmp1_) { + break; + } + _tmp2_ = gee_iterator_get (_prop_it); + prop = (gchar*) _tmp2_; + _tmp3_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop); + if (_tmp3_ != PLAYER_ITEM_EMPTY) { + result = TRUE; + _g_free0 (prop); + _g_object_unref0 (_prop_it); + return result; + } + _g_free0 (prop); + } + _g_object_unref0 (_prop_it); + } + result = FALSE; + return result; +} + + +PlayerController* player_item_get_owner (PlayerItem* self) { + PlayerController* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_owner; + return result; +} + + +static void player_item_set_owner (PlayerItem* self, PlayerController* value) { + PlayerController* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = _g_object_ref0 (value); + _g_object_unref0 (self->priv->_owner); + self->priv->_owner = _tmp0_; + g_object_notify ((GObject *) self, "owner"); +} + + +const gchar* player_item_get_item_type (PlayerItem* self) { + const gchar* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_item_type; + return result; +} + + +static void player_item_set_item_type (PlayerItem* self, const gchar* value) { + gchar* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup (value); + _g_free0 (self->priv->_item_type); + self->priv->_item_type = _tmp0_; + g_object_notify ((GObject *) self, "item-type"); +} + + +static GObject * player_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + PlayerItem * self; + parent_class = G_OBJECT_CLASS (player_item_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = PLAYER_ITEM (obj); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type); + return obj; +} + + +static void player_item_class_init (PlayerItemClass * klass) { + player_item_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (PlayerItemPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_player_item_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_player_item_set_property; + G_OBJECT_CLASS (klass)->constructor = player_item_constructor; + G_OBJECT_CLASS (klass)->finalize = player_item_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_ITEM_OWNER, g_param_spec_object ("owner", "owner", "owner", TYPE_PLAYER_CONTROLLER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_ITEM_ITEM_TYPE, g_param_spec_string ("item-type", "item-type", "item-type", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static void player_item_instance_init (PlayerItem * self) { + self->priv = PLAYER_ITEM_GET_PRIVATE (self); +} + + +static void player_item_finalize (GObject* obj) { + PlayerItem * self; + self = PLAYER_ITEM (obj); + _g_object_unref0 (self->priv->_owner); + _g_free0 (self->priv->_item_type); + G_OBJECT_CLASS (player_item_parent_class)->finalize (obj); +} + + +GType player_item_get_type (void) { + static volatile gsize player_item_type_id__volatile = 0; + if (g_once_init_enter (&player_item_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PlayerItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) player_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlayerItem), 0, (GInstanceInitFunc) player_item_instance_init, NULL }; + GType player_item_type_id; + player_item_type_id = g_type_register_static (DBUSMENU_TYPE_MENUITEM, "PlayerItem", &g_define_type_info, 0); + g_once_init_leave (&player_item_type_id__volatile, player_item_type_id); + } + return player_item_type_id__volatile; +} + + +static void _vala_player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + PlayerItem * self; + self = PLAYER_ITEM (object); + switch (property_id) { + case PLAYER_ITEM_OWNER: + g_value_set_object (value, player_item_get_owner (self)); + break; + case PLAYER_ITEM_ITEM_TYPE: + g_value_set_string (value, player_item_get_item_type (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + PlayerItem * self; + self = PLAYER_ITEM (object); + switch (property_id) { + case PLAYER_ITEM_OWNER: + player_item_set_owner (self, g_value_get_object (value)); + break; + case PLAYER_ITEM_ITEM_TYPE: + player_item_set_item_type (self, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static gint _vala_array_length (gpointer array) { + int length; + length = 0; + if (array) { + while (((gpointer*) array)[length]) { + length++; + } + } + return length; +} + + + diff --git a/src/playlists-menu-item.c b/src/playlists-menu-item.c new file mode 100644 index 0000000..c87dab1 --- /dev/null +++ b/src/playlists-menu-item.c @@ -0,0 +1,568 @@ +/* playlists-menu-item.c generated by valac 0.12.1, the Vala compiler + * generated from playlists-menu-item.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <gee.h> +#include <common-defs.h> +#include <stdlib.h> +#include <string.h> +#include <glib/gi18n-lib.h> + + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; + +#define TYPE_PLAYLISTS_MENUITEM (playlists_menuitem_get_type ()) +#define PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitem)) +#define PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) +#define IS_PLAYLISTS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYLISTS_MENUITEM)) +#define IS_PLAYLISTS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYLISTS_MENUITEM)) +#define PLAYLISTS_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemClass)) + +typedef struct _PlaylistsMenuitem PlaylistsMenuitem; +typedef struct _PlaylistsMenuitemClass PlaylistsMenuitemClass; +typedef struct _PlaylistsMenuitemPrivate PlaylistsMenuitemPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; + +#define TYPE_PLAYLIST_DETAILS (playlist_details_get_type ()) +typedef struct _PlaylistDetails PlaylistDetails; +typedef struct _Block1Data Block1Data; +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _PlaylistsMenuitem { + PlayerItem parent_instance; + PlaylistsMenuitemPrivate * priv; + DbusmenuMenuitem* root_item; +}; + +struct _PlaylistsMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _PlaylistsMenuitemPrivate { + GeeHashMap* current_playlists; +}; + +struct _PlaylistDetails { + char* path; + gchar* name; + gchar* icon_path; +}; + +struct _Block1Data { + int _ref_count_; + PlaylistsMenuitem * self; + DbusmenuMenuitem* menuitem; +}; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + + +static gpointer playlists_menuitem_parent_class = NULL; + +GType player_item_get_type (void) G_GNUC_CONST; +GType playlists_menuitem_get_type (void) G_GNUC_CONST; +#define PLAYLISTS_MENUITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYLISTS_MENUITEM, PlaylistsMenuitemPrivate)) +enum { + PLAYLISTS_MENUITEM_DUMMY_PROPERTY +}; +GType player_controller_get_type (void) G_GNUC_CONST; +PlaylistsMenuitem* playlists_menuitem_new (PlayerController* parent); +PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent); +GType playlist_details_get_type (void) G_GNUC_CONST; +PlaylistDetails* playlist_details_dup (const PlaylistDetails* self); +void playlist_details_free (PlaylistDetails* self); +void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest); +void playlist_details_destroy (PlaylistDetails* self); +void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1); +static Block1Data* block1_data_ref (Block1Data* _data1_); +static void block1_data_unref (Block1Data* _data1_); +static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, PlaylistDetails* new_detail); +static gboolean playlists_menuitem_is_video_related (PlaylistsMenuitem* self, PlaylistDetails* new_detail); +static void _lambda1_ (Block1Data* _data1_); +static void playlists_menuitem_submenu_item_activated (PlaylistsMenuitem* self, gint menu_item_id); +static void __lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint timestamp, gpointer self); +void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail); +void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail); +PlayerController* player_item_get_owner (PlayerItem* self); +GType mpris2_controller_get_type (void) G_GNUC_CONST; +void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* path); +GeeHashSet* playlists_menuitem_attributes_format (void); +static GObject * playlists_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +static void playlists_menuitem_finalize (GObject* obj); + + +PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent) { + PlaylistsMenuitem * self = NULL; + g_return_val_if_fail (parent != NULL, NULL); + self = (PlaylistsMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_PLAYLISTS_MENUITEM_TYPE, "owner", parent, NULL); + return self; +} + + +PlaylistsMenuitem* playlists_menuitem_new (PlayerController* parent) { + return playlists_menuitem_construct (TYPE_PLAYLISTS_MENUITEM, parent); +} + + +static Block1Data* block1_data_ref (Block1Data* _data1_) { + g_atomic_int_inc (&_data1_->_ref_count_); + return _data1_; +} + + +static void block1_data_unref (Block1Data* _data1_) { + if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { + _g_object_unref0 (_data1_->self); + _g_object_unref0 (_data1_->menuitem); + g_slice_free (Block1Data, _data1_); + } +} + + +static void _lambda1_ (Block1Data* _data1_) { + PlaylistsMenuitem * self; + gint _tmp0_; + self = _data1_->self; + _tmp0_ = dbusmenu_menuitem_get_id (_data1_->menuitem); + playlists_menuitem_submenu_item_activated (self, _tmp0_); +} + + +static void __lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint timestamp, gpointer self) { + _lambda1_ (self); +} + + +void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1) { + g_return_if_fail (self != NULL); + { + PlaylistDetails* detail_collection; + int detail_collection_length1; + int detail_it; + detail_collection = playlists; + detail_collection_length1 = playlists_length1; + for (detail_it = 0; detail_it < playlists_length1; detail_it = detail_it + 1) { + PlaylistDetails _tmp0_; + PlaylistDetails _tmp1_ = {0}; + PlaylistDetails detail; + playlist_details_copy (&detail_collection[detail_it], &_tmp1_); + _tmp0_ = _tmp1_; + detail = _tmp0_; + { + Block1Data* _data1_; + gboolean _tmp2_ = FALSE; + gboolean _tmp3_; + DbusmenuMenuitem* _tmp5_ = NULL; + gint _tmp6_; + _data1_ = g_slice_new0 (Block1Data); + _data1_->_ref_count_ = 1; + _data1_->self = g_object_ref (self); + _tmp3_ = playlists_menuitem_already_observed (self, &detail); + if (_tmp3_) { + _tmp2_ = TRUE; + } else { + gboolean _tmp4_; + _tmp4_ = playlists_menuitem_is_video_related (self, &detail); + _tmp2_ = _tmp4_; + } + if (_tmp2_) { + playlist_details_destroy (&detail); + block1_data_unref (_data1_); + _data1_ = NULL; + continue; + } + _tmp5_ = dbusmenu_menuitem_new (); + _data1_->menuitem = _tmp5_; + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_LABEL, detail.name); + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, "playlist-symbolic"); + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) detail.path); + dbusmenu_menuitem_property_set_bool (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + dbusmenu_menuitem_property_set_bool (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); + g_signal_connect_data (_data1_->menuitem, "item-activated", (GCallback) __lambda1__dbusmenu_menuitem_item_activated, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); + _tmp6_ = dbusmenu_menuitem_get_id (_data1_->menuitem); + gee_abstract_map_set ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (_tmp6_), _data1_->menuitem); + dbusmenu_menuitem_child_append (self->root_item, _data1_->menuitem); + playlist_details_destroy (&detail); + block1_data_unref (_data1_); + _data1_ = NULL; + } + } + } + { + GeeCollection* _tmp7_ = NULL; + GeeCollection* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* _tmp10_; + GeeIterator* _item_it; + _tmp7_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp8_ = _tmp7_; + _tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_); + _tmp10_ = _tmp9_; + _g_object_unref0 (_tmp8_); + _item_it = _tmp10_; + while (TRUE) { + gboolean _tmp11_; + gpointer _tmp12_ = NULL; + DbusmenuMenuitem* item; + gboolean within; + _tmp11_ = gee_iterator_next (_item_it); + if (!_tmp11_) { + break; + } + _tmp12_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp12_; + within = FALSE; + { + PlaylistDetails* detail_collection; + int detail_collection_length1; + int detail_it; + detail_collection = playlists; + detail_collection_length1 = playlists_length1; + for (detail_it = 0; detail_it < playlists_length1; detail_it = detail_it + 1) { + PlaylistDetails _tmp13_; + PlaylistDetails _tmp14_ = {0}; + PlaylistDetails detail; + playlist_details_copy (&detail_collection[detail_it], &_tmp14_); + _tmp13_ = _tmp14_; + detail = _tmp13_; + { + const gchar* _tmp15_ = NULL; + _tmp15_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (detail.path, _tmp15_) == 0) { + within = TRUE; + playlist_details_destroy (&detail); + break; + } + playlist_details_destroy (&detail); + } + } + } + if (within == FALSE) { + const gchar* _tmp16_ = NULL; + const gchar* _tmp17_ = NULL; + _tmp16_ = dbusmenu_menuitem_property_get (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + _tmp17_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (_tmp16_, _tmp17_) == 0) { + const gchar* _tmp18_ = NULL; + _tmp18_ = _ ("Choose Playlist"); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp18_); + } + dbusmenu_menuitem_child_delete (self->root_item, item); + } + _g_object_unref0 (item); + } + _g_object_unref0 (_item_it); + } +} + + +void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { + const gchar* _tmp7_ = NULL; + g_return_if_fail (self != NULL); + { + GeeCollection* _tmp0_ = NULL; + GeeCollection* _tmp1_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp3_; + GeeIterator* _item_it; + _tmp0_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); + _tmp3_ = _tmp2_; + _g_object_unref0 (_tmp1_); + _item_it = _tmp3_; + while (TRUE) { + gboolean _tmp4_; + gpointer _tmp5_ = NULL; + DbusmenuMenuitem* item; + const gchar* _tmp6_ = NULL; + _tmp4_ = gee_iterator_next (_item_it); + if (!_tmp4_) { + break; + } + _tmp5_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp5_; + _tmp6_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 ((*new_detail).path, _tmp6_) == 0) { + dbusmenu_menuitem_property_set (item, DBUSMENU_MENUITEM_PROP_LABEL, (*new_detail).name); + } + _g_object_unref0 (item); + } + _g_object_unref0 (_item_it); + } + _tmp7_ = dbusmenu_menuitem_property_get (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (_tmp7_, (*new_detail).path) == 0) { + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, (*new_detail).name); + } +} + + +static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + { + GeeCollection* _tmp0_ = NULL; + GeeCollection* _tmp1_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp3_; + GeeIterator* _item_it; + _tmp0_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); + _tmp3_ = _tmp2_; + _g_object_unref0 (_tmp1_); + _item_it = _tmp3_; + while (TRUE) { + gboolean _tmp4_; + gpointer _tmp5_ = NULL; + DbusmenuMenuitem* item; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gchar* path; + _tmp4_ = gee_iterator_next (_item_it); + if (!_tmp4_) { + break; + } + _tmp5_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp5_; + _tmp6_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + _tmp7_ = g_strdup (_tmp6_); + path = _tmp7_; + if (g_strcmp0 ((*new_detail).path, path) == 0) { + result = TRUE; + _g_free0 (path); + _g_object_unref0 (item); + _g_object_unref0 (_item_it); + return result; + } + _g_free0 (path); + _g_object_unref0 (item); + } + _g_object_unref0 (_item_it); + } + result = FALSE; + return result; +} + + +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + gchar* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + _tmp0_ = strstr ((gchar*) self, (gchar*) needle); + result = _tmp0_ != NULL; + return result; +} + + +static gboolean playlists_menuitem_is_video_related (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { + gboolean result = FALSE; + gchar* _tmp0_; + gchar* location; + gboolean _tmp1_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = g_strdup ((const gchar*) (*new_detail).path); + location = _tmp0_; + _tmp1_ = string_contains (location, "/VideoLibrarySource/"); + if (_tmp1_) { + result = TRUE; + _g_free0 (location); + return result; + } + result = FALSE; + _g_free0 (location); + return result; +} + + +void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail) { + gchar* _tmp0_; + gchar* update; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup ((*detail).name); + update = _tmp0_; + if (g_strcmp0 (update, "") == 0) { + const gchar* _tmp1_ = NULL; + gchar* _tmp2_; + _tmp1_ = _ ("Choose Playlist"); + _tmp2_ = g_strdup (_tmp1_); + _g_free0 (update); + update = _tmp2_; + } + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, update); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) (*detail).path); + _g_free0 (update); +} + + +static void playlists_menuitem_submenu_item_activated (PlaylistsMenuitem* self, gint menu_item_id) { + gboolean _tmp0_; + PlayerController* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + DbusmenuMenuitem* _tmp3_; + const gchar* _tmp4_ = NULL; + g_return_if_fail (self != NULL); + _tmp0_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (menu_item_id)); + if (!_tmp0_) { + g_warning ("playlists-menu-item.vala:125: item %i was activated but we don't have " \ +"a corresponding playlist", menu_item_id); + return; + } + _tmp1_ = player_item_get_owner ((PlayerItem*) self); + _tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (menu_item_id)); + _tmp3_ = (DbusmenuMenuitem*) _tmp2_; + _tmp4_ = dbusmenu_menuitem_property_get (_tmp3_, DBUSMENU_PLAYLIST_MENUITEM_PATH); + mpris2_controller_activate_playlist (_tmp1_->mpris_bridge, (const char*) _tmp4_); + _g_object_unref0 (_tmp3_); +} + + +GeeHashSet* playlists_menuitem_attributes_format (void) { + GeeHashSet* result = NULL; + GeeHashSet* _tmp0_ = NULL; + GeeHashSet* attrs; + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + attrs = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_PLAYLISTS_MENUITEM_TITLE); + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_PLAYLISTS_MENUITEM_PLAYLISTS); + result = attrs; + return result; +} + + +static GObject * playlists_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + PlaylistsMenuitem * self; + GeeHashMap* _tmp0_ = NULL; + DbusmenuMenuitem* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + parent_class = G_OBJECT_CLASS (playlists_menuitem_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = PLAYLISTS_MENUITEM (obj); + _tmp0_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, DBUSMENU_TYPE_MENUITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); + _g_object_unref0 (self->priv->current_playlists); + self->priv->current_playlists = _tmp0_; + _tmp1_ = dbusmenu_menuitem_new (); + _g_object_unref0 (self->root_item); + self->root_item = _tmp1_; + _tmp2_ = _ ("Choose Playlist"); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp2_); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH, ""); + return obj; +} + + +static void playlists_menuitem_class_init (PlaylistsMenuitemClass * klass) { + playlists_menuitem_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (PlaylistsMenuitemPrivate)); + G_OBJECT_CLASS (klass)->constructor = playlists_menuitem_constructor; + G_OBJECT_CLASS (klass)->finalize = playlists_menuitem_finalize; +} + + +static void playlists_menuitem_instance_init (PlaylistsMenuitem * self) { + self->priv = PLAYLISTS_MENUITEM_GET_PRIVATE (self); +} + + +static void playlists_menuitem_finalize (GObject* obj) { + PlaylistsMenuitem * self; + self = PLAYLISTS_MENUITEM (obj); + _g_object_unref0 (self->priv->current_playlists); + _g_object_unref0 (self->root_item); + G_OBJECT_CLASS (playlists_menuitem_parent_class)->finalize (obj); +} + + +GType playlists_menuitem_get_type (void) { + static volatile gsize playlists_menuitem_type_id__volatile = 0; + if (g_once_init_enter (&playlists_menuitem_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PlaylistsMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) playlists_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlaylistsMenuitem), 0, (GInstanceInitFunc) playlists_menuitem_instance_init, NULL }; + GType playlists_menuitem_type_id; + playlists_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "PlaylistsMenuitem", &g_define_type_info, 0); + g_once_init_leave (&playlists_menuitem_type_id__volatile, playlists_menuitem_type_id); + } + return playlists_menuitem_type_id__volatile; +} + + + diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala deleted file mode 100644 index e300050..0000000 --- a/src/scrub-menu-item.vala +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2010 Canonical Ltd. - -Authors: - Conor Curran <conor.curran@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. -*/ - -using Dbusmenu; -using DbusmenuScrub; -using Gee; - -public class ScrubMenuitem : PlayerItem -{ - public ScrubMenuitem(PlayerController parent) - { - Object(item_type: MENUITEM_TYPE, owner: parent); - reset(attributes_format()); - } - - public override void handle_event(string name, GLib.Value input_value, uint timestamp) - { - debug("handle_event for owner %s with value: %f", this.owner.name, input_value.get_double()); - this.owner.mpris_bridge.set_track_position(input_value.get_double()); - } - - public void update_position(int32 new_position) - { - this.property_set_int(MENUITEM_POSITION, new_position); - } - - public void update_playstate(int state) - { - this.property_set_int(MENUITEM_PLAY_STATE, state); - } - - public static HashSet<string> attributes_format() - { - HashSet<string> attrs = new HashSet<string>(); - attrs.add(MENUITEM_DURATION); - attrs.add(MENUITEM_POSITION); - attrs.add(MENUITEM_PLAY_STATE); - return attrs; - } -}
\ No newline at end of file diff --git a/src/settings-manager.c b/src/settings-manager.c new file mode 100644 index 0000000..748cffe --- /dev/null +++ b/src/settings-manager.c @@ -0,0 +1,363 @@ +/* settings-manager.c generated by valac 0.12.1, the Vala compiler + * generated from settings-manager.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <stdlib.h> +#include <string.h> +#include <gee.h> + + +#define TYPE_SETTINGS_MANAGER (settings_manager_get_type ()) +#define SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SETTINGS_MANAGER, SettingsManager)) +#define SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) +#define IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SETTINGS_MANAGER)) +#define IS_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SETTINGS_MANAGER)) +#define SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SETTINGS_MANAGER, SettingsManagerClass)) + +typedef struct _SettingsManager SettingsManager; +typedef struct _SettingsManagerClass SettingsManagerClass; +typedef struct _SettingsManagerPrivate SettingsManagerPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) + +struct _SettingsManager { + GObject parent_instance; + SettingsManagerPrivate * priv; +}; + +struct _SettingsManagerClass { + GObjectClass parent_class; +}; + +struct _SettingsManagerPrivate { + GSettings* settings; +}; + + +static gpointer settings_manager_parent_class = NULL; + +GType settings_manager_get_type (void) G_GNUC_CONST; +#define SETTINGS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SETTINGS_MANAGER, SettingsManagerPrivate)) +enum { + SETTINGS_MANAGER_DUMMY_PROPERTY +}; +SettingsManager* settings_manager_new (void); +SettingsManager* settings_manager_construct (GType object_type); +gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1); +GeeArrayList* settings_manager_fetch_interested (SettingsManager* self); +static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle); +void settings_manager_clear_list (SettingsManager* self); +void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name); +static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value); +static void settings_manager_on_blacklist_event (SettingsManager* self); +static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static GObject * settings_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +static void _settings_manager_on_blacklist_event_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self); +static void settings_manager_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static gint _vala_array_length (gpointer array); + + +SettingsManager* settings_manager_construct (GType object_type) { + SettingsManager * self = NULL; + self = (SettingsManager*) g_object_new (object_type, NULL); + return self; +} + + +SettingsManager* settings_manager_new (void) { + return settings_manager_construct (TYPE_SETTINGS_MANAGER); +} + + +gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1) { + gchar** result = NULL; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** _tmp2_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + _tmp2_ = _tmp1_; + if (result_length1) { + *result_length1 = _vala_array_length (_tmp0_); + } + result = _tmp2_; + return result; +} + + +static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) { + int i; + for (i = 0; i < stack_length; i++) { + if (g_strcmp0 (stack[i], needle) == 0) { + return TRUE; + } + } + return FALSE; +} + + +GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) { + GeeArrayList* result = NULL; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** blacklisted; + gint blacklisted_length1; + gint _blacklisted_size_; + gchar** _tmp2_; + gchar** _tmp3_ = NULL; + gchar** interested; + gint interested_length1; + gint _interested_size_; + GeeArrayList* _tmp4_ = NULL; + GeeArrayList* list; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + blacklisted = _tmp1_; + blacklisted_length1 = _vala_array_length (_tmp0_); + _blacklisted_size_ = _vala_array_length (_tmp0_); + _tmp3_ = _tmp2_ = g_settings_get_strv (self->priv->settings, "interested-media-players"); + interested = _tmp3_; + interested_length1 = _vala_array_length (_tmp2_); + _interested_size_ = _vala_array_length (_tmp2_); + _tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + list = _tmp4_; + { + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = interested; + s_collection_length1 = interested_length1; + for (s_it = 0; s_it < interested_length1; s_it = s_it + 1) { + gchar* _tmp5_; + gchar* s; + _tmp5_ = g_strdup (s_collection[s_it]); + s = _tmp5_; + { + gboolean _tmp7_; + if (g_strcmp0 (s, "banshee-1") == 0) { + gchar* _tmp6_; + _tmp6_ = g_strdup ("banshee"); + _g_free0 (s); + s = _tmp6_; + } + _tmp7_ = gee_abstract_collection_contains ((GeeAbstractCollection*) list, s); + if (_tmp7_) { + _g_free0 (s); + continue; + } + if (_vala_string_array_contains (blacklisted, blacklisted_length1, s)) { + _g_free0 (s); + continue; + } + gee_abstract_collection_add ((GeeAbstractCollection*) list, s); + _g_free0 (s); + } + } + } + result = list; + interested = (_vala_array_free (interested, interested_length1, (GDestroyNotify) g_free), NULL); + blacklisted = (_vala_array_free (blacklisted, blacklisted_length1, (GDestroyNotify) g_free), NULL); + return result; +} + + +void settings_manager_clear_list (SettingsManager* self) { + g_return_if_fail (self != NULL); + g_settings_reset (self->priv->settings, "interested-media-players"); +} + + +static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) { + if ((*length) == (*size)) { + *size = (*size) ? (2 * (*size)) : 4; + *array = g_renew (gchar*, *array, (*size) + 1); + } + (*array)[(*length)++] = value; + (*array)[*length] = NULL; +} + + +void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name) { + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** already_interested; + gint already_interested_length1; + gint _already_interested_size_; + gchar* _tmp3_; + g_return_if_fail (self != NULL); + g_return_if_fail (app_desktop_name != NULL); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "interested-media-players"); + already_interested = _tmp1_; + already_interested_length1 = _vala_array_length (_tmp0_); + _already_interested_size_ = _vala_array_length (_tmp0_); + { + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = already_interested; + s_collection_length1 = already_interested_length1; + for (s_it = 0; s_it < already_interested_length1; s_it = s_it + 1) { + gchar* _tmp2_; + gchar* s; + _tmp2_ = g_strdup (s_collection[s_it]); + s = _tmp2_; + { + if (g_strcmp0 (s, app_desktop_name) == 0) { + _g_free0 (s); + already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL); + return; + } + _g_free0 (s); + } + } + } + _tmp3_ = g_strdup (app_desktop_name); + _vala_array_add1 (&already_interested, &already_interested_length1, &_already_interested_size_, _tmp3_); + g_settings_set_strv (self->priv->settings, "interested-media-players", already_interested); + g_settings_apply (self->priv->settings); + already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL); +} + + +static void settings_manager_on_blacklist_event (SettingsManager* self) { + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** _tmp2_; + gint _tmp2__length1; + g_return_if_fail (self != NULL); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + _tmp2_ = _tmp1_; + _tmp2__length1 = _vala_array_length (_tmp0_); + g_signal_emit_by_name (self, "blacklist-updates", _tmp2_, _vala_array_length (_tmp0_)); + _tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL); +} + + +static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__BOXED_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2); + register GMarshalFunc_VOID__BOXED_INT callback; + register GCClosure * cc; + register gpointer data1, data2; + cc = (GCClosure *) closure; + g_return_if_fail (n_param_values == 3); + if (G_CCLOSURE_SWAP_DATA (closure)) { + data1 = closure->data; + data2 = param_values->data[0].v_pointer; + } else { + data1 = param_values->data[0].v_pointer; + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__BOXED_INT) (marshal_data ? marshal_data : cc->callback); + callback (data1, g_value_get_boxed (param_values + 1), g_value_get_int (param_values + 2), data2); +} + + +static void _settings_manager_on_blacklist_event_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) { + settings_manager_on_blacklist_event (self); +} + + +static GObject * settings_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + SettingsManager * self; + GSettings* _tmp0_ = NULL; + parent_class = G_OBJECT_CLASS (settings_manager_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = SETTINGS_MANAGER (obj); + _tmp0_ = g_settings_new ("com.canonical.indicators.sound"); + _g_object_unref0 (self->priv->settings); + self->priv->settings = _tmp0_; + g_signal_connect_object (self->priv->settings, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0); + return obj; +} + + +static void settings_manager_class_init (SettingsManagerClass * klass) { + settings_manager_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (SettingsManagerPrivate)); + G_OBJECT_CLASS (klass)->constructor = settings_manager_constructor; + G_OBJECT_CLASS (klass)->finalize = settings_manager_finalize; + g_signal_new ("blacklist_updates", TYPE_SETTINGS_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_INT, G_TYPE_NONE, 2, G_TYPE_STRV, G_TYPE_INT); +} + + +static void settings_manager_instance_init (SettingsManager * self) { + self->priv = SETTINGS_MANAGER_GET_PRIVATE (self); +} + + +static void settings_manager_finalize (GObject* obj) { + SettingsManager * self; + self = SETTINGS_MANAGER (obj); + _g_object_unref0 (self->priv->settings); + G_OBJECT_CLASS (settings_manager_parent_class)->finalize (obj); +} + + +GType settings_manager_get_type (void) { + static volatile gsize settings_manager_type_id__volatile = 0; + if (g_once_init_enter (&settings_manager_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (SettingsManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) settings_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SettingsManager), 0, (GInstanceInitFunc) settings_manager_instance_init, NULL }; + GType settings_manager_type_id; + settings_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "SettingsManager", &g_define_type_info, 0); + g_once_init_leave (&settings_manager_type_id__volatile, settings_manager_type_id); + } + return settings_manager_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static gint _vala_array_length (gpointer array) { + int length; + length = 0; + if (array) { + while (((gpointer*) array)[length]) { + length++; + } + } + return length; +} + + + diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c new file mode 100644 index 0000000..2f2fe0f --- /dev/null +++ b/src/transport-menu-item.c @@ -0,0 +1,332 @@ +/* transport-menu-item.c generated by valac 0.12.1, the Vala compiler + * generated from transport-menu-item.vala, do not modify */ + +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <glib-object.h> +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/dbusmenu-glib.h> +#include <libdbusmenu-glib/enum-types.h> +#include <libdbusmenu-glib/menuitem-proxy.h> +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/types.h> +#include <common-defs.h> +#include <gee.h> +#include <stdlib.h> +#include <string.h> + + +#define TYPE_PLAYER_ITEM (player_item_get_type ()) +#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem)) +#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass)) +#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM)) +#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM)) +#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass)) + +typedef struct _PlayerItem PlayerItem; +typedef struct _PlayerItemClass PlayerItemClass; +typedef struct _PlayerItemPrivate PlayerItemPrivate; + +#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ()) +#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem)) +#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) +#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM)) +#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM)) +#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass)) + +typedef struct _TransportMenuitem TransportMenuitem; +typedef struct _TransportMenuitemClass TransportMenuitemClass; +typedef struct _TransportMenuitemPrivate TransportMenuitemPrivate; + +#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) +#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) +#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) +#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER)) +#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER)) +#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass)) + +typedef struct _PlayerController PlayerController; +typedef struct _PlayerControllerClass PlayerControllerClass; +typedef struct _PlayerControllerPrivate PlayerControllerPrivate; + +#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ()) +#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller)) +#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) +#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER)) +#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER)) +#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass)) + +typedef struct _Mpris2Controller Mpris2Controller; +typedef struct _Mpris2ControllerClass Mpris2ControllerClass; +#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) + +struct _PlayerItem { + DbusmenuMenuitem parent_instance; + PlayerItemPrivate * priv; +}; + +struct _PlayerItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _TransportMenuitem { + PlayerItem parent_instance; + TransportMenuitemPrivate * priv; +}; + +struct _TransportMenuitemClass { + PlayerItemClass parent_class; +}; + +struct _TransportMenuitemPrivate { + TransportAction cached_action; +}; + +struct _PlayerController { + GObject parent_instance; + PlayerControllerPrivate * priv; + gint current_state; + GeeArrayList* custom_items; + Mpris2Controller* mpris_bridge; + gboolean* use_playlists; +}; + +struct _PlayerControllerClass { + GObjectClass parent_class; +}; + +typedef enum { + PLAYER_CONTROLLER_STATE_OFFLINE, + PLAYER_CONTROLLER_STATE_INSTANTIATING, + PLAYER_CONTROLLER_STATE_READY, + PLAYER_CONTROLLER_STATE_CONNECTED, + PLAYER_CONTROLLER_STATE_DISCONNECTED +} PlayerControllerstate; + + +static gpointer transport_menuitem_parent_class = NULL; + +GType player_item_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; +#define TRANSPORT_MENUITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TRANSPORT_MENUITEM, TransportMenuitemPrivate)) +enum { + TRANSPORT_MENUITEM_DUMMY_PROPERTY +}; +GType player_controller_get_type (void) G_GNUC_CONST; +TransportMenuitem* transport_menuitem_new (PlayerController* parent); +TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent); +void transport_menuitem_handle_cached_action (TransportMenuitem* self); +static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self); +static gboolean _transport_menuitem_send_cached_action_gsource_func (gpointer self); +PlayerController* player_item_get_owner (PlayerItem* self); +GType mpris2_controller_get_type (void) G_GNUC_CONST; +void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction command); +void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update); +static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp); +static gboolean transport_menuitem_get_running (TransportMenuitem* self); +void player_controller_instantiate (PlayerController* self); +GeeHashSet* transport_menuitem_attributes_format (void); +GType player_controller_state_get_type (void) G_GNUC_CONST; +static GObject * transport_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +static void transport_menuitem_finalize (GObject* obj); +static void _vala_transport_menuitem_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); + + +TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent) { + TransportMenuitem * self = NULL; + g_return_val_if_fail (parent != NULL, NULL); + self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL); + return self; +} + + +TransportMenuitem* transport_menuitem_new (PlayerController* parent) { + return transport_menuitem_construct (TYPE_TRANSPORT_MENUITEM, parent); +} + + +/** + Please remove this timeout when the default player can handle mpris commands + immediately once it raises its dbus interface + **/ +static gboolean _transport_menuitem_send_cached_action_gsource_func (gpointer self) { + gboolean result; + result = transport_menuitem_send_cached_action (self); + return result; +} + + +void transport_menuitem_handle_cached_action (TransportMenuitem* self) { + g_return_if_fail (self != NULL); + if (self->priv->cached_action != TRANSPORT_ACTION_NO_ACTION) { + g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, _transport_menuitem_send_cached_action_gsource_func, g_object_ref (self), g_object_unref); + } +} + + +static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self) { + gboolean result = FALSE; + PlayerController* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = player_item_get_owner ((PlayerItem*) self); + mpris2_controller_transport_update (_tmp0_->mpris_bridge, self->priv->cached_action); + self->priv->cached_action = TRANSPORT_ACTION_NO_ACTION; + result = FALSE; + return result; +} + + +void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update) { + gint temp; + g_return_if_fail (self != NULL); + temp = (gint) update; + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, temp); +} + + +static gpointer _g_variant_ref0 (gpointer self) { + return self ? g_variant_ref (self) : NULL; +} + + +static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) { + TransportMenuitem * self; + GVariant* _tmp0_; + GVariant* v; + gboolean _tmp1_; + gint32 _tmp3_; + gint32 input; + gboolean _tmp4_; + self = (TransportMenuitem*) base; + g_return_if_fail (name != NULL); + g_return_if_fail (input_value != NULL); + _tmp0_ = _g_variant_ref0 (input_value); + v = _tmp0_; + _tmp1_ = g_variant_is_of_type (input_value, G_VARIANT_TYPE_VARIANT); + if (_tmp1_) { + GVariant* _tmp2_ = NULL; + _tmp2_ = g_variant_get_variant (input_value); + _g_variant_unref0 (v); + v = _tmp2_; + } + _tmp3_ = g_variant_get_int32 (v); + input = _tmp3_; + _tmp4_ = transport_menuitem_get_running (self); + if (_tmp4_ == TRUE) { + PlayerController* _tmp5_ = NULL; + _tmp5_ = player_item_get_owner ((PlayerItem*) self); + mpris2_controller_transport_update (_tmp5_->mpris_bridge, (TransportAction) input); + } else { + PlayerController* _tmp6_ = NULL; + self->priv->cached_action = (TransportAction) input; + _tmp6_ = player_item_get_owner ((PlayerItem*) self); + player_controller_instantiate (_tmp6_); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, (gint) TRANSPORT_STATE_LAUNCHING); + } + _g_variant_unref0 (v); +} + + +GeeHashSet* transport_menuitem_attributes_format (void) { + GeeHashSet* result = NULL; + GeeHashSet* _tmp0_ = NULL; + GeeHashSet* attrs; + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + attrs = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE); + result = attrs; + return result; +} + + +static gboolean transport_menuitem_get_running (TransportMenuitem* self) { + gboolean result; + PlayerController* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = player_item_get_owner ((PlayerItem*) self); + result = _tmp0_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED; + return result; +} + + +static GObject * transport_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + TransportMenuitem * self; + parent_class = G_OBJECT_CLASS (transport_menuitem_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = TRANSPORT_MENUITEM (obj); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, (gint) TRANSPORT_STATE_PAUSED); + self->priv->cached_action = TRANSPORT_ACTION_NO_ACTION; + return obj; +} + + +static void transport_menuitem_class_init (TransportMenuitemClass * klass) { + transport_menuitem_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (TransportMenuitemPrivate)); + DBUSMENU_MENUITEM_CLASS (klass)->handle_event = transport_menuitem_real_handle_event; + G_OBJECT_CLASS (klass)->get_property = _vala_transport_menuitem_get_property; + G_OBJECT_CLASS (klass)->constructor = transport_menuitem_constructor; + G_OBJECT_CLASS (klass)->finalize = transport_menuitem_finalize; +} + + +static void transport_menuitem_instance_init (TransportMenuitem * self) { + self->priv = TRANSPORT_MENUITEM_GET_PRIVATE (self); +} + + +static void transport_menuitem_finalize (GObject* obj) { + TransportMenuitem * self; + self = TRANSPORT_MENUITEM (obj); + G_OBJECT_CLASS (transport_menuitem_parent_class)->finalize (obj); +} + + +GType transport_menuitem_get_type (void) { + static volatile gsize transport_menuitem_type_id__volatile = 0; + if (g_once_init_enter (&transport_menuitem_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (TransportMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) transport_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TransportMenuitem), 0, (GInstanceInitFunc) transport_menuitem_instance_init, NULL }; + GType transport_menuitem_type_id; + transport_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "TransportMenuitem", &g_define_type_info, 0); + g_once_init_leave (&transport_menuitem_type_id__volatile, transport_menuitem_type_id); + } + return transport_menuitem_type_id__volatile; +} + + +static void _vala_transport_menuitem_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + TransportMenuitem * self; + self = TRANSPORT_MENUITEM (object); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + |