%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Key aliases for default picture 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_pixviewer_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_pixviewer

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

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

% 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(PIX_FILE_BROWSER)
2=Macro(PIX_ZOOM_IN)
3=Macro(PIX_ROTATE)

4=Macro(PIX_PREV);
5=Macro(PIX_FIT);
6=Macro(PIX_NEXT);

7=Macro(PIX_FIRST)
8=Macro(PIX_ZOOM_OUT)
9=Macro(PIX_LAST)

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

% Android support
VOL-=Macro(PIX_PREV);
VOL+=Macro(PIX_NEXT);
SlideLeft =Macro(PIX_NEXT);
SlideRight=Macro(PIX_PREV);
SlideDown =Macro(PIX_ZOOM_OUT);
SlideUp   =Macro(PIX_ZOOM_IN);

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

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

[ModeEnd]

[End]
