File: customize.html

package info (click to toggle)
glimmer 1.1.12-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,864 kB
  • ctags: 2,900
  • sloc: ansic: 31,674; sh: 6,687; python: 646; makefile: 510; sed: 93
file content (352 lines) | stat: -rw-r--r-- 10,348 bytes parent folder | download | duplicates (2)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<html>
<head>
<title>Glimmer Customization Information</title>
</head>
<body>
<h1>Glimmer</h1> - <h3>Customization Information</h3>

<p>
Glimmer is one of the most customizable applications in the entire GNOME collection. The reason for this is it's use of Python or Guile as a scripting language. This file is here to help you customize Glimmer to fit your specific needs.
</p>

<br>
<ul>
<li><a href=#langs>Language Definitions</a></li>
<li><a href=#colors>Color Classes</a></li>
<li><a href=#fonts>Font Classes</a></li>
<li><a href=#python>Python Language Bindings</a></li>
</ul>
<br><br>

<a name=langs>
<h3>Language Definition Information</h3>
<pre>
Glimmer uses the gnome-xml (libxml) parser to parse its language definitions, so all standard xml rules apply.
A line may be commented out by placing a '#' in the first column
The definition starts with the &lt;glimmer-definition&gt; tag and ends with &lt;/glimmer-definition&gt; tag.
Glimmer uses the GNU regex library.
</pre>

<h4>[Section 1: General Settings]</h4>

<pre>
&lt;settings&gt;
&nbsp;&lt;language&gt;C++&lt;/language&gt;
&nbsp;&lt;compiler&gt;g++ -g %2 -o %3 2&gt;&amp;1&lt;/compiler&gt;
&nbsp;&lt;debugger&gt;%term% -e gdb %3&lt;/debugger&gt;
&nbsp;&lt;execution&gt;./%3&lt;/execution&gt;
&nbsp;&lt;auto-indent&gt;1&lt;/auto-indent&gt;
&nbsp;&lt;use-spaces&gt;0&lt;/use-spaces&gt;
&nbsp;&lt;tab-stop&gt;4&lt;/tab-stop&gt;
&lt;/settings&gt;

Constants for compiler, debugger and execution:
%term% = the default terminal command, as set in the general preferences.<br>
%make% = the default make command, as set in the general preferences.<br>
%1 = Path to the current file, as set in the directory entry, or if the directory entry is empty, it will be the path to the current file.<br>
%2 = The name of the file without path, but with extension. (if it has one)<br>
%3 = The name of the file without path or extension.<br> 
</pre>

<h4>[Section 2: Supported Mime Types and Extensions]</h4>
<pre>
&lt;mime-types&gt;
&nbsp;&lt;extension&gt;cpp&lt;/extension&gt;
&nbsp;&lt;extension&gt;cxx&lt;/extension&gt;
&nbsp;&lt;mime-type&gt;text/x-cpp&lt;/mime-type&gt;
&lt;/mime-types&gt;

This is simply a list of supported extensions and mime types.
</pre>

