%
% anyremote configuration file for Gwenview/KDE4 management. (Server-mode)
%

% STATUS non-stable
% XTEST no
% SOUND no
% ENV no
% FBROWSER v.3i
% IPC DBUS
% DEF_PIX_VIEWER   
% ALL_IN_ONE 
% MEDIACENTER photo

GuiAppName=Gwenview/KDE4
GuiAppBinary=gwenview
GuiAppVersion=echo 'V=`gwenview -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" = "x4" ]; then echo OK; else echo NOK; fi'|sh -s
GuiAppRun=echo 'A=`pgrep gwenview`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppIcon=gwenview.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Gwenview is a fast and easy to use image viewer for KDE. This configuration file is for Gwenview/KDE4.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v3i.cfg);\
	Macro(FBROWSER_IC_INIT);\
	Include($(CfgDir)/Utils/aliases-server-pix-viewer.cfg);\
	Make(var,app_name,by_value,Gwenview);\
	Make(var,open_file,by_value,);\
	Make(var,kde4_app,by_value,gwenview);\
	Macro(TEST_KDE4_APP);\
	Make(var,app_manage_mode,by_value,gwenview_manage);


(Exit)=\
	Macro(FBROWSER_IC_EXIT);

(Connect)=\
	Make(mode,gwenview_init);

[Mode]=gwenview_init: default_pixviewer_init

APP_IS_RUN=\
	Make(var,app_run,pgrep -u `id -u` gwenview|head -1|wc -l);

[ModeEnd]

[Mode]=gwenview_manage : default_pixviewer

% (EnterMode) by Utils/aliases-server-pix-viewer.cfg

GETPID=\
	Make(var,gw_pid,pgrep -u `id -u` gwenview|head -1);

APP_START_IF=\
	Make(var,app_run,pgrep -u `id -u` gwenview|head -1|wc -l);\
	Exec(if [ "x$(app_run)" = "x0" ]; then cd "$(fbrowser_dir)";gwenview $(open_file)& fi 2> /dev/null);

APP_RAISE=\
	Exec($(CfgDir)/Utils/run-or-switch-to.sh -switch gwenview);

APP_QUIT=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /MainApplication org.kde.KApplication.quit; fi)

APP_FULLSCREEN=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/fullscreen com.trolltech.Qt.QAction.trigger; fi)

PIX_PREV=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/go_previous com.trolltech.Qt.QAction.trigger; fi)

PIX_NEXT=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/go_next com.trolltech.Qt.QAction.trigger; fi)

PIX_FIRST=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/go_first com.trolltech.Qt.QAction.trigger; fi)

PIX_LAST=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/go_last com.trolltech.Qt.QAction.trigger; fi)

PIX_ZOOM_IN=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/view_zoom_in com.trolltech.Qt.QAction.trigger; fi)
	
PIX_ZOOM_OUT=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/view_zoom_out com.trolltech.Qt.QAction.trigger; fi)

PIX_FIT=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/view_zoom_to_fit com.trolltech.Qt.QAction.trigger; fi)

PIX_ROTATE=\
	Macro(GETPID);\
	Exec(if [ "x$(gw_pid)" != "x" ]; then dbus-send --type=method_call --dest=org.kde.gwenview-$(gw_pid) /gwenview/MainWindow_1/actions/rotate_left com.trolltech.Qt.QAction.trigger; fi)

[ModeEnd]

[End]
