-
Notifications
You must be signed in to change notification settings - Fork 0
/
X11workbench.h
147 lines (111 loc) · 6.44 KB
/
X11workbench.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//////////////////////////////////////////////////////////////////////////////////////////
// __ __ _ _ _ _ _ _ //
// \ \/ // |/ |__ __ ___ _ __ | | __| |__ ___ _ __ ___ | |__ | |__ //
// \ / | || |\ \ /\ / // _ \ | '__|| |/ /| '_ \ / _ \| '_ \ / __|| '_ \ | '_ \ //
// / \ | || | \ V V /| (_) || | | < | |_) || __/| | | || (__ | | | | _ | | | | //
// /_/\_\|_||_| \_/\_/ \___/ |_| |_|\_\|_.__/ \___||_| |_| \___||_| |_|(_)|_| |_| //
// //
// 'main' source for X11workbench //
// //
//////////////////////////////////////////////////////////////////////////////////////////
/*****************************************************************************
X11workbench - X11 programmer's 'work bench' application and toolkit
Copyright (c) 2010-2019 by Bob Frazier (aka 'Big Bad Bombastic Bob')
all rights reserved
DISCLAIMER: The X11workbench application and toolkit software are supplied
'as-is', with no warranties, either implied or explicit.
BSD-like license:
There is no restriction as to what you can do with this software, so long
as you include the above copyright notice and DISCLAIMER for any distributed
work that is linked with, equivalent to, or derived from any portion of this
software, along with this paragraph that explains the terms of the license if
the source is also being made available. "Linked with" includes the use of a
portion of any of the source and/or header files, or their compiled binary
output, as a part of your application or library. A "derived work"
describes a work that uses a significant portion of the source files or the
algorithms that are included with this software.
EXCLUSIONS
Specifically excluded from this requirement are files that were generated by
the software, or anything that is included with the software that is part of
another package (such as files that were created or added during the
'configure' process).
DISTRIBUTION
The license also covers the use of part or all of any of the X11 workbench
toolkit source or header files in your distributed application, in source or
binary form. If you do not ship the source, the above copyright statement
and DISCLAIMER is still required to be placed in a reasonably prominent
place, such as documentation, splash screens, and/or 'about the application'
dialog boxes.
Use and distribution are in accordance with GPL, LGPL, and/or the above
BSD-like license. See COPYING and README.md files for more information.
Additionally, this software, in source or binary form, and in whole or in
part, may be used by explicit permission from the author, without the need
of a license.
Additional information at http://sourceforge.net/projects/X11workbench
and http://bombasticbob.github.io/X11workbench/
******************************************************************************/
#ifndef _X11WORKBENCH_H_INCLUDED_
#define _X11WORKBENCH_H_INCLUDED_
// common includes (this also includes 'X' headers)
#include "window_helper.h"
#include "frame_window.h"
#include "child_frame.h"
#define APP_NAME "X11workbench" /* for dialog boxes and similar things */
typedef enum __WBFILE_TYPE__
{
WBFILE_TYPE_NONE = 0,
WBFILE_TYPE_TEXT = 1,
WBFILE_TYPE_CPROG = 2,
WBFILE_TYPE_CPP = 3,
WBFILE_TYPE_CHEADER = 4,
WBFILE_TYPE_MAKEFILE = 5,
WBFILE_TYPE_AUTOCONF = 6,
WBFILE_TYPE_PROJECT = 7,
WBFILE_TYPE_RESOURCE = 8,
WBFILE_TYPE_PIXMAP = 9,
WBFILE_TYPE_DIALOG = 10,
WBFILE_TYPE_MENU = 11,
WBFILE_TYPE_TOOLBAR = 12,
WBFILE_TYPE_SHELL = 13,
WBFILE_TYPE_PYTHON = 14,
WBFILE_TYPE_PERL = 15,
WBFILE_TYPE_ASM = 16,
WBFILE_TYPE_HTML = 17,
WBFILE_TYPE_XML = 18,
WBFILE_TYPE_JAVA = 19,
WBFILE_TYPE_JS = 20,
WBFILE_TYPE_PHP = 21,
WBFILE_TYPE_ARDUINO = 22, // PDE or INO file for Arduino script
WBFILE_TYPE_CONF = 23, // '.conf' config files - special case, INI style formatting
WBFILE_TYPE_JSON = 24, // JSON formatted data files
WBFILE_TYPE_LAST = 24 // update this if I add more types
} WBFILE_TYPE;
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// _____ _ _ _ _ ____ ___ //
// | ____|__ __| |_ ___ _ __ _ __ __ _ | | ___ __ _ _ __ __| | / \ | _ \|_ _| ___ //
// | _| \ \/ /| __|/ _ \| '__|| '_ \ / _` || |/ __| / _` || '_ \ / _` | / _ \ | |_) || | / __| //
// | |___ > < | |_| __/| | | | | || (_| || |\__ \ | (_| || | | || (_| | / ___ \ | __/ | | \__ \ //
// |_____|/_/\_\ \__|\___||_| |_| |_| \__,_||_||___/ \__,_||_| |_| \__,_| /_/ \_\|_| |___||___/ //
// //
// //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// external types (prototype definitions for functions)
typedef struct tagWB_FRAME_WINDOW WBFrameWindow; // see frame_window.h [TODO: remove the need for this line of code]
// global variables and access to global vars/params
extern int nCPU; // number of CPUs detected
WBFrameWindow *GetFrameWindow();
Display *GetX11Display();
Window GetFrameWindowID(); // get the frame window's window ID (for dialog boxen and such)
const char * GetKnownFileTypes();
// general purpose utilities to be called by external things
int DoFileOpen(WBFrameWindow *pMainFrame, const char *szFileName);
WBFILE_TYPE GetFileType(const char *szFileName);
const char *GetFileTypeDesc(WBFILE_TYPE nFileType);
int GetDefaultTabSetting(WBFILE_TYPE nFileType);
int GetDefaultLineEnding(WBFILE_TYPE nFileType);
const char *GetFileTypeHighlightInfo(WBFILE_TYPE nFileType);
int ApplicationPreferences(XClientMessageEvent *pEvent);
int DoFileSave(WBChildFrame *pCF);
int DoFileSaveAs(WBChildFrame *pCF, const char *szFileName);
#endif // _X11WORKBENCH_H_INCLUDED_