<h4>[Section 3: Highlighting between 2 regex's]</h4>

<pre>
&lt;syntax-items&gt;
 &lt;syntax-item&gt;
  &lt;name&gt;string&lt;/name&gt;
  &lt;start-regex&gt;&amp;quot;&lt;/start-regex&gt;
  &lt;end-regex&gt;&amp;quot;&lt;/end-regex&gt;
  &lt;style&gt;string&lt/style&gt;
 &lt/syntax-item&gt;
&lt/syntax-items&gt;
</pre>

<h4>[Section 4: Highlighting words and characters]</h4>

<pre>
&lt;pattern-items&gt;
 &lt;pattern-item&gt;
  &lt;name&gt;label&lt;/name&gt;
  &lt;regex&gt;^[a-zA-Z_]*\:&lt;/regex&gt;
  &lt;style&gt;function&lt/style&gt;
 &lt/pattern-item&gt;
&lt/pattern-items&gt;
</pre>

<h4>[Section 5: Highlighting words and characters between 2 specified regex's]</h4>

<pre>
&lt;embedded-items&gt;
 &lt;embedded-item&gt;
  &lt;name&gt;keywords&lt;/name&gt;
  &lt;start-regex&gt;&amp;lt;&lt;/start-regex&gt;
  &lt;end-regex&gt;&amp;gt;&lt;/end-regex&gt;
  &lt;regex&gt;\b\(bgcolor\|size\|target\|href\)\b&lt;/regex&gt;
  &lt;style&gt;keyword&lt/style&gt;
 &lt/embedded-item&gt;
&lt/embedded-items&gt;
</pre>
<br><br>

<a name=colors>
<h4>[Section 6: Color classes]</h4>

<ul>
<li>string</li>
<li>char</li>
<li>char_string</li>
<li>keyword</li>
<li>comment</li>
<li>preprocessor</li>
<li>data_type</li>
<li>function</li>
<li>macro</li>
<li>variable</li>
<li>symbol</li>
<li>operator</li>
<li>punctuation</li>
<li>decimal</li>
<li>hexidecimal</li>
<li>octal</li>
<li>white</li>
<li>black</li>
<li>gray</li>
<li>blue</li>
<li>dark_blue</li>
<li>red</li>
<li>dark_red</li>
<li>green</li>
<li>dark_green</li>
<li>cyan</li>
<li>magenta</li>
<li>yellow</li>
<li>orange</li>
<li>default (this changes with the default color)</li>
</ul>
<pre>
When possible, it is a good practice to use the color classes rather than 
the explicit colors in case the user wants to change the background to something 
incompatible with a particular text color.

The last one, 'default' is special because is will change whenever the default text color changes. This is for those of you who like to make your keywords bold, but the same color as normal text.
</pre>
<br><br>

<a name=fonts>
<h4>[Section 7: Font classes]</h4>

<ul>
<li>Default = 'd'</li>
<li>Italic = 'i'</li>
<li>Bold = 'b'</li>
<li>Bold+Italic = 'bi'</li>
<li>Strikeout = 's'</li>
<li>Underline = 'u'</li>
</ul>
<pre>
You can mix and match these just about however you want (within logical reason...'d' and 'i' will still get you the default font). However, it is best to only use them with explicit colors (red, blue, etc) and let the user (which may or may not be you) choose the proper font style in the Highlight Colors dialog within Glimmer.
</pre>
<br><br>

<a name=python>
<h3>Python Binding Information</h3>
<pre>
[ Python Module : glimmer ]

[1.  Introduction]

This file documenents the macro language for Glimmer. We use PYTHON
as the macro language.

You can execute a single macro command by typing it in the 'Command' entry 
of the Glimmer toolbar. You can run macros from the Command entry,
or from the 'Scripts' menu.

When Glimmer starts, it executes the macros from the 
'~$/.Glimmer/autoexec.py' file in the user's home directory.
This is useful to customize Glimmer menu entries.


[2.  Macro commands]

int get_file_number()
int change(int file_no)
int get_files()
char *get_default_term_command();
char *get_default_make_command();
bool get_tab_stops()
int get_file_length(int file_no)
int get_file_tab_width(int file_no)
int get_file_use_spaces(int file_no)
char *get_full_filename(int file_no)
char *get_filename(int file_no)
char *get_path(int file_no)
char *get_file(int file_no)
char *get_file_compile_string(int file_no);
char *get_file_debug_string(int file_no);
char *get_file_execute_string(int file_no);
void set_file_done_compiling(int file_no);
void set_file_done_debugging(int file_no);
void set_file_done_executing(int file_no);
int has_selection()
int selection_start()
int selection_end()
void move(int relative_movement)
void move_to(int index)
int current_position(void)
int  buffer_size(void)
void insert_in(int file_no, int pos, char* text)
void insert(char* text)
void move_to_line (int index)
void move_lines (int relative_movement)
int current_line()
int line_start()
int line_end()
int freeze()
int thaw()
int line_by_pos(int pos)
void move_to_col(int index)
char* get_text(int begin,int end)
char get_current_char()
char get_next_char()
void delete_text(int start, int end)
void delete_text_in(int file_no, int start, int end)
void forward_delete (int n)
void backward_delete (int index)
void undo()
void undo_last(int file_no)
void redo()
void redo_last(int file_no)
void cut()
void cut_text(int file_no)
void copy()
void copy_text(int file_no)
void paste()
void paste_text(int file_no)
void clear()
void clear_text(int file_no)
void clear_entry()
void select_area(int from, int to)
void select_text(int file_no, int from, int to)
void select_current()
void select_all()
void select_all_text(int file_no)
void highlight_syntax(int file_no)
void new_window()
void new_file(char *filename)
void open_file(char *filename)
void close_file(int file_no)
void save_all_files()
void close_all_files()
int find(char *text)
int find_in(int file_no, char *text)
int find_regex(char *text)
int find_regex_in(int file_no, char *text)
int replace(char *search_text, char *replacer)
int replace_in(int file_no, char *search_text, char *replacer)
int replace_all(char *search_text, char *replacer)
int replace_all_in(int file_no, char *search_text, char *replacer)

[2.1 PyGtk specific fuctions]

// Add a widget to the dock of the main window
void add_dock_item(GtkWidget *w, char *name, int band_number, int placement, int band_position, int offset)

// Get a pointer to the main window
GtkObject *get_gnome_app()

// Get a pointer to GdsFile::script_box
GtkObject *get_file_box(int file_no)

// Get a pointer to GdsFile::text
GtkObject *get_text_widget(int file_no)

// Add an object to the paned area specified by pos (0 = Left, going clockwise)
// Multiple entries in a pane will appear in a GtkNotebook
void add_paned_object(GtkWidget *widget, char *name, int pos)

void remove_paned_object(char *name)

// Get a reference to this mug
GtkObject *get_paned_object(char *name)

// Provided because pygtk doesn't wrap gtk_object_[un]ref
GtkObject *ref_paned_object(char *name)
GtkObject *unref_paned_object(char *name)

[2.2 Menu Customization]

void add_item_to_menu(char *path, char *label, char* hint, char *keybinding, int position, PyObject *function)

int add_sub_to_menu(char *path, char *label, int position)

void add_widget_to_menu(char *path, GtkWidget *widget)

void add_item_to_popup_menu(char * label, int position, PyObject *function)

int add_sub_to_popup_menu(char *label, int position)

Note: The return value of the add_sub functions is a pointer index to the sub menu. You can then pass this number as the second argument of the add_item functions to add an item to a particular submenu.

[2.3 Custom Toolbar]

void add_custom_toolbar_entry(char *label, int position, char *pixmap, int type, void *callback)

int append_custom_toolbar_page(char *label)

Note: The return value of append_custom is an index that you can pass as arg2 of add_custom_toolbar_entry. Else, use -1.

[2.4 Items available *only* in language definitions]

void add_syntax_entry(char *name, char *start, char *end, char *color, char *cclass)

void add_pattern_entry(char *name, char *words, char *color, char *cclass)

void add_embedded_entry(char *name, char *outside, char *inside, char *color, char *cclass)

// Register a callback for an event
void register_signal_hook(char *signal, void *function)

Signals valid in language definitions:
  table-add
  table-remove
  table-destroy
  focus-in
  focus-out
  enter-pressed
  tab-pressed
  key-pressed (NOTE: this callback takes 6 integer arguments, unlike the other callbacks which take no arguments)
  compile
  stop-compile
  debug
  stop-debug
  execute
  stop-execute

Signals valid anywhere:
  open-file
  revert-file
  save-file
  save-as-file
  close-file
  change-file
  move-left
  move-right
</pre>
<br><br>

<hr width=100%>
Glimmer is Copyright 1999-2001 by Chris Phelps<br>
</body>
</html>