~ubuntu-branches/ubuntu/precise/latexila/precise

« back to all changes in this revision

Viewing changes to src/symbols.c

  • Committer: Bazaar Package Importer
  • Author(s): Tanguy Ortolo
  • Date: 2010-04-26 22:13:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100426221300-6pa79a1yk5tino7y
Tags: upstream-0.2.0
ImportĀ upstreamĀ versionĀ 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of LaTeXila.
 
3
 *
 
4
 * Copyright Ā© 2009, 2010 SĆ©bastien Wilmet
 
5
 *
 
6
 * LaTeXila is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation, either version 3 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * LaTeXila is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#include <gtk/gtk.h>
 
21
 
 
22
#include "main.h"
 
23
#include "config.h"
 
24
#include "callbacks.h"
 
25
#include "print.h"
 
26
#include "symbols.h"
 
27
 
 
28
static GtkListStore * get_symbol_store (const struct symbol symbols[]);
 
29
static void cb_category_symbols_selected (GtkIconView *icon_view,
 
30
                gpointer user_data);
 
31
static void cb_symbol_selected (GtkIconView *icon_view, gpointer user_data);
 
32
 
 
33
static struct {
 
34
        gchar *name;
 
35
        gchar *icon;
 
36
} categories[] = {
 
37
        {N_("Greek"), DATA_DIR "/images/icons/symbol_greek.png"},
 
38
        // when we drink too much tequila we walk like this arrow...
 
39
        {N_("Arrows"), DATA_DIR "/images/icons/symbol_arrows.png"},
 
40
        {N_("Relations"), DATA_DIR "/images/icons/symbol_relations.png"},
 
41
        {N_("Operators"), DATA_DIR "/images/icons/symbol_operators.png"},
 
42
        {N_("Delimiters"), DATA_DIR "/images/icons/symbol_delimiters.png"},
 
43
        {N_("Misc math"), DATA_DIR "/images/icons/symbol_misc_math.png"},
 
44
        {N_("Misc text"), DATA_DIR "/images/icons/symbol_misc_text.png"}
 
45
};
 
46
 
 
47
static struct symbol symbols_greek[] = {
 
48
        {DATA_DIR "/images/greek/01.png", "\\alpha", NULL},
 
49
        {DATA_DIR "/images/greek/02.png", "\\beta", NULL},
 
50
        {DATA_DIR "/images/greek/03.png", "\\gamma", NULL},
 
51
        {DATA_DIR "/images/greek/04.png", "\\delta", NULL},
 
52
        {DATA_DIR "/images/greek/05.png", "\\epsilon", NULL},
 
53
        {DATA_DIR "/images/greek/06.png", "\\varepsilon", NULL},
 
54
        {DATA_DIR "/images/greek/07.png", "\\zeta", NULL},
 
55
        {DATA_DIR "/images/greek/08.png", "\\eta", NULL},
 
56
        {DATA_DIR "/images/greek/09.png", "\\theta", NULL},
 
57
        {DATA_DIR "/images/greek/10.png", "\\vartheta", NULL},
 
58
        {DATA_DIR "/images/greek/11.png", "\\iota", NULL},
 
59
        {DATA_DIR "/images/greek/12.png", "\\kappa", NULL},
 
60
        {DATA_DIR "/images/greek/13.png", "\\lambda", NULL},
 
61
        {DATA_DIR "/images/greek/14.png", "\\mu", NULL},
 
62
        {DATA_DIR "/images/greek/15.png", "\\nu", NULL},
 
63
        {DATA_DIR "/images/greek/16.png", "\\xi", NULL},
 
64
        {DATA_DIR "/images/greek/17.png", "o", NULL},
 
65
        {DATA_DIR "/images/greek/18.png", "\\pi", NULL},
 
66
        {DATA_DIR "/images/greek/19.png", "\\varpi", NULL},
 
67
        {DATA_DIR "/images/greek/20.png", "\\rho", NULL},
 
68
        {DATA_DIR "/images/greek/21.png", "\\varrho", NULL},
 
69
        {DATA_DIR "/images/greek/22.png", "\\sigma", NULL},
 
70
        {DATA_DIR "/images/greek/23.png", "\\varsigma", NULL},
 
71
        {DATA_DIR "/images/greek/24.png", "\\tau", NULL},
 
72
        {DATA_DIR "/images/greek/25.png", "\\upsilon", NULL},
 
73
        {DATA_DIR "/images/greek/26.png", "\\phi", NULL},
 
74
        {DATA_DIR "/images/greek/27.png", "\\varphi", NULL},
 
75
        {DATA_DIR "/images/greek/28.png", "\\chi", NULL},
 
76
        {DATA_DIR "/images/greek/29.png", "\\psi", NULL},
 
77
        {DATA_DIR "/images/greek/30.png", "\\omega", NULL},
 
78
        {DATA_DIR "/images/greek/31.png", "A", NULL},
 
79
        {DATA_DIR "/images/greek/32.png", "B", NULL},
 
80
        {DATA_DIR "/images/greek/33.png", "\\Gamma", NULL},
 
81
        {DATA_DIR "/images/greek/34.png", "\\varGamma", "amsmath"},
 
82
        {DATA_DIR "/images/greek/35.png", "\\Delta", NULL},
 
83
        {DATA_DIR "/images/greek/36.png", "\\varDelta", "amsmath"},
 
84
        {DATA_DIR "/images/greek/37.png", "E", NULL},
 
85
        {DATA_DIR "/images/greek/38.png", "Z", NULL},
 
86
        {DATA_DIR "/images/greek/39.png", "H", NULL},
 
87
        {DATA_DIR "/images/greek/40.png", "\\Theta", NULL},
 
88
        {DATA_DIR "/images/greek/41.png", "\\varTheta", "amsmath"},
 
89
        {DATA_DIR "/images/greek/42.png", "I", NULL},
 
90
        {DATA_DIR "/images/greek/43.png", "K", NULL},
 
91
        {DATA_DIR "/images/greek/44.png", "\\Lambda", NULL},
 
92
        {DATA_DIR "/images/greek/45.png", "\\varLambda", "amsmath"},
 
93
        {DATA_DIR "/images/greek/46.png", "M", NULL},
 
94
        {DATA_DIR "/images/greek/47.png", "N", NULL},
 
95
        {DATA_DIR "/images/greek/48.png", "\\Xi", NULL},
 
96
        {DATA_DIR "/images/greek/49.png", "\\varXi", "amsmath"},
 
97
        {DATA_DIR "/images/greek/50.png", "O", NULL},
 
98
        {DATA_DIR "/images/greek/51.png", "\\Pi", NULL},
 
99
        {DATA_DIR "/images/greek/52.png", "\\varPi", "amsmath"},
 
100
        {DATA_DIR "/images/greek/53.png", "P", NULL},
 
101
        {DATA_DIR "/images/greek/54.png", "\\Sigma", NULL},
 
102
        {DATA_DIR "/images/greek/55.png", "\\varSigma", "amsmath"},
 
103
        {DATA_DIR "/images/greek/56.png", "T", NULL},
 
104
        {DATA_DIR "/images/greek/57.png", "\\Upsilon", NULL},
 
105
        {DATA_DIR "/images/greek/58.png", "\\varUpsilon", "amsmath"},
 
106
        {DATA_DIR "/images/greek/59.png", "\\Phi", NULL},
 
107
        {DATA_DIR "/images/greek/60.png", "\\varPhi", "amsmath"},
 
108
        {DATA_DIR "/images/greek/61.png", "X", NULL},
 
109
        {DATA_DIR "/images/greek/62.png", "\\Psi", NULL},
 
110
        {DATA_DIR "/images/greek/63.png", "\\varPsi", "amsmath"},
 
111
        {DATA_DIR "/images/greek/64.png", "\\Omega", NULL},
 
112
        {DATA_DIR "/images/greek/65.png", "\\varOmega", "amsmath"},
 
113
        {NULL, NULL, NULL}
 
114
};
 
