as for current usecases it's not needed and just overhead, patch gconf-support out...
[openwrt/svn-archive/archive.git] / Xorg / lib / gtkhtml / patches / 010-disable-gconf.patch
1 --- gtkhtml-3.29.1/gtkhtml/gtkhtml.c 2009-10-26 07:49:58.000000000 +0100
2 +++ gtkhtml-3.29.1.mod/gtkhtml/gtkhtml.c 2009-11-22 12:46:18.000000000 +0100
3 @@ -128,8 +128,8 @@
4
5 static GtkLayoutClass *parent_class = NULL;
6
7 -static GConfClient *gconf_client = NULL;
8 -static GError *gconf_error = NULL;
9 +//static GConfClient *gconf_client = NULL;
10 +//static GError *gconf_error = NULL;
11
12 enum {
13 TITLE_CHANGED,
14 @@ -791,7 +791,7 @@
15 }
16
17 if (html->priv->notify_monospace_font_id) {
18 - gconf_client_notify_remove (gconf_client, html->priv->notify_monospace_font_id);
19 + //gconf_client_notify_remove (gconf_client, html->priv->notify_monospace_font_id);
20 html->priv->notify_monospace_font_id = 0;
21 }
22
23 @@ -832,61 +832,64 @@
24 static cairo_font_options_t *
25 get_font_options (void)
26 {
27 - gchar *antialiasing, *hinting, *subpixel_order;
28 - GConfClient *gconf = gconf_client_get_default ();
29 + //gchar *antialiasing, *hinting, *subpixel_order;
30 + //GConfClient *gconf = gconf_client_get_default ();
31 cairo_font_options_t *font_options = cairo_font_options_create ();
32
33 /* Antialiasing */
34 - antialiasing = gconf_client_get_string (gconf,
35 - "/desktop/gnome/font_rendering/antialiasing", NULL);
36 - if (antialiasing == NULL) {
37 - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
38 - } else {
39 - if (strcmp (antialiasing, "grayscale") == 0)
40 - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
41 - else if (strcmp (antialiasing, "rgba") == 0)
42 - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL);
43 - else if (strcmp (antialiasing, "none") == 0)
44 - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE);
45 - else
46 - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
47 - }
48 - hinting = gconf_client_get_string (gconf,
49 - "/desktop/gnome/font_rendering/hinting", NULL);
50 - if (hinting == NULL) {
51 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
52 - } else {
53 - if (strcmp (hinting, "full") == 0)
54 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_FULL);
55 - else if (strcmp (hinting, "medium") == 0)
56 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_MEDIUM);
57 - else if (strcmp (hinting, "slight") == 0)
58 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_SLIGHT);
59 - else if (strcmp (hinting, "none") == 0)
60 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
61 - else
62 - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
63 - }
64 - subpixel_order = gconf_client_get_string (gconf,
65 - "/desktop/gnome/font_rendering/rgba_order", NULL);
66 - if (subpixel_order == NULL) {
67 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
68 - } else {
69 - if (strcmp (subpixel_order, "rgb") == 0)
70 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB);
71 - else if (strcmp (subpixel_order, "bgr") == 0)
72 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_BGR);
73 - else if (strcmp (subpixel_order, "vrgb") == 0)
74 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VRGB);
75 - else if (strcmp (subpixel_order, "vbgr") == 0)
76 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VBGR);
77 - else
78 - cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
79 - }
80 - g_free (antialiasing);
81 - g_free (hinting);
82 - g_free (subpixel_order);
83 - g_object_unref (gconf);
84 + //antialiasing = gconf_client_get_string (gconf,
85 + // "/desktop/gnome/font_rendering/antialiasing", NULL);
86 + //if (antialiasing == NULL) {
87 + // cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
88 + //} else {
89 + // if (strcmp (antialiasing, "grayscale") == 0)
90 + // cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
91 + // else if (strcmp (antialiasing, "rgba") == 0)
92 + // cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL);
93 + // else if (strcmp (antialiasing, "none") == 0)
94 + // cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE);
95 + // else
96 + // cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
97 + //}
98 + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
99 + //hinting = gconf_client_get_string (gconf,
100 + // "/desktop/gnome/font_rendering/hinting", NULL);
101 + //if (hinting == NULL) {
102 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
103 + //} else {
104 + // if (strcmp (hinting, "full") == 0)
105 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_FULL);
106 + // else if (strcmp (hinting, "medium") == 0)
107 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_MEDIUM);
108 + // else if (strcmp (hinting, "slight") == 0)
109 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_SLIGHT);
110 + // else if (strcmp (hinting, "none") == 0)
111 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
112 + // else
113 + // cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
114 + //}
115 + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
116 + //subpixel_order = gconf_client_get_string (gconf,
117 + // "/desktop/gnome/font_rendering/rgba_order", NULL);
118 + //if (subpixel_order == NULL) {
119 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
120 + //} else {
121 + // if (strcmp (subpixel_order, "rgb") == 0)
122 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB);
123 + // else if (strcmp (subpixel_order, "bgr") == 0)
124 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_BGR);
125 + // else if (strcmp (subpixel_order, "vrgb") == 0)
126 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VRGB);
127 + // else if (strcmp (subpixel_order, "vbgr") == 0)
128 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VBGR);
129 + // else
130 + // cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
131 + //}
132 + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
133 + //g_free (antialiasing);
134 + //g_free (hinting);
135 + //g_free (subpixel_order);
136 + //g_object_unref (gconf);
137 return font_options;
138 }
139
140 @@ -913,36 +916,36 @@
141 font_var_points = !pango_font_description_get_size_is_absolute (style->font_desc);
142
143 gtk_widget_style_get (GTK_WIDGET (top_level), "fixed_font_name", &fixed_name, NULL);
144 - if (fixed_name) {
145 - fixed_desc = pango_font_description_from_string (fixed_name);
146 - if (pango_font_description_get_family (fixed_desc)) {
147 - fixed_size = pango_font_description_get_size (fixed_desc);
148 - fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc);
149 - fixed_family = pango_font_description_get_family (fixed_desc);
150 - } else {
151 - g_free (fixed_name);
152 - fixed_name = NULL;
153 - }
154 - }
155 -
156 - if (!fixed_name) {
157 - GConfClient *gconf;
158 -
159 - gconf = gconf_client_get_default ();
160 - fixed_name = gconf_client_get_string (gconf, "/desktop/gnome/interface/monospace_font_name", NULL);
161 - if (fixed_name) {
162 - fixed_desc = pango_font_description_from_string (fixed_name);
163 - if (fixed_desc) {
164 - fixed_size = pango_font_description_get_size (fixed_desc);
165 - fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc);
166 - fixed_family = pango_font_description_get_family (fixed_desc);
167 - } else {
168 - g_free (fixed_name);
169 - fixed_name = NULL;
170 - }
171 - }
172 - g_object_unref (gconf);
173 - }
174 + //if (fixed_name) {
175 + // fixed_desc = pango_font_description_from_string (fixed_name);
176 + // if (pango_font_description_get_family (fixed_desc)) {
177 + // fixed_size = pango_font_description_get_size (fixed_desc);
178 + // fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc);
179 + // fixed_family = pango_font_description_get_family (fixed_desc);
180 + // } else {
181 + // g_free (fixed_name);
182 + // fixed_name = NULL;
183 + // }
184 + //}
185 +
186 + //if (!fixed_name) {
187 + // //GConfClient *gconf;
188 +
189 + // //gconf = gconf_client_get_default ();
190 + // //fixed_name = gconf_client_get_string (gconf, "/desktop/gnome/interface/monospace_font_name", NULL);
191 + // if (fixed_name) {
192 + // fixed_desc = pango_font_description_from_string (fixed_name);
193 + // if (fixed_desc) {
194 + // fixed_size = pango_font_description_get_size (fixed_desc);
195 + // fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc);
196 + // fixed_family = pango_font_description_get_family (fixed_desc);
197 + // } else {
198 + // g_free (fixed_name);
199 + // fixed_name = NULL;
200 + // }
201 + // }
202 + // //g_object_unref (gconf);
203 + //}
204
205 if (!fixed_name) {
206 fixed_family = "Monospace";
207 @@ -2365,22 +2368,22 @@
208 if (!klass->properties) {
209 klass->properties = gtk_html_class_properties_new (GTK_WIDGET (html));
210
211 - if (!gconf_is_initialized ()) {
212 - gchar *argv[] = { (gchar *) "gtkhtml", NULL };
213 + //if (!gconf_is_initialized ()) {
214 + // gchar *argv[] = { (gchar *) "gtkhtml", NULL };
215
216 - g_warning ("gconf is not initialized, please call gconf_init before using GtkHTML library. "
217 - "Meanwhile it's initialized by gtkhtml itself.");
218 - gconf_init (1, argv, &gconf_error);
219 - if (gconf_error)
220 - g_error ("gconf error: %s\n", gconf_error->message);
221 - }
222 -
223 - gconf_client = gconf_client_get_default ();
224 - if (!gconf_client)
225 - g_error ("cannot create gconf_client\n");
226 - gconf_client_add_dir (gconf_client, GTK_HTML_GCONF_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
227 - if (gconf_error)
228 - g_error ("gconf error: %s\n", gconf_error->message);
229 + // g_warning ("gconf is not initialized, please call gconf_init before using GtkHTML library. "
230 + // "Meanwhile it's initialized by gtkhtml itself.");
231 + // //gconf_init (1, argv, &gconf_error);
232 + // //if (gconf_error)
233 + // // g_error ("gconf error: %s\n", gconf_error->message);
234 + //}
235 +
236 + //gconf_client = gconf_client_get_default ();
237 + //if (!gconf_client)
238 + // g_error ("cannot create gconf_client\n");
239 + //gconf_client_add_dir (gconf_client, GTK_HTML_GCONF_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
240 + //if (gconf_error)
241 + // g_error ("gconf error: %s\n", gconf_error->message);
242 }
243 }
244
245 @@ -2748,41 +2751,41 @@
246
247 /* dnd end */
248
249 -static void
250 -read_key_theme (GtkHTMLClass *html_class)
251 -{
252 - gchar *key_theme;
253 -
254 - key_theme = gconf_client_get_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_key_theme", NULL);
255 - html_class->use_emacs_bindings = key_theme && !strcmp (key_theme, "Emacs");
256 - g_free (key_theme);
257 -}
258 -
259 -static void
260 -client_notify_key_theme (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
261 -{
262 - read_key_theme ((GtkHTMLClass *) data);
263 -}
264 -
265 -static void
266 -client_notify_monospace_font (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
267 -{
268 - GtkHTML *html = (GtkHTML *) data;
269 - HTMLEngine *e = html->engine;
270 - if (e && e->painter) {
271 - gtk_html_set_fonts (html, e->painter);
272 - html_engine_refresh_fonts (e);
273 - }
274 -}
275 -
276 -static void
277 -client_notify_cursor_blink (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
278 -{
279 - if (gconf_client_get_bool (client, "/desktop/gnome/interface/cursor_blink", NULL))
280 - html_engine_set_cursor_blink_timeout (gconf_client_get_int (client, "/desktop/gnome/interface/cursor_blink_time", NULL) / 2);
281 - else
282 - html_engine_set_cursor_blink_timeout (0);
283 -}
284 +//static void
285 +//read_key_theme (GtkHTMLClass *html_class)
286 +//{
287 +// gchar *key_theme;
288 +//
289 +// key_theme = gconf_client_get_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_key_theme", NULL);
290 +// html_class->use_emacs_bindings = key_theme && !strcmp (key_theme, "Emacs");
291 +// g_free (key_theme);
292 +//}
293 +
294 +//static void
295 +//client_notify_key_theme (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
296 +//{
297 +// read_key_theme ((GtkHTMLClass *) data);
298 +//}
299 +
300 +//static void
301 +//client_notify_monospace_font (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
302 +//{
303 +// GtkHTML *html = (GtkHTML *) data;
304 +// HTMLEngine *e = html->engine;
305 +// if (e && e->painter) {
306 +// gtk_html_set_fonts (html, e->painter);
307 +// html_engine_refresh_fonts (e);
308 +// }
309 +//}
310 +
311 +//static void
312 +//client_notify_cursor_blink (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
313 +//{
314 +// if (gconf_client_get_bool (client, "/desktop/gnome/interface/cursor_blink", NULL))
315 +// html_engine_set_cursor_blink_timeout (gconf_client_get_int (client, "/desktop/gnome/interface/cursor_blink_time", NULL) / 2);
316 +// else
317 +// html_engine_set_cursor_blink_timeout (0);
318 +//}
319
320 static void
321 gtk_html_direction_changed (GtkWidget *widget, GtkTextDirection previous_dir)
322 @@ -2823,7 +2826,7 @@
323 GtkLayoutClass *layout_class;
324 GtkContainerClass *container_class;
325 gchar *filename;
326 - GConfClient *client;
327 + //GConfClient *client;
328
329 html_class = (GtkHTMLClass *) klass;
330 #ifdef USE_PROPS
331 @@ -3176,18 +3179,18 @@
332 gtk_rc_parse (filename);
333 g_free (filename);
334 html_class->emacs_bindings = gtk_binding_set_find ("gtkhtml-bindings-emacs");
335 - read_key_theme (html_class);
336 + //read_key_theme (html_class);
337
338 - client = gconf_client_get_default ();
339 + //client = gconf_client_get_default ();
340
341 - gconf_client_notify_add (client, "/desktop/gnome/interface/gtk_key_theme",
342 - client_notify_key_theme, html_class, NULL, &gconf_error);
343 + //gconf_client_notify_add (client, "/desktop/gnome/interface/gtk_key_theme",
344 + // client_notify_key_theme, html_class, NULL, &gconf_error);
345
346 - gconf_client_notify_add (client, "/desktop/gnome/interface/cursor_blink", client_notify_cursor_blink, NULL, NULL, NULL);
347 - gconf_client_notify_add (client, "/desktop/gnome/interface/cursor_blink_time", client_notify_cursor_blink, NULL, NULL, NULL);
348 - client_notify_cursor_blink (client, 0, NULL, NULL);
349 + //gconf_client_notify_add (client, "/desktop/gnome/interface/cursor_blink", client_notify_cursor_blink, NULL, NULL, NULL);
350 + //gconf_client_notify_add (client, "/desktop/gnome/interface/cursor_blink_time", client_notify_cursor_blink, NULL, NULL, NULL);
351 + //client_notify_cursor_blink (client, 0, NULL, NULL);
352
353 - g_object_unref (client);
354 + //g_object_unref (client);
355 }
356
357 static void
358 @@ -3195,8 +3198,8 @@
359 {
360 setup_class_properties (html);
361
362 - if (!gconf_client)
363 - gconf_client = gconf_client_get_default ();
364 + //if (!gconf_client)
365 + // gconf_client = gconf_client_get_default ();
366
367 }
368
369 @@ -3478,9 +3481,9 @@
370 g_signal_connect (G_OBJECT (html->priv->im_context), "delete_surrounding",
371 G_CALLBACK (gtk_html_im_delete_surrounding_cb), html);
372
373 - html->priv->notify_monospace_font_id =
374 - gconf_client_notify_add (gconf_client_get_default (), "/desktop/gnome/interface/monospace_font_name",
375 - client_notify_monospace_font, html, NULL, &gconf_error);
376 + //html->priv->notify_monospace_font_id =
377 + // gconf_client_notify_add (gconf_client_get_default (), "/desktop/gnome/interface/monospace_font_name",
378 + // client_notify_monospace_font, html, NULL, &gconf_error);
379
380 gtk_html_construct (html);
381 }
382 @@ -3579,7 +3582,7 @@
383 g_signal_connect (G_OBJECT (html->engine), "object_requested",
384 G_CALLBACK (html_engine_object_requested_cb), html);
385
386 - init_properties_widget (html);
387 + //init_properties_widget (html);
388 }
389
390 \f
391 @@ -6044,7 +6047,7 @@
392 gboolean
393 gtk_html_build_with_gconf (void)
394 {
395 - return TRUE;
396 + return FALSE;
397 }
398
399 static void
400 --- gtkhtml-3.29.1/gtkhtml/gtkhtml-properties.h 2009-06-26 13:14:48.000000000 +0200
401 +++ gtkhtml-3.29.1.mod/gtkhtml/gtkhtml-properties.h 2009-11-22 12:20:54.000000000 +0100
402 @@ -27,7 +27,7 @@
403 #define GTK_HTML_GNOME_CONFIG_PREFIX "/gtkhtml/Settings/"
404
405 #include <gtk/gtk.h>
406 -#include <gconf/gconf-client.h>
407 +//#include <gconf/gconf-client.h>
408
409 #include "gtkhtml-types.h"
410 #include "gtkhtml.h"
411 @@ -51,11 +51,11 @@
412 void gtk_html_class_properties_destroy (GtkHTMLClassProperties *p);
413 void gtk_html_class_properties_copy (GtkHTMLClassProperties *p1,
414 GtkHTMLClassProperties *p2);
415 -void gtk_html_class_properties_load (GtkHTMLClassProperties *p,
416 - GConfClient *client);
417 -void gtk_html_class_properties_update (GtkHTMLClassProperties *p,
418 - GConfClient *client,
419 - GtkHTMLClassProperties *old);
420 +//void gtk_html_class_properties_load (GtkHTMLClassProperties *p,
421 +// GConfClient *client);
422 +//void gtk_html_class_properties_update (GtkHTMLClassProperties *p,
423 +// GConfClient *client,
424 +// GtkHTMLClassProperties *old);
425
426 /* enum types */
427
428 --- gtkhtml-3.29.1/gtkhtml/gtkhtml-properties.c 2009-10-23 12:26:15.000000000 +0200
429 +++ gtkhtml-3.29.1.mod/gtkhtml/gtkhtml-properties.c 2009-12-11 00:57:25.000000000 +0100
430 @@ -102,20 +102,20 @@
431 g_free (p);
432 }
433
434 -void
435 -gtk_html_class_properties_load (GtkHTMLClassProperties *p, GConfClient *client)
436 -{
437 -}
438 +//void
439 +//gtk_html_class_properties_load (GtkHTMLClassProperties *p, GConfClient *client)
440 +//{
441 +//}
442
443 #define SET(t,x,prop) \
444 { key = g_strconcat (GTK_HTML_GCONF_DIR, x, NULL); \
445 gconf_client_set_ ## t (client, key, p->prop, NULL); \
446 g_free (key); }
447
448 -void
449 -gtk_html_class_properties_update (GtkHTMLClassProperties *p, GConfClient *client, GtkHTMLClassProperties *old)
450 -{
451 -}
452 +//void
453 +//gtk_html_class_properties_update (GtkHTMLClassProperties *p, GConfClient *client, GtkHTMLClassProperties *old)
454 +//{
455 +//}
456
457 /* enums */
458