1 /* Copyright Krzysztof Kowalczyk 2006-2007
3 #ifndef DISPLAY_STATE_H_
4 #define DISPLAY_STATE_H_
11 DM_SINGLE_PAGE
= DM_FIRST
,
15 DM_LAST
= DM_CONTINUOUS_FACING
18 #define ZOOM_FIT_PAGE -1
19 #define ZOOM_FIT_WIDTH -2
20 #define ZOOM_MAX 6401.0 /* max zoom in % */
21 #define ZOOM_MIN 8.0 /* min zoom in % */
23 #define DM_SINGLE_PAGE_STR "single page"
24 #define DM_FACING_STR "facing"
25 #define DM_CONTINUOUS_STR "continuous"
26 #define DM_CONTINUOUS_FACING_STR "continuous facing"
28 #define FILE_HISTORY_STR "File History"
30 #define FILE_STR "File"
31 #define DISPLAY_MODE_STR "Display Mode"
32 #define VISIBLE_STR "Visible"
33 #define PAGE_NO_STR "Page"
34 #define ZOOM_VIRTUAL_STR "ZoomVirtual"
35 #define ROTATION_STR "Rotation"
36 #define FULLSCREEN_STR "Fullscreen"
37 #define SCROLL_X_STR "Scroll X"
38 #define SCROLL_Y_STR "Scroll Y"
39 #define WINDOW_X_STR "Window X"
40 #define WINDOW_Y_STR "Window Y"
41 #define WINDOW_DX_STR "Window DX"
42 #define WINDOW_DY_STR "Window DY"
43 #define SHOW_TOOLBAR_STR "ShowToolbar"
44 #define USE_FITZ_STR "UseFitz"
45 #define PDF_ASSOCIATE_DONT_ASK_STR "PdfAssociateDontAskAgain"
46 #define PDF_ASSOCIATE_ASSOCIATE_STR "PdfAssociateShouldAssociate"
47 #define UI_LANGUAGE_STR "UILanguage"
49 typedef struct DisplayState
{
50 const char * filePath
;
51 enum DisplayMode displayMode
;
52 BOOL visible
; /* if TRUE, currently shown on the screen */
65 void normalizeRotation(int *rotation
);
66 BOOL
validRotation(int rotation
);
67 BOOL
ValidZoomVirtual(double zoomVirtual
);
69 const char * DisplayModeNameFromEnum(DisplayMode var
);
70 BOOL
DisplayModeEnumFromName(const char *txt
, DisplayMode
*resOut
);
72 void DisplayState_Init(DisplayState
*ds
);
73 void DisplayState_Free(DisplayState
*ds
);
74 BOOL
DisplayState_Serialize(DisplayState
*ds
, DString
*strOut
);