115
 
 
116
static struct symbol symbols_arrows[] = {
 
117
        {DATA_DIR "/images/arrows/01.png", "\\leftarrow", NULL},
 
118
        {DATA_DIR "/images/arrows/02.png", "\\leftrightarrow", NULL},
 
119
        {DATA_DIR "/images/arrows/03.png", "\\rightarrow", NULL},
 
120
        {DATA_DIR "/images/arrows/04.png", "\\mapsto", NULL},
 
121
        {DATA_DIR "/images/arrows/05.png", "\\longleftarrow", NULL},
 
122
        {DATA_DIR "/images/arrows/06.png", "\\longleftrightarrow", NULL},
 
123
        {DATA_DIR "/images/arrows/07.png", "\\longrightarrow", NULL},
 
124
        {DATA_DIR "/images/arrows/08.png", "\\longmapsto", NULL},
 
125
        {DATA_DIR "/images/arrows/09.png", "\\downarrow", NULL},
 
126
        {DATA_DIR "/images/arrows/10.png", "\\updownarrow", NULL},
 
127
        {DATA_DIR "/images/arrows/11.png", "\\uparrow", NULL},
 
128
        {DATA_DIR "/images/arrows/12.png", "\\nwarrow", NULL},
 
129
        {DATA_DIR "/images/arrows/13.png", "\\searrow", NULL},
 
130
        {DATA_DIR "/images/arrows/14.png", "\\nearrow", NULL},
 
131
        {DATA_DIR "/images/arrows/15.png", "\\swarrow", NULL},
 
132
        {DATA_DIR "/images/arrows/16.png", "\\textdownarrow", "textcomp"},
 
133
        {DATA_DIR "/images/arrows/17.png", "\\textuparrow", "textcomp"},
 
134
        {DATA_DIR "/images/arrows/18.png", "\\textleftarrow", "textcomp"},
 
135
        {DATA_DIR "/images/arrows/19.png", "\\textrightarrow", "textcomp"},
 
136
        {DATA_DIR "/images/arrows/20.png", "\\nleftarrow", "amssymb"},
 
137
        {DATA_DIR "/images/arrows/21.png", "\\nleftrightarrow", "amssymb"},
 
138
        {DATA_DIR "/images/arrows/22.png", "\\nrightarrow", "amssymb"},
 
139
        {DATA_DIR "/images/arrows/23.png", "\\hookleftarrow", NULL},
 
140
        {DATA_DIR "/images/arrows/24.png", "\\hookrightarrow", NULL},
 
141
        {DATA_DIR "/images/arrows/25.png", "\\twoheadleftarrow", "amssymb"},
 
142
        {DATA_DIR "/images/arrows/26.png", "\\twoheadrightarrow", "amssymb"},
 
143
        {DATA_DIR "/images/arrows/27.png", "\\leftarrowtail", "amssymb"},
 
144
        {DATA_DIR "/images/arrows/28.png", "\\rightarrowtail", "amssymb"},
 
145
        {DATA_DIR "/images/arrows/29.png", "\\Leftarrow", NULL},
 
146
        {DATA_DIR "/images/arrows/30.png", "\\Leftrightarrow", NULL},
 
147
        {DATA_DIR "/images/arrows/31.png", "\\Rightarrow", NULL},
 
148
        {DATA_DIR "/images/arrows/32.png", "\\Longleftarrow", NULL},
 
149
        {DATA_DIR "/images/arrows/33.png", "\\Longleftrightarrow", NULL},
 
150
        {DATA_DIR "/images/arrows/34.png", "\\Longrightarrow", NULL},
 
151
        {DATA_DIR "/images/arrows/35.png", "\\Updownarrow", NULL},
 
152
        {DATA_DIR "/images/arrows/36.png", "\\Uparrow", NULL},
 
153
        {DATA_DIR "/images/arrows/37.png", "\\Downarrow", NULL},
 
154
        {DATA_DIR "/images/arrows/38.png", "\\nLeftarrow", "amssymb"},
 
155
        {DATA_DIR "/images/arrows/39.png", "\\nLeftrightarrow", "amssymb"},
 
156
        {DATA_DIR "/images/arrows/40.png", "\\nRightarrow", "amssymb"},
 
157
        {DATA_DIR "/images/arrows/41.png", "\\leftleftarrows", "amssymb"},
 
158
        {DATA_DIR "/images/arrows/42.png", "\\leftrightarrows", "amssymb"},
 
159
        {DATA_DIR "/images/arrows/43.png", "\\rightleftarrows", "amssymb"},
 
160
        {DATA_DIR "/images/arrows/44.png", "\\rightrightarrows", "amssymb"},
 
161
        {DATA_DIR "/images/arrows/45.png", "\\downdownarrows", "amssymb"},
 
162
        {DATA_DIR "/images/arrows/46.png", "\\upuparrows", "amssymb"},
 
163
        {DATA_DIR "/images/arrows/47.png", "\\circlearrowleft", "amssymb"},
 
164
        {DATA_DIR "/images/arrows/48.png", "\\circlearrowright", "amssymb"},
 
165
        {DATA_DIR "/images/arrows/49.png", "\\curvearrowleft", "amssymb"},
 
166
        {DATA_DIR "/images/arrows/50.png", "\\curvearrowright", "amssymb"},
 
167
        {DATA_DIR "/images/arrows/51.png", "\\Lsh", "amssymb"},
 
168
        {DATA_DIR "/images/arrows/52.png", "\\Rsh", "amssymb"},
 
169
        {DATA_DIR "/images/arrows/53.png", "\\looparrowleft", "amssymb"},
 
170
        {DATA_DIR "/images/arrows/54.png", "\\looparrowright", "amssymb"},
 
171
        {DATA_DIR "/images/arrows/55.png", "\\dashleftarrow", "amssymb"},
 
172
        {DATA_DIR "/images/arrows/56.png", "\\dashrightarrow", "amssymb"},
 
173
        {DATA_DIR "/images/arrows/57.png", "\\leftrightsquigarrow", "amssymb"},
 
174
        {DATA_DIR "/images/arrows/58.png", "\\rightsquigarrow", "amssymb"},
 
175
        {DATA_DIR "/images/arrows/59.png", "\\Lleftarrow", "amssymb"},
 
176
        {DATA_DIR "/images/arrows/60.png", "\\leftharpoondown", NULL},
 
177
        {DATA_DIR "/images/arrows/61.png", "\\rightharpoondown", NULL},
 
178
        {DATA_DIR "/images/arrows/62.png", "\\leftharpoonup", NULL},
 
179
        {DATA_DIR "/images/arrows/63.png", "\\rightharpoonup", NULL},
 
180
        {DATA_DIR "/images/arrows/64.png", "\\rightleftharpoons", NULL},
 
181
        {DATA_DIR "/images/arrows/65.png", "\\leftrightharpoons", "amssymb"},
 
182
        {DATA_DIR "/images/arrows/66.png", "\\downharpoonleft", "amssymb"},
 
183
        {DATA_DIR "/images/arrows/67.png", "\\upharpoonleft", "amssymb"},
 
184
        {DATA_DIR "/images/arrows/68.png", "\\downharpoonright", "amssymb"},
 
185
        {DATA_DIR "/images/arrows/69.png", "\\upharpoonright", "amssymb"},
 
186
        {NULL, NULL, NULL}
 
187
};
 
