xref: /haiku/src/apps/stylededit/Constants.h (revision 17889a8c70dbb3d59c1412f6431968753c767bab)
1 /*
2  * Copyright 2002-2020, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Mattias Sundblad
7  *		Andrew Bachmann
8  *		Pascal R. G. Abresch
9  */
10 #ifndef CONSTANTS_H
11 #define CONSTANTS_H
12 
13 
14 #include <GraphicsDefs.h>
15 #include <SupportDefs.h>
16 
17 
18 #define APP_SIGNATURE  "application/x-vnd.Haiku-StyledEdit"
19 
20 const float TEXT_INSET = 3.0;
21 
22 // Messages for menu commands
23 
24 // file menu
25 const uint32 MENU_NEW					= 'MFnw';
26 const uint32 MENU_OPEN					= 'MFop';
27 const uint32 MENU_SAVE					= 'MSav';
28 const uint32 MENU_SAVEAS				= 'MEsa';
29 const uint32 MENU_RELOAD				= 'MFrl';
30 const uint32 MENU_CLOSE					= 'MFcl';
31 const uint32 MENU_PAGESETUP				= 'MFps';
32 const uint32 MENU_PRINT					= 'MFpr';
33 const uint32 MENU_QUIT					= 'MFqu';
34 
35 // edit menu
36 const uint32 MENU_CLEAR					= 'MEcl';
37 const uint32 MENU_FIND					= 'MEfi';
38 const uint32 MENU_FIND_AGAIN			= 'MEfa';
39 const uint32 MENU_FIND_SELECTION		= 'MEfs';
40 const uint32 MENU_REPLACE				= 'MEre';
41 const uint32 MENU_REPLACE_SAME			= 'MErs';
42 
43 const uint32 MSG_SEARCH					= 'msea';
44 const uint32 MSG_REPLACE				= 'msre';
45 const uint32 MSG_REPLACE_ALL			= 'mrea';
46 const uint32 MSG_HIDE_WINDOW			= 'mhdw';
47 const uint32 MSG_FIND_WINDOW_QUIT		= 'mfwq';
48 const uint32 MSG_REPLACE_WINDOW_QUIT	= 'mrwq';
49 
50 // "Font"-menu
51 const uint32 FONT_SIZE					= 'FMsi';
52 const uint32 FONT_FAMILY				= 'FFch';
53 const uint32 FONT_STYLE					= 'FSch';
54 const uint32 FONT_COLOR					= 'Fcol';
55 const uint32 kMsgSetItalic				= 'Fita';
56 const uint32 kMsgSetBold				= 'Fbld';
57 const uint32 kMsgSetUnderline			= 'Fuln';
58 const uint32 kMsgSetFontDown			= 'Fsdw';
59 const uint32 kMsgSetFontUp				= 'Fsup';
60 
61 const rgb_color palette[] = {
62 	{ 220, 0, 0, 255 },		// red
63 	{ 220, 73, 0, 255 },	// orange
64 	{ 220, 220, 0, 255 },	// yellow
65 	{ 59, 177, 0, 255 },	// green
66 	{ 60, 22, 0, 255 },		// brown
67 	{ 36, 71, 106, 255 },	// blue
68 	{ 0, 123, 186, 255 },	// cyan
69 	{ 0, 106, 115, 255 },	// teal
70 	{ 53, 53, 53, 255 },	// charcoal
71 	{ 137, 0, 72, 255 },	// magenta
72 	{ 0, 0, 0, 255 },		//black
73 	{ 255, 255, 255, 255 }	// white
74 };
75 
76 // "Document"-menu
77 const uint32 ALIGN_LEFT					= 'ALle';
78 const uint32 ALIGN_CENTER				= 'ALce';
79 const uint32 ALIGN_RIGHT				= 'ALri';
80 const uint32 WRAP_LINES					= 'MDwr';
81 const uint32 SHOW_STATISTICS			= 'MDss';
82 
83 // enables "edit" menuitems
84 const uint32 ENABLE_ITEMS				= 'ENit';
85 const uint32 DISABLE_ITEMS				= 'DIit';
86 const uint32 CHANGE_WINDOW				= 'CHwi';
87 const uint32 TEXT_CHANGED				= 'TEch';
88 
89 // file panel constants
90 const uint32 OPEN_AS_ENCODING			= 'FPoe';
91 const uint32 SAVE_AS_ENCODING			= 'FPse';
92 const uint32 SAVE_THEN_QUIT				= 'FPsq';
93 
94 // Update StatusView
95 const uint32 UPDATE_STATUS				= 'UPSt';
96 const uint32 UPDATE_STATUS_REF			= 'UPSr';
97 const uint32 UNLOCK_FILE				= 'UNLk';
98 const uint32 UPDATE_LINE_SELECTION		= 'UPls';
99 
100 // fontSize constant
101 const int32 fontSizes[] = {9, 10, 11, 12, 14, 18, 24, 36, 48, 72};
102 
103 #endif	// CONSTANTS_H
104 
105