X11workbench Toolkit  1.0
resource_edit.c
1 // //
3 // _ _ _ //
4 // _ __ ___ ___ ___ _ _ _ __ ___ ___ ___ __| |(_)| |_ ___ //
5 // | '__|/ _ \/ __| / _ \ | | | || '__|/ __|/ _ \ / _ \ / _` || || __| / __| //
6 // | | | __/\__ \| (_) || |_| || | | (__| __/ | __/| (_| || || |_ _| (__ //
7 // |_| \___||___/ \___/ \__,_||_| \___|\___|_____\___| \__,_||_| \__|(_)\___| //
8 // |_____| //
9 // //
11 
12 /*****************************************************************************
13 
14  X11workbench - X11 programmer's 'work bench' application and toolkit
15  Copyright (c) 2010-2019 by Bob Frazier (aka 'Big Bad Bombastic Bob')
16  all rights reserved
17 
18  DISCLAIMER: The X11workbench application and toolkit software are supplied
19  'as-is', with no warranties, either implied or explicit.
20 
21  BSD-like license:
22 
23  There is no restriction as to what you can do with this software, so long
24  as you include the above copyright notice and DISCLAIMER for any distributed
25  work that is linked with, equivalent to, or derived from any portion of this
26  software, along with this paragraph that explains the terms of the license if
27  the source is also being made available. "Linked with" includes the use of a
28  portion of any of the source and/or header files, or their compiled binary
29  output, as a part of your application or library. A "derived work"
30  describes a work that uses a significant portion of the source files or the
31  algorithms that are included with this software.
32 
33  EXCLUSIONS
34 
35  Specifically excluded from this requirement are files that were generated by
36  the software, or anything that is included with the software that is part of
37  another package (such as files that were created or added during the
38  'configure' process).
39 
40  DISTRIBUTION
41 
42  The license also covers the use of part or all of any of the X11 workbench
43  toolkit source or header files in your distributed application, in source or
44  binary form. If you do not ship the source, the above copyright statement
45  and DISCLAIMER is still required to be placed in a reasonably prominent
46  place, such as documentation, splash screens, and/or 'about the application'
47  dialog boxes.
48 
49  Use and distribution are in accordance with GPL, LGPL, and/or the above
50  BSD-like license. See COPYING and README.md files for more information.
51 
52  Additionally, this software, in source or binary form, and in whole or in
53  part, may be used by explicit permission from the author, without the need
54  of a license.
55 
56  Additional information at http://sourceforge.net/projects/X11workbench
57  and http://bombasticbob.github.io/X11workbench/
58 
59 ******************************************************************************/
60 
61 #include <stdio.h>
62 #include <stdlib.h>
63 #include <stdarg.h>
64 #include <unistd.h>
65 #include <memory.h>
66 #include <string.h>
67 #include <strings.h>
68 #include <signal.h>
69 #include <time.h>
70 #include <errno.h>
71 #include <fcntl.h>
72 #include <sys/stat.h>
73 
74 // project includes
75 #include "X11workbench.h"
76 #include "resource_edit.h"
77 
78 
79 // Define resources as entries within the code marked by defined constants
80 //
81 // example - menu resource
82 //
83 // #define BEGIN_MENU_RESOURCE(X) static const char X##__menurc[] =
84 // #define END_MENU_RESOURCE(X) ;
85 //
86 // ...
87 //
88 // BEGIN_MENU_RESOURCE(main_menu)
89 // "1\n"
90 // "_File\tpopup\t2\n"
91 // "_Edit\tpopup\t4\n"
92 // "_Tools\tpopup\t5\n"
93 // "\tseparator\n"
94 // "_Window\tpopup\t6\n"
95 // "\tseparator\n"
96 // "_Help\tpopup\t3\n"
97 // "\n"
98 //
99 // ...
100 //
101 // END_MENU_RESOURCE(main_menu)
102 //
103 //
104 // The code in THIS file could then search through the program for such definitions,
105 // and edit them 'in-place'. There would be a set of definitions "someplace" in the
106 // toolkit that would define menu resources, dialog resources, toolbar resources, and
107 // possibly pixmap and icon resources.
108 //
109 // as a side benefit, the editor could add macros at the ends of the 'BEGIN_xxx_RESOURCE'
110 // lines that indicates it was edited with the resource editor.
111 
112 
113