188
 
 
189
static struct symbol symbols_relations[] = {
 
190
        {DATA_DIR "/images/relations/001.png", "\\bowtie", NULL},
 
191
        {DATA_DIR "/images/relations/002.png", "\\Join", "amssymb"},
 
192
        {DATA_DIR "/images/relations/003.png", "\\propto", NULL},
 
193
        {DATA_DIR "/images/relations/004.png", "\\varpropto", "amssymb"},
 
194
        {DATA_DIR "/images/relations/005.png", "\\multimap", "amssymb"},
 
195
        {DATA_DIR "/images/relations/006.png", "\\pitchfork", "amssymb"},
 
196
        {DATA_DIR "/images/relations/007.png", "\\therefore", "amssymb"},
 
197
        {DATA_DIR "/images/relations/008.png", "\\because", "amssymb"},
 
198
        {DATA_DIR "/images/relations/009.png", "=", NULL},
 
199
        {DATA_DIR "/images/relations/010.png", "\\neq", NULL},
 
200
        {DATA_DIR "/images/relations/011.png", "\\equiv", NULL},
 
201
        {DATA_DIR "/images/relations/012.png", "\\approx", NULL},
 
202
        {DATA_DIR "/images/relations/013.png", "\\sim", NULL},
 
203
        {DATA_DIR "/images/relations/014.png", "\\simeq", NULL},
 
204
        {DATA_DIR "/images/relations/015.png", "\\backsimeq", "amssymb"},
 
205
        {DATA_DIR "/images/relations/016.png", "\\approxeq", "amssymb"},
 
206
        {DATA_DIR "/images/relations/017.png", "\\cong", NULL},
 
207
        {DATA_DIR "/images/relations/018.png", "\\ncong", "amssymb"},
 
208
        {DATA_DIR "/images/relations/019.png", "\\smile", NULL},
 
209
        {DATA_DIR "/images/relations/020.png", "\\frown", NULL},
 
210
        {DATA_DIR "/images/relations/021.png", "\\asymp", NULL},
 
211
        {DATA_DIR "/images/relations/022.png", "\\smallfrown", "amssymb"},
 
212
        {DATA_DIR "/images/relations/023.png", "\\smallsmile", "amssymb"},
 
213
        {DATA_DIR "/images/relations/024.png", "\\between", "amssymb"},
 
214
        {DATA_DIR "/images/relations/025.png", "\\prec", NULL},
 
215
        {DATA_DIR "/images/relations/026.png", "\\succ", NULL},
 
216
        {DATA_DIR "/images/relations/027.png", "\\nprec", "amssymb"},
 
217
        {DATA_DIR "/images/relations/028.png", "\\nsucc", "amssymb"},
 
218
        {DATA_DIR "/images/relations/029.png", "\\preceq", NULL},
 
219
        {DATA_DIR "/images/relations/030.png", "\\succeq", NULL},
 
220
        {DATA_DIR "/images/relations/031.png", "\\npreceq", "amssymb"},
 
221
        {DATA_DIR "/images/relations/032.png", "\\nsucceq", "amssymb"},
 
222
        {DATA_DIR "/images/relations/033.png", "\\preccurlyeq", "amssymb"},
 
223
        {DATA_DIR "/images/relations/034.png", "\\succcurlyeq", "amssymb"},
 
224
        {DATA_DIR "/images/relations/035.png", "\\curlyeqprec", "amssymb"},
 
225
        {DATA_DIR "/images/relations/036.png", "\\curlyeqsucc", "amssymb"},
 
226
        {DATA_DIR "/images/relations/037.png", "\\precsim", "amssymb"},
 
227
        {DATA_DIR "/images/relations/038.png", "\\succsim", "amssymb"},
 
228
        {DATA_DIR "/images/relations/039.png", "\\precnsim", "amssymb"},
 
229
        {DATA_DIR "/images/relations/040.png", "\\succnsim", "amssymb"},
 
230
        {DATA_DIR "/images/relations/041.png", "\\precapprox", "amssymb"},
 
231
        {DATA_DIR "/images/relations/042.png", "\\succapprox", "amssymb"},
 
232
        {DATA_DIR "/images/relations/043.png", "\\precnapprox", "amssymb"},
 
233
        {DATA_DIR "/images/relations/044.png", "\\succnapprox", "amssymb"},
 
234
        {DATA_DIR "/images/relations/045.png", "\\perp", NULL},
 
235
        {DATA_DIR "/images/relations/046.png", "\\vdash", NULL},
 
236
        {DATA_DIR "/images/relations/047.png", "\\dashv", NULL},
 
237
        {DATA_DIR "/images/relations/048.png", "\\nvdash", "amssymb"},
 
238
        {DATA_DIR "/images/relations/049.png", "\\Vdash", "amssymb"},
 
239
        {DATA_DIR "/images/relations/050.png", "\\Vvdash", "amssymb"},
 
240
        {DATA_DIR "/images/relations/051.png", "\\models", NULL},
 
241
        {DATA_DIR "/images/relations/052.png", "\\vDash", "amssymb"},
 
242
        {DATA_DIR "/images/relations/053.png", "\\nvDash", "amssymb"},
 
243
        {DATA_DIR "/images/relations/054.png", "\\nVDash", "amssymb"},
 
244
        {DATA_DIR "/images/relations/055.png", "\\mid", NULL},
 
245
        {DATA_DIR "/images/relations/056.png", "\\nmid", "amssymb"},
 
246
        {DATA_DIR "/images/relations/057.png", "\\parallel", NULL},
 
247
        {DATA_DIR "/images/relations/058.png", "\\nparallel", "amssymb"},
 
248
        {DATA_DIR "/images/relations/059.png", "\\shortmid", "amssymb"},
 
249
        {DATA_DIR "/images/relations/060.png", "\\nshortmid", "amssymb"},
 
250
        {DATA_DIR "/images/relations/061.png", "\\shortparallel", "amssymb"},
 
251
        {DATA_DIR "/images/relations/062.png", "\\nshortparallel", "amssymb"},
 
252
        {DATA_DIR "/images/relations/063.png", "<", NULL},
 
253
        {DATA_DIR "/images/relations/064.png", ">", NULL},
 
254
        {DATA_DIR "/images/relations/065.png", "\\nless", "amssymb"},
 
255
        {DATA_DIR "/images/relations/066.png", "\\ngtr", "amssymb"},
 
256
        {DATA_DIR "/images/relations/067.png", "\\lessdot", "amssymb"},
 
257
        {DATA_DIR "/images/relations/068.png", "\\gtrdot", "amssymb"},
 
258
        {DATA_DIR "/images/relations/069.png", "\\ll", NULL},
 
259
        {DATA_DIR "/images/relations/070.png", "\\gg", NULL},
 
260
        {DATA_DIR "/images/relations/071.png", "\\lll", "amssymb"},
 
261
        {DATA_DIR "/images/relations/072.png", "\\ggg", "amssymb"},
 
262
        {DATA_DIR "/images/relations/073.png", "\\leq", NULL},
 
263
        {DATA_DIR "/images/relations/074.png", "\\geq", NULL},
 
264
        {DATA_DIR "/images/relations/075.png", "\\lneq", "amssymb"},
 
265
        {DATA_DIR "/images/relations/076.png", "\\gneq", "amssymb"},
 
266
        {DATA_DIR "/images/relations/077.png", "\\nleq", "amssymb"},
 
267
        {DATA_DIR "/images/relations/078.png", "\\ngeq", "amssymb"},
 
268
        {DATA_DIR "/images/relations/079.png", "\\leqq", "amssymb"},
 
269
        {DATA_DIR "/images/relations/080.png", "\\geqq", "amssymb"},
 
270
        {DATA_DIR "/images/relations/081.png", "\\lneqq", "amssymb"},
 
271
        {DATA_DIR "/images/relations/082.png", "\\gneqq", "amssymb"},
 
272
        {DATA_DIR "/images/relations/083.png", "\\lvertneqq", "amssymb"},
 
273
        {DATA_DIR "/images/relations/084.png", "\\gvertneqq", "amssymb"},
 
274
        {DATA_DIR "/images/relations/085.png", "\\nleqq", "amssymb"},
 
275
        {DATA_DIR "/images/relations/086.png", "\\ngeqq", "amssymb"},
 
276
        {DATA_DIR "/images/relations/087.png", "\\leqslant", "amssymb"},
 
277
        {DATA_DIR "/images/relations/088.png", "\\geqslant", "amssymb"},
 
278
        {DATA_DIR "/images/relations/089.png", "\\nleqslant", "amssymb"},
 
279
        {DATA_DIR "/images/relations/090.png", "\\ngeqslant", "amssymb"},
 
280
        {DATA_DIR "/images/relations/091.png", "\\eqslantless", "amssymb"},
 
281
        {DATA_DIR "/images/relations/092.png", "\\eqslantgtr", "amssymb"},
 
282
        {DATA_DIR "/images/relations/093.png", "\\lessgtr", "amssymb"},
 
283
        {DATA_DIR "/images/relations/094.png", "\\gtrless", "amssymb"},
 
284
        {DATA_DIR "/images/relations/095.png", "\\lesseqgtr", "amssymb"},
 
285
        {DATA_DIR "/images/relations/096.png", "\\gtreqless", "amssymb"},
 
286
        {DATA_DIR "/images/relations/097.png", "\\lesseqqgtr", "amssymb"},
 
287
        {DATA_DIR "/images/relations/098.png", "\\gtreqqless", "amssymb"},
 
288
        {DATA_DIR "/images/relations/099.png", "\\lesssim", "amssymb"},
 
289
        {DATA_DIR "/images/relations/100.png", "\\gtrsim", "amssymb"},
 
290
        {DATA_DIR "/images/relations/101.png", "\\lnsim", "amssymb"},
 
291
        {DATA_DIR "/images/relations/102.png", "\\gnsim", "amssymb"},
 
292
        {DATA_DIR "/images/relations/103.png", "\\lessapprox", "amssymb"},
 
293
        {DATA_DIR "/images/relations/104.png", "\\gtrapprox", "amssymb"},
 
294
        {DATA_DIR "/images/relations/105.png", "\\lnapprox", "amssymb"},
 
295
        {DATA_DIR "/images/relations/106.png", "\\gnapprox", "amssymb"},
 
296
        {DATA_DIR "/images/relations/107.png", "\\vartriangleleft", "amssymb"},
 
297
        {DATA_DIR "/images/relations/108.png", "\\vartriangleright", "amssymb"},
 
298
        {DATA_DIR "/images/relations/109.png", "\\ntriangleleft", "amssymb"},
 
299
        {DATA_DIR "/images/relations/110.png", "\\ntriangleright", "amssymb"},
 
300
        {DATA_DIR "/images/relations/111.png", "\\trianglelefteq", "amssymb"},
 
301
        {DATA_DIR "/images/relations/112.png", "\\trianglerighteq", "amssymb"},
 
302
        {DATA_DIR "/images/relations/113.png", "\\ntrianglelefteq", "amssymb"},
 
303
        {DATA_DIR "/images/relations/114.png", "\\ntrianglerighteq", "amssymb"},
 
304
        {DATA_DIR "/images/relations/115.png", "\\blacktriangleleft", "amssymb"},
 
305
        {DATA_DIR "/images/relations/116.png", "\\blacktriangleright", "amssymb"},
 
306
        {DATA_DIR "/images/relations/117.png", "\\subset", NULL},
 
307
        {DATA_DIR "/images/relations/118.png", "\\supset", NULL},
 
308
        {DATA_DIR "/images/relations/119.png", "\\subseteq", NULL},
 
309
        {DATA_DIR "/images/relations/120.png", "\\supseteq", NULL},
 
310
        {DATA_DIR "/images/relations/121.png", "\\subsetneq", "amssymb"},
 
311
        {DATA_DIR "/images/relations/122.png", "\\supsetneq", "amssymb"},
 
312
        {DATA_DIR "/images/relations/123.png", "\\varsubsetneq", "amssymb"},
 
313
        {DATA_DIR "/images/relations/124.png", "\\varsupsetneq", "amssymb"},
 
314
        {DATA_DIR "/images/relations/125.png", "\\nsubseteq", "amssymb"},
 
315
        {DATA_DIR "/images/relations/126.png", "\\nsupseteq", "amssymb"},
 
316
        {DATA_DIR "/images/relations/127.png", "\\subseteqq", "amssymb"},
 
317
        {DATA_DIR "/images/relations/128.png", "\\supseteqq", "amssymb"},
 
318
        {DATA_DIR "/images/relations/129.png", "\\subsetneqq", "amssymb"},
 
319
        {DATA_DIR "/images/relations/130.png", "\\supsetneqq", "amssymb"},
 
320
        {DATA_DIR "/images/relations/131.png", "\\nsubseteqq", "amssymb"},
 
321
        {DATA_DIR "/images/relations/132.png", "\\nsupseteqq", "amssymb"},
 
322
        {DATA_DIR "/images/relations/133.png", "\\backepsilon", "amssymb"},
 
323
        {DATA_DIR "/images/relations/134.png", "\\Subset", "amssymb"},
 
324
        {DATA_DIR "/images/relations/135.png", "\\Supset", "amssymb"},
 
325
        {DATA_DIR "/images/relations/136.png", "\\sqsubset", "amssymb"},
 
326
        {DATA_DIR "/images/relations/137.png", "\\sqsupset", "amssymb"},
 
327
        {DATA_DIR "/images/relations/138.png", "\\sqsubseteq", NULL},
 
328
        {DATA_DIR "/images/relations/139.png", "\\sqsupseteq", NULL},
 
329
        {NULL, NULL, NULL}
 
330
};
 
