%
% anyremote configuration file for evince management (Server-mode)
%

% STATUS stable
% XTEST yes
% SOUND no
% ENV no
% FBROWSER v.3i
% DEF_PRESENTATION   
% ALL_IN_ONE 

GuiAppName=Evince
GuiAppBinary=evince
GuiAppRun=echo 'U=`id -u`;P=`pgrep -l -u $U evince|grep -v evinced`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Evince is a document viewer for multiple document formats. It currently supports pdf, postscript, djvu, tiff and dvi.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Include($(CfgDir)/Utils/aliases-server-presentation.cfg);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v3i.cfg);\
	Make(var,open_file,by_value,);\
	Make(var,app_name,by_value,Evince);\
	Make(var,app_manage_mode,by_value,evince_manage);

(Connect)=Make(mode,evince);

[Mode]=evince : default_presentation_init

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

[ModeEnd]

[Mode]=evince_manage : default_presentation

APP_SETUP=\
	Make(none);

APP_START_IF=\
	Make(var,app_run,pgrep -l -u `id -u` evince|grep -v evinced|head -1|wc -l);\
	Exec(if [ "x$(app_run)" = "x0" ]; then cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";evince $(open_file)& fi 2> /dev/null);
	
APP_RAISE=\
	Exec($(CfgDir)/Utils/run-or-switch-to.sh -switch evince);

APP_QUIT=\
	Exec(pkill evince);\
	Set(title, );

APP_MENU=\
	Set(menu,replace,Up,Down,Rotate,Toggle Sidepanel,Power Off,Suspend);\
	Macro(ALLIN1MENU);

Up=Emulate(key,Up);
Down=Emulate(key,Down);
Toggle Sidepanel=Emulate(key,F9);
Rotate=Emulate(keydown,Control_L,key,Right,keyup,Control_L);

PRES_START=\
	Emulate(key,F5);

PRES_PREV_PAGE=\
	Emulate(key,Page_Up);
	
PRES_NEXT_PAGE=\
	Emulate(key,Page_Down);

PRES_ZOOM_IN=\
	Emulate(keydown,Control_L,key,plus,keyup,Control_L);
	
PRES_ZOOM_OUT=\
	Emulate(keydown,Control_L,key,minus,keyup,Control_L);

PRES_FIRST_PAGE=\
	Emulate(key,Home);
	
PRES_LAST_PAGE=\
	Emulate(key,End);
	
PRES_TOGGLE_FULLSCREEN=\
	Emulate(key,F11);
	
PRES_REFRESH=\
	Emulate(keydown,Control_L,key,R,keyup,Control_L);

[ModeEnd]

[End]
