%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Key aliases for default presentation / document viewer handling in server mode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% In inherited modes configuration files it needs to load:
%(Init)=\
%   Include($(CfgDir)/Utils/aliases-server.cfg);\
%   Include($(CfgDir)/Utils/aliases-server-fbrowser-v4i.cfg);\

[Protocol]=Server

%
% In inherited modes:
%	- APP_IS_RUN macro must define $(app_run) variable (1== app is run, 0 == app does not run)
%	- it needs to define $(app_manage_mode) variable
%
[Mode]=default_presentation_init

(EnterMode)=\
	Set(popup,show,Loading...);\
	Make(var,app_run,by_value,0);\
	Make(var,open_file,by_value,);\
	Macro(APP_IS_RUN);\
	Macro(APP_MANAGE,expr 1 - $(app_run));\
	Macro(APP_CHOOSE_FILE,echo $(app_run));\
	Set(popup,hide);

APP_CHOOSE_FILE=\
	Make(mode,simple_file_manager);

APP_MANAGE=\
	Make(mode,$(app_manage_mode));

[ModeEnd]

% Variable $(open_file) should be defined in simple_file_manager mode

[Mode]=default_presentation

(EnterMode)=\
	Macro(SETUP_DEFAULT_POWER_MANAGEMENT);\
	Macro(APP_SETUP);\
	Macro(APP_START_IF);\
	Macro(APP_RAISE);\
	Macro(SETUP_DEFAULT_PRESENTATION);\
	Macro(APP_MENU);

SETUP_DEFAULT_PRESENTATION=\
	Set(layout,default);\
 	Set(icons,$(app_name),\
		1,folder,\
        2,plus,\
        3,play,\
		4,rewind,\
        5,fullscreen,\
        6,forward,\
		7,prev,\
        8,minus,\
        9,next,\
		*,question,\
        0,refresh,\
        #,no);\
 	Set(hints,\
		1,fila manager,\
        2,zoom in,\
        3,slideshow,\
		4,previous page,\
        5,fullscreen,\
        6,next page,\
		7,first page,\
        8,zoom out,\
        9,last page,\
		*,help (press twice),\
        0,refresh,\
        #,no);\
	Set(status,$(app_name));\
	Set(title,$(open_file));

% Default menu
APP_MENU=\
	Set(menu,replace,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

Back=Set(text,close);\
	Macro(APP_MENU);
	
Back($$)=Set(list,close);\
	Macro(APP_MENU);

1=Macro(PRES_FILE_BROWSER)
2=Macro(PRES_ZOOM_IN)
3=Macro(PRES_START)

4=Macro(PRES_PREV_PAGE);
5=Macro(PRES_TOGGLE_FULLSCREEN);
6=Macro(PRES_NEXT_PAGE);

7=Macro(PRES_FIRST_PAGE)
8=Macro(PRES_ZOOM_OUT)
9=Macro(PRES_LAST_PAGE)

* *=Set(text,replace,Help,1 File Browser\n2 Zoom In\n3 Start Presentation\n4 Previous Page\n5 Fullscreen\n6 Next Page\n7 First Page\n8 Zoom Out\n9 Last Page\n ** Help\n0 Refresh\n# Quit $(app_name)\n);
0=Macro(PRES_REFRESH)
#=Macro(APP_QUIT);\
	Make(mode,simple_file_manager);

% Android support
VOL-=Macro(PRES_PREV_PAGE);
VOL+=Macro(PRES_NEXT_PAGE);
SlideLeft =Macro(NEXT);
SlideRight=Macro(PREV);

% Rarely used
Cancel=\
    Macro(APP_QUIT);\
    Make(exit);

PRES_FILE_BROWSER=\
	Macro(APP_QUIT);\
	Make(mode,simple_file_manager);

[ModeEnd]

[End]