331
 
 
332
static struct symbol symbols_operators[] = {
 
333
        {DATA_DIR "/images/operators/001.png", "\\pm", NULL},
 
334
        {DATA_DIR "/images/operators/002.png", "\\mp", NULL},
 
335
        {DATA_DIR "/images/operators/003.png", "\\times", NULL},
 
336
        {DATA_DIR "/images/operators/004.png", "\\div", NULL},
 
337
        {DATA_DIR "/images/operators/005.png", "\\ast", NULL},
 
338
        {DATA_DIR "/images/operators/006.png", "\\star", NULL},
 
339
        {DATA_DIR "/images/operators/007.png", "\\circ", NULL},
 
340
        {DATA_DIR "/images/operators/008.png", "\\bullet", NULL},
 
341
        {DATA_DIR "/images/operators/009.png", "\\divideontimes", "amssymb"},
 
342
        {DATA_DIR "/images/operators/010.png", "\\ltimes", "amssymb"},
 
343
        {DATA_DIR "/images/operators/011.png", "\\rtimes", "amssymb"},
 
344
        {DATA_DIR "/images/operators/012.png", "\\cdot", NULL},
 
345
        {DATA_DIR "/images/operators/013.png", "\\dotplus", "amssymb"},
 
346
        {DATA_DIR "/images/operators/014.png", "\\leftthreetimes", "amssymb"},
 
347
        {DATA_DIR "/images/operators/015.png", "\\rightthreetimes", "amssymb"},
 
348
        {DATA_DIR "/images/operators/016.png", "\\amalg", NULL},
 
349
        {DATA_DIR "/images/operators/017.png", "\\otimes", NULL},
 
350
        {DATA_DIR "/images/operators/018.png", "\\oplus", NULL},
 
351
        {DATA_DIR "/images/operators/019.png", "\\ominus", NULL},
 
352
        {DATA_DIR "/images/operators/020.png", "\\oslash", NULL},
 
353
        {DATA_DIR "/images/operators/021.png", "\\odot", NULL},
 
354
        {DATA_DIR "/images/operators/022.png", "\\circledcirc", "amssymb"},
 
355
        {DATA_DIR "/images/operators/023.png", "\\circleddash", "amssymb"},
 
356
        {DATA_DIR "/images/operators/024.png", "\\circledast", "amssymb"},
 
357
        {DATA_DIR "/images/operators/025.png", "\\bigcirc", NULL},
 
358
        {DATA_DIR "/images/operators/026.png", "\\boxdot", "amssymb"},
 
359
        {DATA_DIR "/images/operators/027.png", "\\boxminus", "amssymb"},
 
360
        {DATA_DIR "/images/operators/028.png", "\\boxplus", "amssymb"},
 
361
        {DATA_DIR "/images/operators/029.png", "\\boxtimes", "amssymb"},
 
362
        {DATA_DIR "/images/operators/030.png", "\\diamond", NULL},
 
363
        {DATA_DIR "/images/operators/031.png", "\\bigtriangleup", NULL},
 
364
        {DATA_DIR "/images/operators/032.png", "\\bigtriangledown", NULL},
 
365
        {DATA_DIR "/images/operators/033.png", "\\triangleleft", NULL},
 
366
        {DATA_DIR "/images/operators/034.png", "\\triangleright", NULL},
 
367
        {DATA_DIR "/images/operators/035.png", "\\lhd", "amssymb"},
 
368
        {DATA_DIR "/images/operators/036.png", "\\rhd", "amssymb"},
 
369
        {DATA_DIR "/images/operators/037.png", "\\unlhd", "amssymb"},
 
370
        {DATA_DIR "/images/operators/038.png", "\\unrhd", "amssymb"},
 
371
        {DATA_DIR "/images/operators/039.png", "\\cup", NULL},
 
372
        {DATA_DIR "/images/operators/040.png", "\\cap", NULL},
 
373
        {DATA_DIR "/images/operators/041.png", "\\uplus", NULL},
 
374
        {DATA_DIR "/images/operators/042.png", "\\Cup", "amssymb"},
 
375
        {DATA_DIR "/images/operators/043.png", "\\Cap", "amssymb"},
 
376
        {DATA_DIR "/images/operators/044.png", "\\wr", NULL},
 
377
        {DATA_DIR "/images/operators/045.png", "\\setminus", NULL},
 
378
        {DATA_DIR "/images/operators/046.png", "\\smallsetminus", "amssymb"},
 
379
        {DATA_DIR "/images/operators/047.png", "\\sqcap", NULL},
 
380
        {DATA_DIR "/images/operators/048.png", "\\sqcup", NULL},
 
381
        {DATA_DIR "/images/operators/049.png", "\\wedge", NULL},
 
382
        {DATA_DIR "/images/operators/050.png", "\\vee", NULL},
 
383
        {DATA_DIR "/images/operators/051.png", "\\barwedge", "amssymb"},
 
384
        {DATA_DIR "/images/operators/052.png", "\\veebar", "amssymb"},
 
385
        {DATA_DIR "/images/operators/053.png", "\\doublebarwedge", "amssymb"},
 
386
        {DATA_DIR "/images/operators/054.png", "\\curlywedge", "amssymb"},
 
387
        {DATA_DIR "/images/operators/055.png", "\\curlyvee", "amssymb"},
 
388
        {DATA_DIR "/images/operators/056.png", "\\dagger", "amssymb"},
 
389
        {DATA_DIR "/images/operators/057.png", "\\ddagger", "amssymb"},
 
390
        {DATA_DIR "/images/operators/058.png", "\\intercal", "amssymb"},
 
391
        {DATA_DIR "/images/operators/059.png", "\\bigcap", NULL},
 
392
        {DATA_DIR "/images/operators/060.png", "\\bigcup", NULL},
 
393
        {DATA_DIR "/images/operators/061.png", "\\biguplus", NULL},
 
394
        {DATA_DIR "/images/operators/062.png", "\\bigsqcup", NULL},
 
395
        {DATA_DIR "/images/operators/063.png", "\\prod", NULL},
 
396
        {DATA_DIR "/images/operators/064.png", "\\coprod", NULL},
 
397
        {DATA_DIR "/images/operators/065.png", "\\bigwedge", NULL},
 
398
        {DATA_DIR "/images/operators/066.png", "\\bigvee", NULL},
 
399
        {DATA_DIR "/images/operators/067.png", "\\bigodot", NULL},
 
400
        {DATA_DIR "/images/operators/068.png", "\\bigoplus", NULL},
 
401
        {DATA_DIR "/images/operators/069.png", "\\bigotimes", NULL},
 
402
        {DATA_DIR "/images/operators/070.png", "\\sum", NULL},
 
403
        {DATA_DIR "/images/operators/071.png", "\\int", NULL},
 
404
        {DATA_DIR "/images/operators/072.png", "\\oint", NULL},
 
405
        {DATA_DIR "/images/operators/073.png", "\\iint", "amsmath"},
 
406
        {DATA_DIR "/images/operators/074.png", "\\iiint", "amsmath"},
 
407
        {DATA_DIR "/images/operators/075.png", "\\iiiint", "amsmath"},
 
408
        {DATA_DIR "/images/operators/076.png", "\\idotsint", "amsmath"},
 
409
        {DATA_DIR "/images/operators/077.png", "\\arccos", NULL},
 
410
        {DATA_DIR "/images/operators/078.png", "\\arcsin", NULL},
 
411
        {DATA_DIR "/images/operators/079.png", "\\arctan", NULL},
 
412
        {DATA_DIR "/images/operators/080.png", "\\arg", NULL},
 
413
        {DATA_DIR "/images/operators/081.png", "\\cos", NULL},
 
414
        {DATA_DIR "/images/operators/082.png", "\\cosh", NULL},
 
415
        {DATA_DIR "/images/operators/083.png", "\\cot", NULL},
 
416
        {DATA_DIR "/images/operators/084.png", "\\coth", NULL},
 
417
        {DATA_DIR "/images/operators/085.png", "\\csc", NULL},
 
418
        {DATA_DIR "/images/operators/086.png", "\\deg", NULL},
 
419
        {DATA_DIR "/images/operators/087.png", "\\det", NULL},
 
420
        {DATA_DIR "/images/operators/088.png", "\\dim", NULL},
 
421
        {DATA_DIR "/images/operators/089.png", "\\exp", NULL},
 
422
        {DATA_DIR "/images/operators/090.png", "\\gcd", NULL},
 
423
        {DATA_DIR "/images/operators/091.png", "\\hom", NULL},
 
424
        {DATA_DIR "/images/operators/092.png", "\\inf", NULL},
 
425
        {DATA_DIR "/images/operators/093.png", "\\ker", NULL},
 
426
        {DATA_DIR "/images/operators/094.png", "\\lg", NULL},
 
427
        {DATA_DIR "/images/operators/095.png", "\\lim", NULL},
 
428
        {DATA_DIR "/images/operators/096.png", "\\liminf", NULL},
 
429
        {DATA_DIR "/images/operators/097.png", "\\limsup", NULL},
 
430
        {DATA_DIR "/images/operators/098.png", "\\ln", NULL},
 
431
        {DATA_DIR "/images/operators/099.png", "\\log", NULL},
 
432
        {DATA_DIR "/images/operators/100.png", "\\max", NULL},
 
433
        {DATA_DIR "/images/operators/101.png", "\\min", NULL},
 
434
        {DATA_DIR "/images/operators/102.png", "\\Pr", NULL},
 
435
        {DATA_DIR "/images/operators/103.png", "\\projlim", "amsmath"},
 
436
        {DATA_DIR "/images/operators/104.png", "\\sec", NULL},
 
437
        {DATA_DIR "/images/operators/105.png", "\\sin", NULL},
 
438
        {DATA_DIR "/images/operators/106.png", "\\sinh", NULL},
 
439
        {DATA_DIR "/images/operators/107.png", "\\sup", NULL},
 
440
        {DATA_DIR "/images/operators/108.png", "\\tan", NULL},
 
441
        {DATA_DIR "/images/operators/109.png", "\\tanh", NULL},
 
442
        {DATA_DIR "/images/operators/110.png", "\\varlimsup", "amsmath"},
 
443
        {DATA_DIR "/images/operators/111.png", "\\varliminf", "amsmath"},
 
444
        {DATA_DIR "/images/operators/112.png", "\\varinjlim", "amsmath"},
 
445
        {DATA_DIR "/images/operators/113.png", "\\varprojlim", "amsmath"},
 
446
        {NULL, NULL, NULL}
 
447
};
 
