%
% anyremote template configuration file for picture viewer management. (Server-mode)
%

% STATUS testing
% XTEST no
% SOUND no
% ENV no
% FBROWSER v.4i
% DEF_PIX_VIEWER   
% ALL_IN_ONE 
% MEDIACENTER photo 

GuiAppName=Picture Viewer
GuiAppBinary=pixviewer.exe
GuiAppRun=P=`ps -ef|grep pixviewer.exe|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=some_app.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=anyRemote template configuration file for picture viewer management

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
    Include($(CfgDir)/Utils/aliases-server-fbrowser-v4i.cfg);\
	Macro(FBROWSER_IC_INIT);\
	Include($(CfgDir)/Utils/aliases-server-pix-viewer.cfg);\
	Make(var,app_name,by_value,Picture Viewer);\
	Make(var,open_file,by_value,);\
	Make(var,app_manage_mode,by_value,pixviewer_manage);

(Exit)=\
	Macro(FBROWSER_IC_EXIT);

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

[Mode]=pixviewer_init : default_pixviewer_init

APP_IS_RUN=\
	Make(var,app_run,ps -ef|grep pixviewer.exe|grep -v grep|grep -v anyremote|grep -v edit|head -1|wc -l);

[ModeEnd]

[Mode]=pixviewer_manage : default_pixviewer

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

APP_SETUP=\
	Make(none);

APP_START_IF=\
    Make(var,app_run,ps -ef|grep pixviewer.exe|grep -v grep|grep -v anyremote|grep -v edit|head -1|wc -l);\
	Exec(if [ "x$(app_run)" = "x0" ]; then \
	         cd "$(fbrowser_dir)";pixviewer.exe $(open_file)& \
	     fi 2> /dev/null);

% Application window should be present in output of "wmctrl -l"
APP_RAISE=\
	Exec(echo "Raise Application Window");\
	Exec($(CfgDir)/Utils/run-or-switch-to.sh -switch pixviewer.exe);

APP_QUIT=\
	Exec(echo "Kill application");

APP_FULLSCREEN=\
	Exec(echo "Fullscreen Application Window");

APP_MENU=\
	Set(menu,replace,Add,Some,Custom,Items,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

%PIX_FILE_BROWSER by Utils/aliases-server-pix-viewer.cfg

PIX_PREV    =Exec(echo "Previous Picture");
PIX_NEXT    =Exec(echo "Next Picture");
PIX_FIRST   =Exec(echo "First Picture");
PIX_LAST    =Exec(echo "Last Picture");
PIX_ZOOM_IN =Exec(echo "Zoom In");
PIX_ZOOM_OUT=Exec(echo "Zoom Out");
PIX_FIT     =Exec(echo "Zoom To Fit");
PIX_ROTATE  =Exec(echo "Rotate");

% PowerMgmt by Utils/aliases-server.cfg 
Add=\
	Exec(echo "Custom Action 1");

Some=\
	Exec(echo "Custom Action 2");

Custom=\
	Exec(echo "Custom Action 3");

Items=\
	Exec(echo "Custom Action 4");

[ModeEnd]

[End]
