1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* This file is part of the GtkHTML library |
---|
3 | |
---|
4 | Copyright (C) 2000 Helix Code, Inc. |
---|
5 | Authors: Radek Doulik (rodo@helixcode.com) |
---|
6 | |
---|
7 | This library is free software; you can redistribute it and/or |
---|
8 | modify it under the terms of the GNU Library General Public |
---|
9 | License as published by the Free Software Foundation; either |
---|
10 | version 2 of the License, or (at your option) any later version. |
---|
11 | |
---|
12 | This library is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHcANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 | Library General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU Library General Public License |
---|
18 | along with this library; see the file COPYING.LIB. If not, write to |
---|
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
20 | Boston, MA 02111-1307, USA. |
---|
21 | */ |
---|
22 | |
---|
23 | #include <config.h> |
---|
24 | #include <string.h> |
---|
25 | #include <locale.h> |
---|
26 | #include <gdk/gdkx.h> |
---|
27 | #include <libgnome/gnome-i18n.h> |
---|
28 | #include "gtkhtml.h" |
---|
29 | #include "gtkhtml-properties.h" |
---|
30 | #include "htmlfontmanager.h" |
---|
31 | |
---|
32 | #define DEFAULT_FONT_SIZE 10 |
---|
33 | #define DEFAULT_FONT_SIZE_PRINT 10 |
---|
34 | |
---|
35 | #define STRINGIZE(x) #x |
---|
36 | |
---|
37 | /* this function is reworked gal:e-iconv.c:e_iconv_locale_language */ |
---|
38 | static gchar * |
---|
39 | get_locale_language () |
---|
40 | { |
---|
41 | gchar *locale; |
---|
42 | gchar *locale_language = NULL; |
---|
43 | |
---|
44 | locale = setlocale (LC_ALL, NULL); |
---|
45 | if (locale && strcmp (locale, "C") && strcmp (locale, "POSIX")) { |
---|
46 | char *codeset, *lang; |
---|
47 | |
---|
48 | if ((codeset = strchr (locale, '.'))) |
---|
49 | lang = g_strndup (locale, codeset - locale); |
---|
50 | else |
---|
51 | lang = g_strdup (locale); |
---|
52 | |
---|
53 | /* validate the language */ |
---|
54 | if (strlen (lang) >= 2) { |
---|
55 | if (lang[2] == '-' || lang[2] == '_') { |
---|
56 | /* canonicalise the lang */ |
---|
57 | lang [0] = g_ascii_tolower (lang [0]); |
---|
58 | lang [1] = g_ascii_tolower (lang [1]); |
---|
59 | |
---|
60 | /* validate the country code */ |
---|
61 | if (strlen (lang + 3) > 2) { |
---|
62 | /* invalid country code */ |
---|
63 | lang[2] = '\0'; |
---|
64 | } else { |
---|
65 | lang[2] = '-'; |
---|
66 | lang [3] = g_ascii_toupper (lang [3]); |
---|
67 | lang [4] = g_ascii_toupper (lang [4]); |
---|
68 | } |
---|
69 | } else if (lang[2] != '\0') { |
---|
70 | /* invalid language */ |
---|
71 | g_free (lang); |
---|
72 | lang = NULL; |
---|
73 | } |
---|
74 | |
---|
75 | locale_language = lang; |
---|
76 | } else { |
---|
77 | /* invalid language */ |
---|
78 | g_free (lang); |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | return locale_language; |
---|
83 | } |
---|
84 | |
---|
85 | GtkHTMLClassProperties * |
---|
86 | gtk_html_class_properties_new (GtkWidget *widget) |
---|
87 | { |
---|
88 | GtkHTMLClassProperties *p = g_new0 (GtkHTMLClassProperties, 1); |
---|
89 | |
---|
90 | p->language = get_locale_language (); |
---|
91 | |
---|
92 | return p; |
---|
93 | } |
---|
94 | |
---|
95 | void |
---|
96 | gtk_html_class_properties_destroy (GtkHTMLClassProperties *p) |
---|
97 | { |
---|
98 | g_free (p->language); |
---|
99 | g_free (p); |
---|
100 | } |
---|
101 | |
---|
102 | #define GNOME_SPELL_GCONF_DIR "/GNOME/Spell" |
---|
103 | #define GETSP(t,x,prop,f,c) \ |
---|
104 | key = g_strconcat (GNOME_SPELL_GCONF_DIR, x, NULL); \ |
---|
105 | val = gconf_client_get_without_default (client, key, NULL); \ |
---|
106 | if (val) { f; p->prop = c (gconf_value_get_ ## t (val)); \ |
---|
107 | gconf_value_free (val); } \ |
---|
108 | g_free (key); |
---|
109 | |
---|
110 | void |
---|
111 | gtk_html_class_properties_load (GtkHTMLClassProperties *p, GConfClient *client) |
---|
112 | { |
---|
113 | GConfValue *val; |
---|
114 | gchar *key; |
---|
115 | |
---|
116 | g_assert (client); |
---|
117 | |
---|
118 | GETSP (string, "/language", language, |
---|
119 | g_free (p->language), g_strdup); |
---|
120 | |
---|
121 | } |
---|
122 | |
---|
123 | #define SET(t,x,prop) \ |
---|
124 | { key = g_strconcat (GTK_HTML_GCONF_DIR, x, NULL); \ |
---|
125 | gconf_client_set_ ## t (client, key, p->prop, NULL); \ |
---|
126 | g_free (key); } |
---|
127 | |
---|
128 | |
---|
129 | void |
---|
130 | gtk_html_class_properties_update (GtkHTMLClassProperties *p, GConfClient *client, GtkHTMLClassProperties *old) |
---|
131 | { |
---|
132 | } |
---|
133 | |
---|
134 | /* enums */ |
---|
135 | |
---|
136 | static GEnumValue _gtk_html_cursor_skip_values[] = { |
---|
137 | { GTK_HTML_CURSOR_SKIP_ONE, "GTK_HTML_CURSOR_SKIP_ONE", "one" }, |
---|
138 | { GTK_HTML_CURSOR_SKIP_WORD, "GTK_HTML_CURSOR_SKIP_WORD", "word" }, |
---|
139 | { GTK_HTML_CURSOR_SKIP_PAGE, "GTK_HTML_CURSOR_SKIP_WORD", "page" }, |
---|
140 | { GTK_HTML_CURSOR_SKIP_ALL, "GTK_HTML_CURSOR_SKIP_ALL", "all" }, |
---|
141 | { 0, NULL, NULL } |
---|
142 | }; |
---|
143 | |
---|
144 | GType |
---|
145 | gtk_html_cursor_skip_get_type () |
---|
146 | { |
---|
147 | static GType cursor_skip_type = 0; |
---|
148 | |
---|
149 | if (!cursor_skip_type) |
---|
150 | cursor_skip_type = g_enum_register_static ("GTK_HTML_CURSOR_SKIP", _gtk_html_cursor_skip_values); |
---|
151 | |
---|
152 | return cursor_skip_type; |
---|
153 | } |
---|
154 | |
---|
155 | static GEnumValue _gtk_html_command_values[] = { |
---|
156 | { GTK_HTML_COMMAND_UNDO, "GTK_HTML_COMMAND_UNDO", "undo" }, |
---|
157 | { GTK_HTML_COMMAND_REDO, "GTK_HTML_COMMAND_REDO", "redo" }, |
---|
158 | { GTK_HTML_COMMAND_COPY, "GTK_HTML_COMMAND_COPY", "copy" }, |
---|
159 | { GTK_HTML_COMMAND_COPY_AND_DISABLE_SELECTION, "GTK_HTML_COMMAND_COPY_AND_DISABLE_SELECTION", "copy-and-disable-selection" }, |
---|
160 | { GTK_HTML_COMMAND_CUT, "GTK_HTML_COMMAND_CUT", "cut" }, |
---|
161 | { GTK_HTML_COMMAND_PASTE, "GTK_HTML_COMMAND_PASTE", "paste" }, |
---|
162 | { GTK_HTML_COMMAND_CUT_LINE, "GTK_HTML_COMMAND_CUT_LINE", "cut-line" }, |
---|
163 | |
---|
164 | { GTK_HTML_COMMAND_INSERT_RULE, "GTK_HTML_COMMAND_INSERT_RULE", "insert-rule" }, |
---|
165 | { GTK_HTML_COMMAND_INSERT_PARAGRAPH, "GTK_HTML_COMMAND_INSERT_PARAGRAPH", "insert-paragraph" }, |
---|
166 | { GTK_HTML_COMMAND_INSERT_TAB, "GTK_HTML_COMMAND_INSERT_TAB", "insert-tab" }, |
---|
167 | { GTK_HTML_COMMAND_INSERT_TAB_OR_NEXT_CELL, |
---|
168 | "GTK_HTML_COMMAND_INSERT_TAB_OR_NEXT_CELL", "insert-tab-or-next-cell" }, |
---|
169 | { GTK_HTML_COMMAND_DELETE, "GTK_HTML_COMMAND_DELETE", "delete" }, |
---|
170 | { GTK_HTML_COMMAND_DELETE_BACK, "GTK_HTML_COMMAND_DELETE_BACK", "delete-back" }, |
---|
171 | { GTK_HTML_COMMAND_DELETE_BACK_OR_INDENT_DEC, "GTK_HTML_COMMAND_DELETE_BACK_OR_INDENT_DEC", "delete-back-or-indent-dec" }, |
---|
172 | { GTK_HTML_COMMAND_SELECTION_MODE, "GTK_HTML_COMMAND_SELECTION_MODE", "selection-mode" }, |
---|
173 | { GTK_HTML_COMMAND_DISABLE_SELECTION, "GTK_HTML_COMMAND_DISABLE_SELECTION", "disable-selection" }, |
---|
174 | { GTK_HTML_COMMAND_BOLD_ON, "GTK_HTML_COMMAND_BOLD_ON", "bold-on" }, |
---|
175 | { GTK_HTML_COMMAND_BOLD_OFF, "GTK_HTML_COMMAND_BOLD_OFF", "bold-off" }, |
---|
176 | { GTK_HTML_COMMAND_BOLD_TOGGLE, "GTK_HTML_COMMAND_BOLD_TOGGLE", "bold-toggle" }, |
---|
177 | { GTK_HTML_COMMAND_ITALIC_ON, "GTK_HTML_COMMAND_ITALIC_ON", "italic-on" }, |
---|
178 | { GTK_HTML_COMMAND_ITALIC_OFF, "GTK_HTML_COMMAND_ITALIC_OFF", "italic-off" }, |
---|
179 | { GTK_HTML_COMMAND_ITALIC_TOGGLE, "GTK_HTML_COMMAND_ITALIC_TOGGLE", "italic-toggle" }, |
---|
180 | { GTK_HTML_COMMAND_UNDERLINE_ON, "GTK_HTML_COMMAND_UNDERLINE_ON", "underline-on" }, |
---|
181 | { GTK_HTML_COMMAND_UNDERLINE_OFF, "GTK_HTML_COMMAND_UNDERLINE_OFF", "underline-off" }, |
---|
182 | { GTK_HTML_COMMAND_UNDERLINE_TOGGLE, "GTK_HTML_COMMAND_UNDERLINE_TOGGLE", "underline-toggle" }, |
---|
183 | { GTK_HTML_COMMAND_STRIKEOUT_ON, "GTK_HTML_COMMAND_STRIKEOUT_ON", "strikeout-on" }, |
---|
184 | { GTK_HTML_COMMAND_STRIKEOUT_OFF, "GTK_HTML_COMMAND_STRIKEOUT_OFF", "strikeout-off" }, |
---|
185 | { GTK_HTML_COMMAND_STRIKEOUT_TOGGLE, "GTK_HTML_COMMAND_STRIKEOUT_TOGGLE", "strikeout-toggle" }, |
---|
186 | { GTK_HTML_COMMAND_SIZE_MINUS_2, "GTK_HTML_COMMAND_SIZE_MINUS_2", "size-minus-2" }, |
---|
187 | { GTK_HTML_COMMAND_SIZE_MINUS_1, "GTK_HTML_COMMAND_SIZE_MINUS_1", "size-minus-1" }, |
---|
188 | { GTK_HTML_COMMAND_SIZE_PLUS_0, "GTK_HTML_COMMAND_SIZE_PLUS_0", "size-plus-0" }, |
---|
189 | { GTK_HTML_COMMAND_SIZE_PLUS_1, "GTK_HTML_COMMAND_SIZE_PLUS_1", "size-plus-1" }, |
---|
190 | { GTK_HTML_COMMAND_SIZE_PLUS_2, "GTK_HTML_COMMAND_SIZE_PLUS_2", "size-plus-2" }, |
---|
191 | { GTK_HTML_COMMAND_SIZE_PLUS_3, "GTK_HTML_COMMAND_SIZE_PLUS_3", "size-plus-3" }, |
---|
192 | { GTK_HTML_COMMAND_SIZE_PLUS_4, "GTK_HTML_COMMAND_SIZE_PLUS_4", "size-plus-4" }, |
---|
193 | { GTK_HTML_COMMAND_SIZE_INCREASE, "GTK_HTML_COMMAND_SIZE_INCREASE", "size-inc" }, |
---|
194 | { GTK_HTML_COMMAND_SIZE_DECREASE, "GTK_HTML_COMMAND_SIZE_DECREASE", "size-dec" }, |
---|
195 | { GTK_HTML_COMMAND_ALIGN_LEFT, "GTK_HTML_COMMAND_ALIGN_LEFT", "align-left" }, |
---|
196 | { GTK_HTML_COMMAND_ALIGN_CENTER, "GTK_HTML_COMMAND_ALIGN_CENTER", "align-center" }, |
---|
197 | { GTK_HTML_COMMAND_ALIGN_RIGHT, "GTK_HTML_COMMAND_ALIGN_RIGHT", "align-right" }, |
---|
198 | { GTK_HTML_COMMAND_INDENT_ZERO, "GTK_HTML_COMMAND_INDENT_ZERO", "indent-zero" }, |
---|
199 | { GTK_HTML_COMMAND_INDENT_INC, "GTK_HTML_COMMAND_INDENT_INC", "indent-more" }, |
---|
200 | { GTK_HTML_COMMAND_INDENT_INC_OR_NEXT_CELL, "GTK_HTML_COMMAND_INDENT_INC_OR_NEXT_CELL", "indent-more-or-next-cell" }, |
---|
201 | { GTK_HTML_COMMAND_INDENT_DEC, "GTK_HTML_COMMAND_INDENT_DEC", "indent-less" }, |
---|
202 | { GTK_HTML_COMMAND_PREV_CELL, "GTK_HTML_COMMAND_PREV_CELL", "prev-cell" }, |
---|
203 | { GTK_HTML_COMMAND_INDENT_PARAGRAPH, "GTK_HTML_COMMAND_INDENT_PARAGRAPH", "indent-paragraph" }, |
---|
204 | { GTK_HTML_COMMAND_BREAK_AND_FILL_LINE, "GTK_HTML_COMMAND_BREAK_AND_FILL_LINE", "break-and-fill" }, |
---|
205 | { GTK_HTML_COMMAND_SPACE_AND_FILL_LINE, "GTK_HTML_COMMAND_SPACE_AND_FILL_LINE", "space-and-fill" }, |
---|
206 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_NORMAL, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_NORMAL", "style-normal" }, |
---|
207 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H1, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H1", "style-header1" }, |
---|
208 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H2, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H2", "style-header2" }, |
---|
209 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H3, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H3", "style-header3" }, |
---|
210 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H4, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H4", "style-header4" }, |
---|
211 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H5, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H5", "style-header5" }, |
---|
212 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_H6, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_H6", "style-header6" }, |
---|
213 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_ADDRESS, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_ADDRESS", "style-address" }, |
---|
214 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_PRE, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_PRE", "style-pre" }, |
---|
215 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMDOTTED, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMDOTTED", "style-itemdot" }, |
---|
216 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMROMAN, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMROMAN", "style-itemroman" }, |
---|
217 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMDIGIT, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMDIGIT", "style-itemdigit" }, |
---|
218 | { GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMALPHA, "GTK_HTML_COMMAND_PARAGRAPH_STYLE_ITEMALPHA", "style-itemalpha" }, |
---|
219 | { GTK_HTML_COMMAND_MODIFY_SELECTION_UP, "GTK_HTML_COMMAND_MODIFY_SELECTION_UP", "selection-move-up" }, |
---|
220 | { GTK_HTML_COMMAND_MODIFY_SELECTION_DOWN, "GTK_HTML_COMMAND_MODIFY_SELECTION_DOWN", "selection-move-down" }, |
---|
221 | { GTK_HTML_COMMAND_MODIFY_SELECTION_LEFT, "GTK_HTML_COMMAND_MODIFY_SELECTION_LEFT", "selection-move-left" }, |
---|
222 | { GTK_HTML_COMMAND_MODIFY_SELECTION_RIGHT, "GTK_HTML_COMMAND_MODIFY_SELECTION_RIGHT", "selection-move-right" }, |
---|
223 | { GTK_HTML_COMMAND_MODIFY_SELECTION_BOL, "GTK_HTML_COMMAND_MODIFY_SELECTION_BOL", "selection-move-bol" }, |
---|
224 | { GTK_HTML_COMMAND_MODIFY_SELECTION_EOL, "GTK_HTML_COMMAND_MODIFY_SELECTION_EOL", "selection-move-eol" }, |
---|
225 | { GTK_HTML_COMMAND_MODIFY_SELECTION_BOD, "GTK_HTML_COMMAND_MODIFY_SELECTION_BOD", "selection-move-bod" }, |
---|
226 | { GTK_HTML_COMMAND_MODIFY_SELECTION_EOD, "GTK_HTML_COMMAND_MODIFY_SELECTION_EOD", "selection-move-eod" }, |
---|
227 | { GTK_HTML_COMMAND_MODIFY_SELECTION_PAGEUP, "GTK_HTML_COMMAND_MODIFY_SELECTION_PAGEUP", "selection-move-pageup" }, |
---|
228 | { GTK_HTML_COMMAND_MODIFY_SELECTION_PAGEDOWN, "GTK_HTML_COMMAND_MODIFY_SELECTION_PAGEDOWN", "selection-move-pagedown" }, |
---|
229 | { GTK_HTML_COMMAND_MODIFY_SELECTION_PREV_WORD, "GTK_HTML_COMMAND_MODIFY_SELECTION_PREV_WORD", "selection-move-prev-word" }, |
---|
230 | { GTK_HTML_COMMAND_MODIFY_SELECTION_NEXT_WORD, "GTK_HTML_COMMAND_MODIFY_SELECTION_NEXT_WORD", "selection-move-next-word" }, |
---|
231 | { GTK_HTML_COMMAND_SELECT_WORD, "GTK_HTML_COMMAND_SELECT_WORD", "select-word" }, |
---|
232 | { GTK_HTML_COMMAND_SELECT_LINE, "GTK_HTML_COMMAND_SELECT_LINE", "select-line" }, |
---|
233 | { GTK_HTML_COMMAND_SELECT_PARAGRAPH, "GTK_HTML_COMMAND_SELECT_PARAGRAPH", "select-paragraph" }, |
---|
234 | { GTK_HTML_COMMAND_SELECT_PARAGRAPH_EXTENDED, "GTK_HTML_COMMAND_SELECT_PARAGRAPH_EXTENDED", "select-paragraph-extended" }, |
---|
235 | { GTK_HTML_COMMAND_SELECT_ALL, "GTK_HTML_COMMAND_SELECT_ALL", "select-all" }, |
---|
236 | { GTK_HTML_COMMAND_CURSOR_POSITION_SAVE, "GTK_HTML_COMMAND_CURSOR_POSITION_SAVE", "cursor-position-save" }, |
---|
237 | { GTK_HTML_COMMAND_CURSOR_POSITION_RESTORE, "GTK_HTML_COMMAND_CURSOR_POSITION_RESTORE", "cursor-position-restore" }, |
---|
238 | { GTK_HTML_COMMAND_CAPITALIZE_WORD, "GTK_HTML_COMMAND_CAPITALIZE_WORD", "capitalize-word" }, |
---|
239 | { GTK_HTML_COMMAND_UPCASE_WORD, "GTK_HTML_COMMAND_UPCASE_WORD", "upcase-word" }, |
---|
240 | { GTK_HTML_COMMAND_DOWNCASE_WORD, "GTK_HTML_COMMAND_DOWNCASE_WORD", "downcase-word" }, |
---|
241 | { GTK_HTML_COMMAND_SPELL_SUGGEST, "GTK_HTML_COMMAND_SPELL_SUGGEST", "spell-suggest" }, |
---|
242 | { GTK_HTML_COMMAND_SPELL_PERSONAL_DICTIONARY_ADD, "GTK_HTML_COMMAND_SPELL_PERSONAL_DICTIONARY_ADD", "spell-personal-add" }, |
---|
243 | { GTK_HTML_COMMAND_SPELL_SESSION_DICTIONARY_ADD, "GTK_HTML_COMMAND_SPELL_SESSION_DICTIONARY_ADD", "spell-session-add" }, |
---|
244 | { GTK_HTML_COMMAND_SEARCH_INCREMENTAL_FORWARD, "GTK_HTML_COMMAND_SEARCH_INCREMENTAL_FORWARD", "isearch-forward" }, |
---|
245 | { GTK_HTML_COMMAND_SEARCH_INCREMENTAL_BACKWARD, "GTK_HTML_COMMAND_SEARCH_INCREMENTAL_BACKWARD", "isearch-backward" }, |
---|
246 | { GTK_HTML_COMMAND_SEARCH, "GTK_HTML_COMMAND_SEARCH", "search" }, |
---|
247 | { GTK_HTML_COMMAND_SEARCH_REGEX, "GTK_HTML_COMMAND_SEARCH_REGEX", "search-regex" }, |
---|
248 | { GTK_HTML_COMMAND_FOCUS_FORWARD, "GTK_HTML_COMMAND_FOCUS_FORWARD", "focus-forward" }, |
---|
249 | { GTK_HTML_COMMAND_FOCUS_BACKWARD, "GTK_HTML_COMMAND_FOCUS_BACKWARD", "focus-backward" }, |
---|
250 | { GTK_HTML_COMMAND_POPUP_MENU, "GTK_HTML_COMMAND_POPUP_MENU", "popup-menu" }, |
---|
251 | { GTK_HTML_COMMAND_PROPERTIES_DIALOG, "GTK_HTML_COMMAND_PROPERTIES_DIALOG", "property-dialog" }, |
---|
252 | { GTK_HTML_COMMAND_CURSOR_FORWARD, "GTK_HTML_COMMAND_CURSOR_FORWARD", "cursor-forward" }, |
---|
253 | { GTK_HTML_COMMAND_CURSOR_BACKWARD, "GTK_HTML_COMMAND_CURSOR_BACKWARD", "cursor-backward" }, |
---|
254 | { GTK_HTML_COMMAND_INSERT_TABLE_1_1, "GTK_HTML_COMMAND_INSERT_TABLE_1_1", "insert-table-1-1" }, |
---|
255 | { GTK_HTML_COMMAND_TABLE_INSERT_COL_AFTER, "GTK_HTML_COMMAND_TABLE_INSERT_COL_AFTER", "insert-col-after" }, |
---|
256 | { GTK_HTML_COMMAND_TABLE_INSERT_COL_BEFORE, "GTK_HTML_COMMAND_TABLE_INSERT_COL_BEFORE", "insert-col-before" }, |
---|
257 | { GTK_HTML_COMMAND_TABLE_INSERT_ROW_AFTER, "GTK_HTML_COMMAND_TABLE_INSERT_ROW_AFTER", "insert-row-after" }, |
---|
258 | { GTK_HTML_COMMAND_TABLE_INSERT_ROW_BEFORE, "GTK_HTML_COMMAND_TABLE_INSERT_ROW_BEFORE", "insert-row-before" }, |
---|
259 | { GTK_HTML_COMMAND_TABLE_DELETE_COL, "GTK_HTML_COMMAND_TABLE_DELETE_COL", "delete-col" }, |
---|
260 | { GTK_HTML_COMMAND_TABLE_DELETE_ROW, "GTK_HTML_COMMAND_TABLE_DELETE_ROW", "delete-row" }, |
---|
261 | { GTK_HTML_COMMAND_TABLE_CELL_INC_CSPAN, "GTK_HTML_COMMAND_TABLE_CELL_INC_CSPAN", "inc-cspan" }, |
---|
262 | { GTK_HTML_COMMAND_TABLE_CELL_DEC_CSPAN, "GTK_HTML_COMMAND_TABLE_CELL_DEC_CSPAN", "dec-cspan" }, |
---|
263 | { GTK_HTML_COMMAND_TABLE_CELL_INC_RSPAN, "GTK_HTML_COMMAND_TABLE_CELL_INC_RSPAN", "inc-rspan" }, |
---|
264 | { GTK_HTML_COMMAND_TABLE_CELL_DEC_RSPAN, "GTK_HTML_COMMAND_TABLE_CELL_DEC_RSPAN", "dec-rspan" }, |
---|
265 | { GTK_HTML_COMMAND_TABLE_CELL_JOIN_LEFT, "GTK_HTML_COMMAND_TABLE_CELL_JOIN_LEFT", "cell-join-left" }, |
---|
266 | { GTK_HTML_COMMAND_TABLE_CELL_JOIN_RIGHT, "GTK_HTML_COMMAND_TABLE_CELL_JOIN_RIGHT", "cell-join-right" }, |
---|
267 | { GTK_HTML_COMMAND_TABLE_CELL_JOIN_UP, "GTK_HTML_COMMAND_TABLE_CELL_JOIN_UP", "cell-join-up" }, |
---|
268 | { GTK_HTML_COMMAND_TABLE_CELL_JOIN_DOWN, "GTK_HTML_COMMAND_TABLE_CELL_JOIN_DOWN", "cell-join-down" }, |
---|
269 | { GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_INC, "GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_INC", "inc-border" }, |
---|
270 | { GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_DEC, "GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_DEC", "dec-border" }, |
---|
271 | { GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_ZERO, "GTK_HTML_COMMAND_TABLE_BORDER_WIDTH_ZERO", "zero-border" }, |
---|
272 | { GTK_HTML_COMMAND_TEXT_SET_DEFAULT_COLOR, "GTK_HTML_COMMAND_TEXT_SET_DEFAULT_COLOR", "text-default-color" }, |
---|
273 | { GTK_HTML_COMMAND_CURSOR_BOD, "GTK_HTML_COMMAND_CURSOR_BOD", "cursor-bod" }, |
---|
274 | { GTK_HTML_COMMAND_CURSOR_EOD, "GTK_HTML_COMMAND_CURSOR_EOD", "cursor-eod" }, |
---|
275 | { GTK_HTML_COMMAND_BLOCK_REDRAW, "GTK_HTML_COMMAND_BLOCK_REDRAW", "block-redraw" }, |
---|
276 | { GTK_HTML_COMMAND_UNBLOCK_REDRAW, "GTK_HTML_COMMAND_UNBLOCK_REDRAW", "unblock-redraw" }, |
---|
277 | { GTK_HTML_COMMAND_ZOOM_IN, "GTK_HTML_COMMAND_ZOOM_IN", "zoom-in" }, |
---|
278 | { GTK_HTML_COMMAND_ZOOM_OUT, "GTK_HTML_COMMAND_ZOOM_IN", "zoom-out" }, |
---|
279 | { GTK_HTML_COMMAND_ZOOM_RESET, "GTK_HTML_COMMAND_ZOOM_RESET", "zoom-reset" }, |
---|
280 | { GTK_HTML_COMMAND_TABLE_SPACING_INC, "GTK_HTML_COMMAND_TABLE_SPACING_INC", "inc-spacing" }, |
---|
281 | { GTK_HTML_COMMAND_TABLE_SPACING_DEC, "GTK_HTML_COMMAND_TABLE_SPACING_DEC", "dec-spacing" }, |
---|
282 | { GTK_HTML_COMMAND_TABLE_SPACING_ZERO, "GTK_HTML_COMMAND_TABLE_SPACING_ZERO", "zero-spacing" }, |
---|
283 | { GTK_HTML_COMMAND_TABLE_PADDING_INC, "GTK_HTML_COMMAND_TABLE_PADDING_INC", "inc-padding" }, |
---|
284 | { GTK_HTML_COMMAND_TABLE_PADDING_DEC, "GTK_HTML_COMMAND_TABLE_PADDING_DEC", "dec-padding" }, |
---|
285 | { GTK_HTML_COMMAND_TABLE_PADDING_ZERO, "GTK_HTML_COMMAND_TABLE_PADDING_ZERO", "zero-padding" }, |
---|
286 | { GTK_HTML_COMMAND_DELETE_TABLE, "GTK_HTML_COMMAND_DELETE_TABLE", "delete-table" }, |
---|
287 | { GTK_HTML_COMMAND_DELETE_TABLE_ROW, "GTK_HTML_COMMAND_DELETE_TABLE_ROW", "delete-table-row" }, |
---|
288 | { GTK_HTML_COMMAND_DELETE_TABLE_COLUMN, "GTK_HTML_COMMAND_DELETE_TABLE_COLUMN", "delete-table-column" }, |
---|
289 | { GTK_HTML_COMMAND_DELETE_TABLE_CELL_CONTENTS, "GTK_HTML_COMMAND_DELETE_TABLE_CELL_CONTENTS", "delete-cell-contents" }, |
---|
290 | { GTK_HTML_COMMAND_GRAB_FOCUS, "GTK_HTML_COMMAND_GRAB_FOCUS", "grab-focus" }, |
---|
291 | { GTK_HTML_COMMAND_KILL_WORD, "GTK_HTML_COMMAND_KILL_WORD", "kill-word" }, |
---|
292 | { GTK_HTML_COMMAND_KILL_WORD_BACKWARD, "GTK_HTML_COMMAND_KILL_WORD_BACKWARD", "backward-kill-word" }, |
---|
293 | { GTK_HTML_COMMAND_TEXT_COLOR_APPLY, "GTK_HTML_COMMAND_TEXT_COLOR_APPLY", "text-color-apply" }, |
---|
294 | { GTK_HTML_COMMAND_SAVE_DATA_ON, "GTK_HTML_COMMAND_SAVE_DATA_ON", "save-data-on" }, |
---|
295 | { GTK_HTML_COMMAND_SAVE_DATA_OFF, "GTK_HTML_COMMAND_SAVE_DATA_OFF", "save-data-off" }, |
---|
296 | { GTK_HTML_COMMAND_SAVED, "GTK_HTML_COMMAND_SAVED", "saved" }, |
---|
297 | { GTK_HTML_COMMAND_IS_SAVED, "GTK_HTML_COMMAND_IS_SAVED", "is-saved" }, |
---|
298 | { GTK_HTML_COMMAND_SCROLL_BOD, "GTK_HTML_COMMAND_SCROLL_BOD", "scroll-bod" }, |
---|
299 | { GTK_HTML_COMMAND_SCROLL_EOD, "GTK_HTML_COMMAND_SCROLL_EOD", "scroll-eod" }, |
---|
300 | { GTK_HTML_COMMAND_CELL_CSPAN_INC, "GTK_HTML_COMMAND_CELL_CSPAN_INC", "cspan-inc" }, |
---|
301 | { GTK_HTML_COMMAND_CELL_RSPAN_INC, "GTK_HTML_COMMAND_CELL_RSPAN_INC", "rspan-inc" }, |
---|
302 | { GTK_HTML_COMMAND_CELL_CSPAN_DEC, "GTK_HTML_COMMAND_CELL_CSPAN_DEC", "cspan-dec" }, |
---|
303 | { GTK_HTML_COMMAND_CELL_RSPAN_DEC, "GTK_HTML_COMMAND_CELL_RSPAN_DEC", "rspan-dec" }, |
---|
304 | { GTK_HTML_COMMAND_EDITABLE_ON, "GTK_HTML_COMMAND_EDITABLE_ON", "editable-on" }, |
---|
305 | { GTK_HTML_COMMAND_EDITABLE_OFF, "GTK_HTML_COMMAND_EDITABLE_OFF", "editable-off" }, |
---|
306 | { 0, NULL, NULL } |
---|
307 | }; |
---|
308 | |
---|
309 | GType |
---|
310 | gtk_html_command_get_type () |
---|
311 | { |
---|
312 | static GType command_type = 0; |
---|
313 | |
---|
314 | if (!command_type) |
---|
315 | command_type = g_enum_register_static ("GTK_HTML_COMMAND", _gtk_html_command_values); |
---|
316 | |
---|
317 | return command_type; |
---|
318 | } |
---|