448
 
 
449
static struct symbol symbols_delimiters[] = {
 
450
        {DATA_DIR "/images/delimiters/01.png", "\\downarrow", NULL},
 
451
        {DATA_DIR "/images/delimiters/02.png", "\\Downarrow", NULL},
 
452
        {DATA_DIR "/images/delimiters/03.png", "[", NULL},
 
453
        {DATA_DIR "/images/delimiters/04.png", "]", NULL},
 
454
        {DATA_DIR "/images/delimiters/05.png", "\\langle", NULL},
 
455
        {DATA_DIR "/images/delimiters/06.png", "\\rangle", NULL},
 
456
        {DATA_DIR "/images/delimiters/07.png", "|", NULL},
 
457
        {DATA_DIR "/images/delimiters/08.png", "\\|", NULL},
 
458
        {DATA_DIR "/images/delimiters/09.png", "\\lceil", NULL},
 
459
        {DATA_DIR "/images/delimiters/10.png", "\\rceil", NULL},
 
460
        {DATA_DIR "/images/delimiters/11.png", "\\uparrow", NULL},
 
461
        {DATA_DIR "/images/delimiters/12.png", "\\Uparrow", NULL},
 
462
        {DATA_DIR "/images/delimiters/13.png", "\\lfloor", NULL},
 
463
        {DATA_DIR "/images/delimiters/14.png", "\\rfloor", NULL},
 
464
        {DATA_DIR "/images/delimiters/15.png", "\\updownarrow", NULL},
 
465
        {DATA_DIR "/images/delimiters/16.png", "\\Updownarrow", NULL},
 
466
        {DATA_DIR "/images/delimiters/17.png", "(", NULL},
 
467
        {DATA_DIR "/images/delimiters/18.png", ")", NULL},
 
468
        {DATA_DIR "/images/delimiters/19.png", "\\{", NULL},
 
469
        {DATA_DIR "/images/delimiters/20.png", "\\}", NULL},
 
470
        {DATA_DIR "/images/delimiters/21.png", "/", NULL},
 
471
        {DATA_DIR "/images/delimiters/22.png", "\\backslash", NULL},
 
472
        {DATA_DIR "/images/delimiters/23.png", "\\lmoustache", NULL},
 
473
        {DATA_DIR "/images/delimiters/24.png", "\\rmoustache", NULL},
 
474
        {DATA_DIR "/images/delimiters/25.png", "\\lgroup", NULL},
 
475
        {DATA_DIR "/images/delimiters/26.png", "\\rgroup", NULL},
 
476
        {DATA_DIR "/images/delimiters/27.png", "\\arrowvert", NULL},
 
477
        {DATA_DIR "/images/delimiters/28.png", "\\Arrowvert", NULL},
 
478
        {DATA_DIR "/images/delimiters/29.png", "\\bracevert", NULL},
 
479
        {DATA_DIR "/images/delimiters/30.png", "\\lvert", "amsmath"},
 
480
        {DATA_DIR "/images/delimiters/31.png", "\\rvert", "amsmath"},
 
481
        {DATA_DIR "/images/delimiters/32.png", "\\lVert", "amsmath"},
 
482
        {DATA_DIR "/images/delimiters/33.png", "\\rVert", "amsmath"},
 
483
        {DATA_DIR "/images/delimiters/34.png", "\\ulcorner", "amssymb"},
 
484
        {DATA_DIR "/images/delimiters/35.png", "\\urcorner", "amssymb"},
 
485
        {DATA_DIR "/images/delimiters/36.png", "\\llcorner", "amssymb"},
 
486
        {DATA_DIR "/images/delimiters/37.png", "\\lrcorner", "amssymb"},
 
487
        {NULL, NULL, NULL}
 
488
};
 
489
 
 
490
static struct symbol symbols_misc_math[] = {
 
491
        {DATA_DIR "/images/misc-math/01.png", "\\cdotp", NULL},
 
492
        {DATA_DIR "/images/misc-math/02.png", "\\colon", NULL},
 
493
        {DATA_DIR "/images/misc-math/03.png", "\\ldotp", NULL},
 
494
        {DATA_DIR "/images/misc-math/04.png", "\\vdots", NULL},
 
495
        {DATA_DIR "/images/misc-math/05.png", "\\cdots", NULL},
 
496
        {DATA_DIR "/images/misc-math/06.png", "\\ddots", NULL},
 
497
        {DATA_DIR "/images/misc-math/07.png", "\\ldots", NULL},
 
498
        {DATA_DIR "/images/misc-math/08.png", "\\neg", NULL},
 
499
        {DATA_DIR "/images/misc-math/09.png", "\\infty", NULL},
 
500
        {DATA_DIR "/images/misc-math/10.png", "\\prime", NULL},
 
501
        {DATA_DIR "/images/misc-math/11.png", "\\backprime", "amssymb"},
 
502
        {DATA_DIR "/images/misc-math/12.png", "\\backslash", NULL},
 
503
        {DATA_DIR "/images/misc-math/13.png", "\\diagdown", "amssymb"},
 
504
        {DATA_DIR "/images/misc-math/14.png", "\\diagup", "amssymb"},
 
505
        {DATA_DIR "/images/misc-math/15.png", "\\surd", NULL},
 
506
        {DATA_DIR "/images/misc-math/16.png", "\\emptyset", NULL},
 
507
        {DATA_DIR "/images/misc-math/17.png", "\\varnothing", "amssymb"},
 
508
        {DATA_DIR "/images/misc-math/18.png", "\\sharp", NULL},
 
509
        {DATA_DIR "/images/misc-math/19.png", "\\flat", NULL},
 
510
        {DATA_DIR "/images/misc-math/20.png", "\\natural", NULL},
 
511
        {DATA_DIR "/images/misc-math/21.png", "\\angle", NULL},
 
512
        {DATA_DIR "/images/misc-math/22.png", "\\sphericalangle", "amssymb"},
 
513
        {DATA_DIR "/images/misc-math/23.png", "\\measuredangle", "amssymb"},
 
514
        {DATA_DIR "/images/misc-math/24.png", "\\Box", "amssymb"},
 
515
        {DATA_DIR "/images/misc-math/25.png", "\\square", "amssymb"},
 
516
        {DATA_DIR "/images/misc-math/26.png", "\\triangle", NULL},
 
517
        {DATA_DIR "/images/misc-math/27.png", "\\vartriangle", "amssymb"},
 
518
        {DATA_DIR "/images/misc-math/28.png", "\\triangledown", "amssymb"},
 
519
        {DATA_DIR "/images/misc-math/29.png", "\\Diamond", "amssymb"},
 
520
        {DATA_DIR "/images/misc-math/30.png", "\\diamondsuit", NULL},
 
521
        {DATA_DIR "/images/misc-math/31.png", "\\lozenge", "amssymb"},
 
522
        {DATA_DIR "/images/misc-math/32.png", "\\heartsuit", NULL},
 
523
        {DATA_DIR "/images/misc-math/33.png", "\\blacksquare", "amssymb"},
 
524
        {DATA_DIR "/images/misc-math/34.png", "\\blacktriangle", "amssymb"},
 
525
        {DATA_DIR "/images/misc-math/35.png", "\\blacktriangledown", "amssymb"},
 
526
        {DATA_DIR "/images/misc-math/36.png", "\\blacklozenge", "amssymb"},
 
527
        {DATA_DIR "/images/misc-math/37.png", "\\bigstar", "amssymb"},
 
528
        {DATA_DIR "/images/misc-math/38.png", "\\spadesuit", NULL},
 
529
        {DATA_DIR "/images/misc-math/39.png", "\\clubsuit", NULL},
 
530
        {DATA_DIR "/images/misc-math/40.png", "\\forall", NULL},
 
531
        {DATA_DIR "/images/misc-math/41.png", "\\exists", NULL},
 
532
        {DATA_DIR "/images/misc-math/42.png", "\\nexists", "amssymb"},
 
533
        {DATA_DIR "/images/misc-math/43.png", "\\Finv", "amssymb"},
 
534
        {DATA_DIR "/images/misc-math/44.png", "\\Game", "amssymb"},
 
535
        {DATA_DIR "/images/misc-math/45.png", "\\ni", NULL},
 
536
        {DATA_DIR "/images/misc-math/46.png", "\\in", NULL},
 
537
        {DATA_DIR "/images/misc-math/47.png", "\\notin", NULL},
 
538
        {DATA_DIR "/images/misc-math/48.png", "\\complement", "amssymb"},
 
539
        {DATA_DIR "/images/misc-math/set-N.png", "\\mathbb{N}", "amsfonts"},
 
540
        {DATA_DIR "/images/misc-math/set-Z.png", "\\mathbb{Z}", "amsfonts"},
 
541
        {DATA_DIR "/images/misc-math/set-Q.png", "\\mathbb{Q}", "amsfonts"},
 
542
        {DATA_DIR "/images/misc-math/set-I.png", "\\mathbb{I}", "amsfonts"},
 
543
        {DATA_DIR "/images/misc-math/set-R.png", "\\mathbb{R}", "amsfonts"},
 
544
        {DATA_DIR "/images/misc-math/set-C.png", "\\mathbb{C}", "amsfonts"},
 
545
        {DATA_DIR "/images/misc-math/49.png", "\\Im", NULL},
 
546
        {DATA_DIR "/images/misc-math/50.png", "\\Re", NULL},
 
547
        {DATA_DIR "/images/misc-math/51.png", "\\aleph", NULL},
 
548
        {DATA_DIR "/images/misc-math/52.png", "\\wp", NULL},
 
549
        {DATA_DIR "/images/misc-math/53.png", "\\hslash", "amssymb"},
 
550
        {DATA_DIR "/images/misc-math/54.png", "\\hbar", NULL},
 
551
        {DATA_DIR "/images/misc-math/55.png", "\\imath", NULL},
 
552
        {DATA_DIR "/images/misc-math/56.png", "\\jmath", NULL},
 
553
        {DATA_DIR "/images/misc-math/57.png", "\\Bbbk", "amssymb"},
 
554
        {DATA_DIR "/images/misc-math/58.png", "\\ell", NULL},
 
555
        {DATA_DIR "/images/misc-math/59.png", "\\circledR", "amssymb"},
 
556
        {DATA_DIR "/images/misc-math/60.png", "\\circledS", "amssymb"},
 
557
        {DATA_DIR "/images/misc-math/61.png", "\\bot", NULL},
 
558
        {DATA_DIR "/images/misc-math/62.png", "\\top", NULL},
 
559
        {DATA_DIR "/images/misc-math/63.png", "\\partial", NULL},
 
560
        {DATA_DIR "/images/misc-math/64.png", "\\nabla", NULL},
 
561
        {DATA_DIR "/images/misc-math/65.png", "\\eth", "amssymb"},
 
562
        {DATA_DIR "/images/misc-math/66.png", "\\mho", "amssymb"},
 
563
        {DATA_DIR "/images/misc-math/67.png", "\\acute{}", NULL},
 
564
        {DATA_DIR "/images/misc-math/68.png", "\\grave{}", NULL},
 
565
        {DATA_DIR "/images/misc-math/69.png", "\\check{}", NULL},
 
566
        {DATA_DIR "/images/misc-math/70.png", "\\hat{}", NULL},
 
567
        {DATA_DIR "/images/misc-math/71.png", "\\tilde{}", NULL},
 
568
        {DATA_DIR "/images/misc-math/72.png", "\\bar{}", NULL},
 
569
        {DATA_DIR "/images/misc-math/73.png", "\\vec{}", NULL},
 
570
        {DATA_DIR "/images/misc-math/74.png", "\\breve{}", NULL},
 
571
        {DATA_DIR "/images/misc-math/75.png", "\\dot{}", NULL},
 
572
        {DATA_DIR "/images/misc-math/76.png", "\\ddot{}", NULL},
 
573
        {DATA_DIR "/images/misc-math/77.png", "\\dddot{}", "amsmath"},
 
574
        {DATA_DIR "/images/misc-math/78.png", "\\ddddot{}", "amsmath"},
 
575
        {DATA_DIR "/images/misc-math/79.png", "\\mathring{}", NULL},
 
576
        {DATA_DIR "/images/misc-math/80.png", "\\widetilde{}", NULL},
 
577
        {DATA_DIR "/images/misc-math/81.png", "\\widehat{}", NULL},
 
578
        {DATA_DIR "/images/misc-math/82.png", "\\overleftarrow{}", NULL},
 
579
        {DATA_DIR "/images/misc-math/83.png", "\\overrightarrow{}", NULL},
 
580
        {DATA_DIR "/images/misc-math/84.png", "\\overline{}", NULL},
 
581
        {DATA_DIR "/images/misc-math/85.png", "\\underline{}", NULL},
 
582
        {DATA_DIR "/images/misc-math/86.png", "\\overbrace{}", NULL},
 
583
        {DATA_DIR "/images/misc-math/87.png", "\\underbrace{}", NULL},
 
584
        {DATA_DIR "/images/misc-math/88.png", "\\overleftrightarrow{}", "amsmath"},
 
585
        {DATA_DIR "/images/misc-math/89.png", "\\underleftrightarrow{}", "amsmath"},
 
586
        {DATA_DIR "/images/misc-math/90.png", "\\underleftarrow{}", "amsmath"},
 
587
        {DATA_DIR "/images/misc-math/91.png", "\\underrightarrow{}", "amsmath"},
 
588
        {DATA_DIR "/images/misc-math/92.png", "\\xleftarrow{}", "amsmath"},
 
589
        {DATA_DIR "/images/misc-math/93.png", "\\xrightarrow{}", "amsmath"},
 
590
        {DATA_DIR "/images/misc-math/94.png", "\\stackrel{}{}", NULL},
 
591
        {DATA_DIR "/images/misc-math/95.png", "\\sqrt{}", NULL},
 
592
        {DATA_DIR "/images/misc-math/96.png", "f'", NULL},
 
593
        {DATA_DIR "/images/misc-math/97.png", "f''", NULL},
 
594
        {NULL, NULL, NULL}
 
595
};
 
596
 
 
597
static struct symbol symbols_misc_text[] = {
 
598
        {DATA_DIR "/images/misc-text/001.png", "\\dots", NULL},
 
599
        {DATA_DIR "/images/misc-text/002.png", "\\texttildelow", "textcomp"},
 
600
        {DATA_DIR "/images/misc-text/003.png", "\\textasciicircum", NULL},
 
601
        {DATA_DIR "/images/misc-text/004.png", "\\textasciimacron", "textcomp"},
 
602
        {DATA_DIR "/images/misc-text/005.png", "\\textasciiacute", "textcomp"},
 
603
        {DATA_DIR "/images/misc-text/006.png", "\\textasciidieresis", "textcomp"},
 
604
        {DATA_DIR "/images/misc-text/007.png", "\\textasciitilde", NULL},
 
605
        {DATA_DIR "/images/misc-text/008.png", "\\textasciigrave", "textcomp"},
 
606
        {DATA_DIR "/images/misc-text/009.png", "\\textasciibreve", "textcomp"},
 
607
        {DATA_DIR "/images/misc-text/010.png", "\\textasciicaron", "textcomp"},
 
608
        {DATA_DIR "/images/misc-text/011.png", "\\textacutedbl", "textcomp"},
 
609
        {DATA_DIR "/images/misc-text/012.png", "\\textgravedbl", "textcomp"},
 
610
        {DATA_DIR "/images/misc-text/013.png", "\\textquotedblleft", NULL},
 
611
        {DATA_DIR "/images/misc-text/014.png", "\\textquotedblright", NULL},
 
612
        {DATA_DIR "/images/misc-text/015.png", "\\textquoteleft", NULL},
 
613
        {DATA_DIR "/images/misc-text/016.png", "\\textquoteright", NULL},
 
614
        {DATA_DIR "/images/misc-text/017.png", "\\textquotestraightbase", "textcomp"},
 
615
        {DATA_DIR "/images/misc-text/018.png", "\\textquotestraightdblbase", "textcomp"},
 
616
        {DATA_DIR "/images/misc-text/019.png", "\\textquotesingle", "textcomp"},
 
617
        {DATA_DIR "/images/misc-text/020.png", "\\textdblhyphen", "textcomp"},
 
618
        {DATA_DIR "/images/misc-text/021.png", "\\textdblhyphenchar", "textcomp"},
 
619
        {DATA_DIR "/images/misc-text/022.png", "\\textasteriskcentered", NULL},
 
620
        {DATA_DIR "/images/misc-text/023.png", "\\textperiodcentered", NULL},
 
621
        {DATA_DIR "/images/misc-text/024.png", "\\textquestiondown", NULL},
 
622
        {DATA_DIR "/images/misc-text/025.png", "\\textinterrobang", "textcomp"},
 
623
        {DATA_DIR "/images/misc-text/026.png", "\\textinterrobangdown", "textcomp"},
 
624
        {DATA_DIR "/images/misc-text/027.png", "\\textexclamdown", NULL},
 
625
        {DATA_DIR "/images/misc-text/028.png", "\\texttwelveudash", "textcomp"},
 
626
        {DATA_DIR "/images/misc-text/029.png", "\\textemdash", NULL},
 
627
        {DATA_DIR "/images/misc-text/030.png", "\\textendash", NULL},
 
628
        {DATA_DIR "/images/misc-text/031.png", "\\textthreequartersemdash", "textcomp"},
 
629
        {DATA_DIR "/images/misc-text/032.png", "\\textvisiblespace", NULL},
 
630
        {DATA_DIR "/images/misc-text/033.png", "\\_", NULL},
 
631
        {DATA_DIR "/images/misc-text/034.png", "\\textcurrency", "textcomp"},
 
632
        {DATA_DIR "/images/misc-text/035.png", "\\textbaht", "textcomp"},
 
633
        {DATA_DIR "/images/misc-text/036.png", "\\textguarani", "textcomp"},
 
634
        {DATA_DIR "/images/misc-text/037.png", "\\textwon", "textcomp"},
 
635
        {DATA_DIR "/images/misc-text/038.png", "\\textcent", "textcomp"},
 
636
        {DATA_DIR "/images/misc-text/039.png", "\\textcentoldstyle", "textcomp"},
 
637
        {DATA_DIR "/images/misc-text/040.png", "\\textdollar", NULL},
 
638
        {DATA_DIR "/images/misc-text/041.png", "\\textdollaroldstyle", "textcomp"},
 
639
        {DATA_DIR "/images/misc-text/042.png", "\\textlira", "textcomp"},
 
640
        {DATA_DIR "/images/misc-text/043.png", "\\textyen", "textcomp"},
 
641
        {DATA_DIR "/images/misc-text/044.png", "\\textdong", "textcomp"},
 
642
        {DATA_DIR "/images/misc-text/045.png", "\\textnaira", "textcomp"},
 
643
        {DATA_DIR "/images/misc-text/046.png", "\\textcolonmonetary", "textcomp"},
 
644
        {DATA_DIR "/images/misc-text/047.png", "\\textpeso", "textcomp"},
 
645
        {DATA_DIR "/images/misc-text/048.png", "\\pounds", NULL},
 
646
        {DATA_DIR "/images/misc-text/049.png", "\\textflorin", "textcomp"},
 
647
        {DATA_DIR "/images/misc-text/050.png", "\\texteuro", "textcomp"},
 
648
        {DATA_DIR "/images/misc-text/051.png", "\\geneuro", "eurosym"},
 
649
        {DATA_DIR "/images/misc-text/052.png", "\\geneuronarrow", "eurosym"},
 
650
        {DATA_DIR "/images/misc-text/053.png", "\\geneurowide", "eurosym"},
 
651
        {DATA_DIR "/images/misc-text/054.png", "\\officialeuro", "eurosym"},
 
652
        {DATA_DIR "/images/misc-text/055.png", "\\textcircled{a}", NULL},
 
653
        {DATA_DIR "/images/misc-text/056.png", "\\textcopyright", NULL},
 
654
        {DATA_DIR "/images/misc-text/057.png", "\\textcopyleft", "textcomp"},
 
655
        {DATA_DIR "/images/misc-text/058.png", "\\textregistered", NULL},
 
656
        {DATA_DIR "/images/misc-text/059.png", "\\texttrademark", NULL},
 
657
        {DATA_DIR "/images/misc-text/060.png", "\\textservicemark", "textcomp"},
 
658
        {DATA_DIR "/images/misc-text/061.png", "\\oldstylenums{0}", NULL},
 
659
        {DATA_DIR "/images/misc-text/062.png", "\\oldstylenums{1}", NULL},
 
660
        {DATA_DIR "/images/misc-text/063.png", "\\oldstylenums{2}", NULL},
 
661
        {DATA_DIR "/images/misc-text/064.png", "\\oldstylenums{3}", NULL},
 
662
        {DATA_DIR "/images/misc-text/065.png", "\\oldstylenums{4}", NULL},
 
663
        {DATA_DIR "/images/misc-text/066.png", "\\oldstylenums{5}", NULL},
 
664
        {DATA_DIR "/images/misc-text/067.png", "\\oldstylenums{6}", NULL},
 
665
        {DATA_DIR "/images/misc-text/068.png", "\\oldstylenums{7}", NULL},
 
666
        {DATA_DIR "/images/misc-text/069.png", "\\oldstylenums{8}", NULL},
 
667
        {DATA_DIR "/images/misc-text/070.png", "\\oldstylenums{9}", NULL},
 
668
        {DATA_DIR "/images/misc-text/071.png", "\\textonehalf", "textcomp"},
 
669
        {DATA_DIR "/images/misc-text/072.png", "\\textonequarter", "textcomp"},
 
670
        {DATA_DIR "/images/misc-text/073.png", "\\textthreequarters", "textcomp"},
 
671
        {DATA_DIR "/images/misc-text/074.png", "\\textonesuperior", "textcomp"},
 
672
        {DATA_DIR "/images/misc-text/075.png", "\\texttwosuperior", "textcomp"},
 
673
        {DATA_DIR "/images/misc-text/076.png", "\\textthreesuperior", "textcomp"},
 
674
        {DATA_DIR "/images/misc-text/077.png", "\\textnumero", "textcomp"},
 
675
        {DATA_DIR "/images/misc-text/078.png", "\\textpertenthousand", "textcomp"},
 
676
        {DATA_DIR "/images/misc-text/079.png", "\\textperthousand", "textcomp"},
 
677
        {DATA_DIR "/images/misc-text/080.png", "\\textdiscount", "textcomp"},
 
678
        {DATA_DIR "/images/misc-text/081.png", "\\textblank", "textcomp"},
 
679
        {DATA_DIR "/images/misc-text/082.png", "\\textrecipe", "textcomp"},
 
680
        {DATA_DIR "/images/misc-text/083.png", "\\textestimated", "textcomp"},
 
681
        {DATA_DIR "/images/misc-text/084.png", "\\textreferencemark", "textcomp"},
 
682
        {DATA_DIR "/images/misc-text/085.png", "\\textmusicalnote", "textcomp"},
 
683
        {DATA_DIR "/images/misc-text/086.png", "\\dag", NULL},
 
684
        {DATA_DIR "/images/misc-text/087.png", "\\ddag", NULL},
 
685
        {DATA_DIR "/images/misc-text/088.png", "\\S", NULL},
 
686
        {DATA_DIR "/images/misc-text/089.png", "\\$", NULL},
 
687
        {DATA_DIR "/images/misc-text/090.png", "\\textpilcrow", "textcomp"},
 
688
        {DATA_DIR "/images/misc-text/091.png", "\\Cutleft", "marvosym"},
 
689
        {DATA_DIR "/images/misc-text/092.png", "\\Cutright", "marvosym"},
 
690
        {DATA_DIR "/images/misc-text/093.png", "\\Leftscissors", "marvosym"},
 
691
        {DATA_DIR "/images/misc-text/094.png", "\\Cutline", "marvosym"},
 
692
        {DATA_DIR "/images/misc-text/095.png", "\\Kutline", "marvosym"},
 
693
        {DATA_DIR "/images/misc-text/096.png", "\\Rightscissors", "marvosym"},
 
694
        {DATA_DIR "/images/misc-text/097.png", "\\CheckedBox", "wasysym"},
 
695
        {DATA_DIR "/images/misc-text/098.png", "\\Square", "wasysym"},
 
696
        {DATA_DIR "/images/misc-text/099.png", "\\XBox", "wasysym"},
 
697
        {DATA_DIR "/images/misc-text/100.png", "\\textbigcircle", "textcomp"},
 
698
        {DATA_DIR "/images/misc-text/101.png", "\\textopenbullet", "textcomp"},
 
699
        {DATA_DIR "/images/misc-text/102.png", "\\textbullet", NULL},
 
700
        {DATA_DIR "/images/misc-text/103.png", "\\checkmark", "amssymb"},
 
701
        {DATA_DIR "/images/misc-text/104.png", "\\maltese", "amssymb"},
 
702
        {DATA_DIR "/images/misc-text/105.png", "\\textordmasculine", "textcomp"},
 
703
        {DATA_DIR "/images/misc-text/106.png", "\\textordfeminine", "textcomp"},
 
704
        {DATA_DIR "/images/misc-text/107.png", "\\textborn", "textcomp"},
 
705
        {DATA_DIR "/images/misc-text/108.png", "\\textdivorced", "textcomp"},
 
706
        {DATA_DIR "/images/misc-text/109.png", "\\textdied", "textcomp"},
 
707
        {DATA_DIR "/images/misc-text/110.png", "\\textmarried", "textcomp"},
 
708
        {DATA_DIR "/images/misc-text/111.png", "\\textleaf", "textcomp"},
 
709
        {DATA_DIR "/images/misc-text/112.png", "\\textcelsius", "textcomp"},
 
710
        {DATA_DIR "/images/misc-text/113.png", "\\textdegree", "textcomp"},
 
711
        {DATA_DIR "/images/misc-text/114.png", "\\textmho", "textcomp"},
 
712
        {DATA_DIR "/images/misc-text/115.png", "\\textohm", "textcomp"},
 
713
        {DATA_DIR "/images/misc-text/116.png", "\\textbackslash", NULL},
 
714
        {DATA_DIR "/images/misc-text/117.png", "\\textbar", NULL},
 
715
        {DATA_DIR "/images/misc-text/118.png", "\\textbrokenbar", "textcomp"},
 
716
        {DATA_DIR "/images/misc-text/119.png", "\\textbardbl", NULL},
 
717
        {DATA_DIR "/images/misc-text/120.png", "\\textfractionsolidus", "textcomp"},
 
718
        {DATA_DIR "/images/misc-text/121.png", "\\textlangle", "textcomp"},
 
719
        {DATA_DIR "/images/misc-text/122.png", "\\textlnot", "textcomp"},
 
720
        {DATA_DIR "/images/misc-text/123.png", "\\textminus", "textcomp"},
 
721
        {DATA_DIR "/images/misc-text/124.png", "\\textrangle", "textcomp"},
 
722
        {DATA_DIR "/images/misc-text/125.png", "\\textlbrackdbl", "textcomp"},
 
723
        {DATA_DIR "/images/misc-text/126.png", "\\textrbrackdbl", "textcomp"},
 
724
        {DATA_DIR "/images/misc-text/127.png", "\\textmu", "textcomp"},
 
725
        {DATA_DIR "/images/misc-text/128.png", "\\textpm", "textcomp"},
 
726
        {DATA_DIR "/images/misc-text/129.png", "\\textlquill", "textcomp"},
 
727
        {DATA_DIR "/images/misc-text/130.png", "\\textrquill", "textcomp"},
 
728
        {DATA_DIR "/images/misc-text/131.png", "\\textless", NULL},
 
729
        {DATA_DIR "/images/misc-text/132.png", "\\textgreater", NULL},
 
730
        {DATA_DIR "/images/misc-text/133.png", "\\textsurd", "textcomp"},
 
731
        {DATA_DIR "/images/misc-text/134.png", "\\texttimes", "textcomp"},
 
732
        {DATA_DIR "/images/misc-text/135.png", "\\textdiv", "textcomp"},
 
733
        {NULL, NULL, NULL}
 
734
};
 
735
 
 
736
// symbols must be NULL-terminated
 
737
static GtkListStore *
 
738
get_symbol_store (const struct symbol symbols[])
 
739
{
 
740
        GError *error = NULL;
 
741
        GtkListStore *symbol_store = gtk_list_store_new (N_COLUMNS_SYMBOL,
 
742
                        GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
 
743
 
 
744
        for (gint i = 0 ; symbols[i].filename != NULL ; i++)
 
745
        {
 
746
                struct symbol current_symbol = symbols[i];
 
747
 
 
748
                GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (current_symbol.filename,
 
749
                                &error);
 
750
                if (error != NULL)
 
751
                {
 
752
                        print_warning ("impossible to load the symbol: %s", error->message);
 
753
                        g_error_free (error);
 
754
                        error = NULL;
 
755
                        continue;
 
756
                }
 
757
 
 
758
                // some characters ('<' for example) generate errors for the tooltip,
 
759
                // so we must escape it
 
760
                gchar *latex_command_escaped = g_markup_escape_text (
 
761
                                current_symbol.latex_command, -1);
 
762
                gchar *tooltip;
 
763
                if (current_symbol.package_required != NULL)
 
764
                {
 
765
                        tooltip = g_strdup_printf ("%s (package %s)",
 
766
                                        latex_command_escaped,
 
767
                                        current_symbol.package_required);
 
768
                        g_free (latex_command_escaped);
 
769
                }
 
770
                else
 
771
                        tooltip = latex_command_escaped;
 
772
 
 
773
 
 
774
                GtkTreeIter iter;
 
775
                gtk_list_store_append (symbol_store, &iter);
 
776
                gtk_list_store_set (symbol_store, &iter,
 
777
                                COLUMN_SYMBOL_PIXBUF, pixbuf,
 
778
                                COLUMN_SYMBOL_COMMAND, current_symbol.latex_command,
 
779
                                COLUMN_SYMBOL_TOOLTIP, tooltip,
 
780
                                -1);
 
781
                g_free (tooltip);
 
782
                g_object_unref (pixbuf);
 
783
        }
 
784
 
 
785
        return symbol_store;
 
786
}
 
787
 
 
788
void
 
789
init_symbols (void)
 
790
{
 
791
        GError *error = NULL;
 
792
 
 
793
        // store the categories
 
794
        GtkListStore *categories_store = gtk_list_store_new (N_COLUMNS_CAT,
 
795
                        GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
 
796
 
 
797
        gint nb_categories = G_N_ELEMENTS (categories);
 
798
        for (gint i = 0 ; i < nb_categories ; i++)
 
799
        {
 
800
                GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (categories[i].icon,
 
801
                                &error);
 
802
                if (error != NULL)
 
803
                {
 
804
                        print_warning ("impossible to load the symbol: %s", error->message);
 
805
                        g_error_free (error);
 
806
                        error = NULL;
 
807
                        continue;
 
808
                }
 
809
 
 
810
                GtkTreeIter iter;
 
811
                gtk_list_store_append (categories_store, &iter);
 
812
                gtk_list_store_set (categories_store, &iter,
 
813
                                COLUMN_CAT_ICON, pixbuf,
 
814
                                COLUMN_CAT_NAME, _(categories[i].name),
 
815
                                COLUMN_CAT_NUM, i,
 
816
                                -1);
 
817
        }
 
818
 
 
819
        // show the categories
 
820
        GtkWidget *categories_view = gtk_icon_view_new_with_model (
 
821
                        GTK_TREE_MODEL (categories_store));
 
822
        gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (categories_view),
 
823
                        COLUMN_CAT_ICON);
 
824
        gtk_icon_view_set_text_column (GTK_ICON_VIEW (categories_view),
 
825
                        COLUMN_CAT_NAME);
 
826
        gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (categories_view),
 
827
                        GTK_SELECTION_SINGLE);
 
828
 
 
829
        gtk_icon_view_set_orientation (GTK_ICON_VIEW (categories_view),
 
830
                        GTK_ORIENTATION_HORIZONTAL);
 
831
        //gtk_icon_view_set_columns (GTK_ICON_VIEW (categories_view), -1);
 
832
 
 
833
        gtk_icon_view_set_spacing (GTK_ICON_VIEW (categories_view), 5);
 
834
        gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (categories_view), 0);
 
835
        gtk_icon_view_set_column_spacing (GTK_ICON_VIEW (categories_view), 0);
 
836
 
 
837
        g_signal_connect (G_OBJECT (categories_view), "selection-changed",
 
838
                        G_CALLBACK (cb_category_symbols_selected), NULL);
 
839
 
 
840
        gtk_box_pack_start (GTK_BOX (latexila.symbols.vbox), categories_view, FALSE, FALSE, 0);
 
841
 
 
842
        // store all the symbols
 
843
        // Attention, we must save the GtkListStore in latexila.symbols.list_stores
 
844
        // in the same order than the structure "categories" above
 
845
        latexila.symbols.list_stores[0] = get_symbol_store (symbols_greek);
 
846
        latexila.symbols.list_stores[1] = get_symbol_store (symbols_arrows);
 
847
        latexila.symbols.list_stores[2] = get_symbol_store (symbols_relations);
 
848
        latexila.symbols.list_stores[3] = get_symbol_store (symbols_operators);
 
849
        latexila.symbols.list_stores[4] = get_symbol_store (symbols_delimiters);
 
850
        latexila.symbols.list_stores[5] = get_symbol_store (symbols_misc_math);
 
851
        latexila.symbols.list_stores[6] = get_symbol_store (symbols_misc_text);
 
852
 
 
853
        // show the symbols
 
854
        GtkWidget *symbol_view = gtk_icon_view_new_with_model (
 
855
                        GTK_TREE_MODEL (latexila.symbols.list_stores[0]));
 
856
        latexila.symbols.icon_view = GTK_ICON_VIEW (symbol_view);
 
857
        gtk_icon_view_set_pixbuf_column (latexila.symbols.icon_view,
 
858
                        COLUMN_SYMBOL_PIXBUF);
 
859
        gtk_icon_view_set_tooltip_column (latexila.symbols.icon_view,
 
860
                        COLUMN_SYMBOL_TOOLTIP);
 
861
        gtk_icon_view_set_selection_mode (latexila.symbols.icon_view,
 
862
                        GTK_SELECTION_SINGLE);
 
863
        gtk_icon_view_set_spacing (latexila.symbols.icon_view, 0);
 
864
        gtk_icon_view_set_row_spacing (latexila.symbols.icon_view, 0);
 
865
        gtk_icon_view_set_column_spacing (latexila.symbols.icon_view, 0);
 
866
 
 
867
        g_signal_connect (G_OBJECT (symbol_view), "selection-changed",
 
868
                        G_CALLBACK (cb_symbol_selected), NULL);
 
869
 
 
870
        // with a scrollbar
 
871
        GtkWidget *scrollbar = gtk_scrolled_window_new (NULL, NULL);
 
872
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollbar),
 
873
                        GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
874
        gtk_container_add (GTK_CONTAINER (scrollbar), symbol_view);
 
875
        gtk_box_pack_start (GTK_BOX (latexila.symbols.vbox), scrollbar, TRUE, TRUE, 0);
 
876
}
 
877
 
 
878
static void
 
879
cb_category_symbols_selected (GtkIconView *icon_view, gpointer user_data)
 
880
{
 
881
        GList *selected_items = gtk_icon_view_get_selected_items (icon_view);
 
882
        GtkTreePath *path = g_list_nth_data (selected_items, 0);
 
883
        GtkTreeModel *model = gtk_icon_view_get_model (icon_view);
 
884
        GtkTreeIter iter;
 
885
 
 
886
        if (path != NULL && gtk_tree_model_get_iter (model, &iter, path))
 
887
        {
 
888
                gint num;
 
889
                gtk_tree_model_get (model, &iter, COLUMN_CAT_NUM, &num, -1);
 
890
 
 
891
                // change the model
 
892
                gtk_icon_view_set_model (latexila.symbols.icon_view,
 
893
                                GTK_TREE_MODEL (latexila.symbols.list_stores[num]));
 
894
 
 
895
                // TODO scroll to the start
 
896
                /* this doesn't work...
 
897
                GtkTreePath *first_path = gtk_icon_view_get_path_at_pos (
 
898
                                latexila.symbols.icon_view, 0, 0);
 
899
                if (first_path != NULL)
 
900
                {
 
901
                        gtk_icon_view_scroll_to_path (latexila.symbols.icon_view, first_path,
 
902
                                        TRUE, 0.0, 0.0);
 
903
                }
 
904
                */
 
905
        }
 
906
 
 
907
        // free the GList
 
908
        g_list_foreach (selected_items, (GFunc) gtk_tree_path_free, NULL);
 
909
        g_list_free (selected_items);
 
910
}
 
911
 
 
912
static void
 
913
cb_symbol_selected (GtkIconView *icon_view, gpointer user_data)
 
914
{
 
915
        if (latexila.active_doc == NULL)
 
916
        {
 
917
                gtk_icon_view_unselect_all (icon_view);
 
918
                return;
 
919
        }
 
920
 
 
921
        GList *selected_items = gtk_icon_view_get_selected_items (icon_view);
 
922
        // unselect the symbol, so the user can insert several times the same symbol
 
923
        gtk_icon_view_unselect_all (icon_view);
 
924
        GtkTreePath *path = g_list_nth_data (selected_items, 0);
 
925
        GtkTreeModel *model = gtk_icon_view_get_model (icon_view);
 
926
        GtkTreeIter iter;
 
927
 
 
928
        if (path != NULL && gtk_tree_model_get_iter (model, &iter, path))
 
929
        {
 
930
                gchar *latex_command;
 
931
                gtk_tree_model_get (model, &iter,
 
932
                                COLUMN_SYMBOL_COMMAND, &latex_command,
 
933
                                -1);
 
934
 
 
935
                // insert the symbol in the current document
 
936
                GtkTextBuffer *buffer =
 
937
                        GTK_TEXT_BUFFER (latexila.active_doc->source_buffer);
 
938
                gtk_text_buffer_begin_user_action (buffer);
 
939
                gtk_text_buffer_insert_at_cursor (
 
940
                                GTK_TEXT_BUFFER (latexila.active_doc->source_buffer),
 
941
                                latex_command, -1);
 
942
                gtk_text_buffer_insert_at_cursor (
 
943
                                GTK_TEXT_BUFFER (latexila.active_doc->source_buffer), " ", -1);
 
944
                gtk_text_buffer_end_user_action (buffer);
 
945
 
 
946
                gtk_widget_grab_focus (latexila.active_doc->source_view);
 
947
 
 
948
                g_free (latex_command);
 
949
        }
 
950
 
 
951
        // free the GList
 
952
        g_list_foreach (selected_items, (GFunc) gtk_tree_path_free, NULL);
 
953
        g_list_free (selected_items);
 
954
}