]> git.pld-linux.org Git - packages/obconf.git/blob - openbox35.patch
- fix building with openbox 3.5
[packages/obconf.git] / openbox35.patch
1 commit 42b0ea6c275835bee09e83a2e83dfb934825aa8a
2 Author: Dana Jansens <danakj@orodu.net>
3 Date:   Mon Dec 21 13:01:55 2009 -0500
4
5     Use the openbox 3.5 libs
6
7 diff --git a/configure.ac b/configure.ac
8 index bae2dfb..f9b0775 100644
9 --- a/configure.ac
10 +++ b/configure.ac
11 @@ -1,5 +1,5 @@
12  AC_PREREQ([2.54])
13 -AC_INIT([obconf], [2.0.3], [http://bugzilla.icculus.org])
14 +AC_INIT([obconf], [2.0.4], [http://bugzilla.icculus.org])
15  AM_INIT_AUTOMAKE
16  AC_CONFIG_SRCDIR([src/main.c])
17  
18 @@ -20,7 +20,7 @@ ALL_LINGUAS=""
19  AM_GNU_GETTEXT_VERSION(0.15)
20  AM_GNU_GETTEXT([external])
21  
22 -PKG_CHECK_MODULES(OPENBOX, [obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2])
23 +PKG_CHECK_MODULES(OPENBOX, [obrender-3.5 obt-3.5])
24  AC_SUBST(OPENBOX_CFLAGS)
25  AC_SUBST(OPENBOX_LIBS)
26  
27 diff --git a/src/desktops.c b/src/desktops.c
28 index d7e9811..f1f0021 100644
29 --- a/src/desktops.c
30 +++ b/src/desktops.c
31 @@ -156,7 +156,7 @@ static void desktops_read_names()
32          gchar *name;
33  
34          if (!xmlStrcmp(n->name, (const xmlChar*)"name")) {
35 -            name = parse_string(doc, n);
36 +            name = obt_parse_node_string(n);
37  
38              desktop_names = g_list_append(desktop_names, name);
39  
40 diff --git a/src/main.c b/src/main.c
41 index 7083730..875b783 100644
42 --- a/src/main.c
43 +++ b/src/main.c
44 @@ -42,6 +42,8 @@ xmlDocPtr doc;
45  xmlNodePtr root;
46  RrInstance *rrinst;
47  gchar *obc_config_file = NULL;
48 +ObtPaths *paths;
49 +ObtParseInst *parse_i;
50  
51  static gchar *obc_theme_install = NULL;
52  static gchar *obc_theme_archive = NULL;
53 @@ -214,7 +216,8 @@ int main(int argc, char **argv)
54          exit_with_error = TRUE;
55      }
56  
57 -    parse_paths_startup();
58 +    paths = obt_paths_new();
59 +    parse_i = obt_parse_instance_new();
60      rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen());
61  
62      if (!obc_config_file) {
63 @@ -230,10 +233,19 @@ int main(int argc, char **argv)
64      }
65  
66      xmlIndentTreeOutput = 1;
67 -    if (!parse_load_rc(obc_config_file, &doc, &root)) {
68 +    if (!obt_parse_load_config_file(parse_i,
69 +                                    "openbox",
70 +                                    (obc_config_file ?
71 +                                     obc_config_file : "rc.xml"),
72 +                                    "openbox_config"))
73 +    {
74          obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
75          exit_with_error = TRUE;
76      }
77 +    else {
78 +        doc = obt_parse_doc(parse_i);
79 +        root = obt_parse_root(parse_i);
80 +    }
81  
82      /* look for parsing errors */
83      {
84 @@ -290,7 +302,8 @@ int main(int argc, char **argv)
85      }
86  
87      RrInstanceFree(rrinst);
88 -    parse_paths_shutdown();
89 +    obt_parse_instance_unref(parse_i);
90 +    obt_paths_unref(paths);
91  
92      xmlFreeDoc(doc);
93      return 0;
94 diff --git a/src/main.h b/src/main.h
95 index 7d6303c..2c06630 100644
96 --- a/src/main.h
97 +++ b/src/main.h
98 @@ -19,19 +19,20 @@
99  #ifndef obconf__main_h
100  #define obconf__main_h
101  
102 -#include <openbox/render.h>
103 -#include <openbox/instance.h>
104 -#include <openbox/parse.h>
105 +#include <obrender/render.h>
106 +#include <obrender/instance.h>
107 +#include <obt/parse.h>
108 +#include <obt/paths.h>
109  
110  #include <gtk/gtk.h>
111  #include <glade/glade-xml.h>
112  
113  extern GladeXML *glade;
114 -extern xmlDocPtr doc;
115 -extern xmlNodePtr root;
116  extern RrInstance *rrinst;
117  extern GtkWidget *mainwin;
118  extern gchar *obc_config_file;
119 +extern ObtPaths *paths;
120 +extern ObtParseInst *parse_i;
121  
122  #define get_widget(s) glade_xml_get_widget(glade, s)
123  
124 diff --git a/src/mouse.c b/src/mouse.c
125 index 68d9c55..831e2e5 100644
126 --- a/src/mouse.c
127 +++ b/src/mouse.c
128 @@ -19,7 +19,7 @@
129  #include "main.h"
130  #include "tree.h"
131  #include "gettext.h"
132 -#include <openbox/parse.h>
133 +#include <obt/parse.h>
134  
135  static gboolean   mapping = FALSE;
136  static xmlNodePtr saved_custom = NULL;
137 @@ -206,9 +206,9 @@ static gint read_doubleclick_action()
138  
139      while (n) {
140          if (!xmlStrcmp(n->name, (const xmlChar*)"action")) {
141 -            if (parse_attr_contains("ToggleMaximizeFull", n, "name"))
142 +            if (obt_parse_attr_contains(n, "name", "ToggleMaximizeFull"))
143                  ++max;
144 -            else if (parse_attr_contains("ToggleShade", n, "name"))
145 +            else if (obt_parse_attr_contains(n, "name", "ToggleShade"))
146                  ++shade;
147              else
148                  ++other;
149 diff --git a/src/preview.c b/src/preview.c
150 index 7e463a8..a82cf15 100644
151 --- a/src/preview.c
152 +++ b/src/preview.c
153 @@ -23,7 +23,7 @@
154  
155  #include <string.h>
156  
157 -#include <openbox/theme.h>
158 +#include <obrender/theme.h>
159  
160  #define PADDING 2 /* openbox does it :/ */
161  
162 @@ -491,7 +491,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
163                           RrFont *inactive_window_font,
164                           RrFont *menu_title_font,
165                           RrFont *menu_item_font,
166 -                         RrFont *osd_font)
167 +                         RrFont *osd_active_font,
168 +                         RrFont *osd_inactive_font)
169  {
170  
171      GdkPixbuf *preview;
172 @@ -505,7 +506,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
173  
174      RrTheme *theme = RrThemeNew(rrinst, name, FALSE,
175                                  active_window_font, inactive_window_font,
176 -                                menu_title_font, menu_item_font, osd_font);
177 +                                menu_title_font, menu_item_font,
178 +                                osd_active_font, osd_inactive_font);
179      if (!theme)
180          return NULL;
181  
182 diff --git a/src/preview.h b/src/preview.h
183 index ff43766..772984b 100644
184 --- a/src/preview.h
185 +++ b/src/preview.h
186 @@ -21,7 +21,7 @@
187  
188  #include <glib.h>
189  
190 -#include <openbox/font.h>
191 +#include <obrender/font.h>
192  #include <gdk/gdkpixbuf.h>
193  
194  GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
195 @@ -29,6 +29,7 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
196                           RrFont *inactive_window_font,
197                           RrFont *menu_title_font,
198                           RrFont *menu_item_font,
199 -                         RrFont *osd_font);
200 +                         RrFont *osd_active_font,
201 +                         RrFont *osd_inactive_font);
202  
203  #endif
204 diff --git a/src/preview_update.h b/src/preview_update.h
205 index 1fe9674..5163174 100644
206 --- a/src/preview_update.h
207 +++ b/src/preview_update.h
208 @@ -1,7 +1,7 @@
209  #ifndef obconf__preview_update_h
210  #define obconf__preview_update_h
211  
212 -#include <openbox/render.h>
213 +#include <obrender/render.h>
214  #include <gtk/gtk.h>
215  
216  void preview_update_all();
217 diff --git a/src/theme.c b/src/theme.c
218 index 093dc21..70206f9 100644
219 --- a/src/theme.c
220 +++ b/src/theme.c
221 @@ -193,7 +193,7 @@ void theme_load_all()
222  
223      {
224          GSList *it;
225 -        for (it = parse_xdg_data_dir_paths(); it; it = g_slist_next(it)) {
226 +        for (it = obt_paths_data_dirs(paths); it; it = g_slist_next(it)) {
227              p = g_build_filename(it->data, "themes", NULL);
228              add_theme_dir(p);
229              g_free(p);
230 diff --git a/src/tree.c b/src/tree.c
231 index 2c0f2dc..2b39840 100644
232 --- a/src/tree.c
233 +++ b/src/tree.c
234 @@ -19,7 +19,7 @@
235  #include "tree.h"
236  #include "main.h"
237  
238 -#include <openbox/parse.h>
239 +#include <obt/parse.h>
240  #include <gdk/gdkx.h>
241  
242  xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
243 @@ -28,7 +28,7 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
244      gchar **nodes;
245      gchar **it, **next;
246  
247 -    n = root;
248 +    n = obt_parse_root(parse_i);
249  
250      nodes = g_strsplit(path, "/", 0);
251      for (it = nodes; *it; it = next) {
252 @@ -39,19 +39,19 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
253          next = it + 1;
254  
255          /* match attributes */
256 -        c = parse_find_node(attrs[0], n->children);
257 +        c = obt_parse_find_node(n->children, attrs[0]);
258          while (c && !ok) {
259              gint i;
260  
261              ok = TRUE;
262              for (i = 1; attrs[i]; ++i) {
263                  gchar **eq = g_strsplit(attrs[i], "=", 2);
264 -                if (eq[1] && !parse_attr_contains(eq[1], c, eq[0]))
265 +                if (eq[1] && !obt_parse_attr_contains(c, eq[0], eq[1]))
266                      ok = FALSE;
267                  g_strfreev(eq);
268              }
269              if (!ok)
270 -                c = parse_find_node(attrs[0], c->next);
271 +                c = obt_parse_find_node(c->next, attrs[0]);
272          }
273  
274          if (!c) {
275 @@ -76,6 +76,15 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
276      return n;
277  }
278  
279 +void tree_delete_node(const gchar *path)
280 +{
281 +    xmlNodePtr n;
282 +
283 +    n = tree_get_node(path, NULL);
284 +    xmlUnlinkNode(n);
285 +    xmlFreeNode(n);
286 +}
287 +
288  void tree_apply()
289  {
290      gchar *p, *d;
291 @@ -84,15 +93,14 @@ void tree_apply()
292      if (obc_config_file)
293          p = g_strdup(obc_config_file);
294      else
295 -        p = g_build_filename(parse_xdg_config_home_path(), "openbox",
296 +        p = g_build_filename(obt_paths_config_home(paths), "openbox",
297                               "rc.xml", NULL);
298  
299      d = g_path_get_dirname(p);
300 -    parse_mkdir_path(d, 0700);
301 +    obt_paths_mkdir_path(d, 0700);
302      g_free(d);
303  
304 -    err = xmlSaveFormatFile(p, doc, 1) == -1;
305 -    if (err) {
306 +    if (!obt_parse_save_file(parse_i, p, TRUE)) {
307          gchar *s;
308          s = g_strdup_printf("An error occured while saving the "
309                              "config file '%s'", p);
310 @@ -158,7 +166,7 @@ gchar* tree_get_string(const gchar *node, const gchar *def)
311      xmlNodePtr n;
312  
313      n = tree_get_node(node, def);
314 -    return parse_string(doc, n);
315 +    return obt_parse_node_string(n);
316  }
317  
318  gint tree_get_int(const gchar *node, gint def)
319 @@ -169,7 +177,7 @@ gint tree_get_int(const gchar *node, gint def)
320      d = g_strdup_printf("%d", def);
321      n = tree_get_node(node, d);
322      g_free(d);
323 -    return parse_int(doc, n);
324 +    return obt_parse_node_int(n);
325  }
326  
327  gboolean tree_get_bool(const gchar *node, gboolean def)
328 @@ -177,5 +185,5 @@ gboolean tree_get_bool(const gchar *node, gboolean def)
329      xmlNodePtr n;
330  
331      n = tree_get_node(node, (def ? "yes" : "no"));
332 -    return parse_bool(doc, n);
333 +    return obt_parse_node_bool(n);
334  }
335 diff --git a/src/tree.h b/src/tree.h
336 index 39c96b3..62a20c8 100644
337 --- a/src/tree.h
338 +++ b/src/tree.h
339 @@ -19,10 +19,12 @@
340  #ifndef obconf__tree_h
341  #define obconf__tree_h
342  
343 -#include "openbox/parse.h"
344 +#include <obt/parse.h>
345  
346  xmlNodePtr tree_get_node(const gchar *path, const gchar *def);
347  
348 +void tree_delete_node(const gchar *path);
349 +
350  gchar* tree_get_string(const gchar *node, const gchar *def);
351  gint tree_get_int(const gchar *node, gint def);
352  gboolean tree_get_bool(const gchar *node, gboolean def);
353 commit 0e1a17d18a4ddc008463a4e5290f5748d416723f
354 Author: Dana Jansens <danakj@orodu.net>
355 Date:   Mon Dec 21 13:02:09 2009 -0500
356
357     Add the Inactive OSD font, and the primaryMonitor options
358
359 diff --git a/src/appearance.c b/src/appearance.c
360 index 293e43f..f130311 100644
361 --- a/src/appearance.c
362 +++ b/src/appearance.c
363 @@ -23,7 +23,7 @@
364  
365  static gboolean mapping = FALSE;
366  
367 -static RrFont *read_font(GtkFontButton *w, const gchar *place);
368 +static RrFont *read_font(GtkFontButton *w, const gchar *place, gboolean def);
369  static RrFont *write_font(GtkFontButton *w, const gchar *place);
370  
371  void appearance_setup_tab()
372 @@ -49,24 +49,31 @@ void appearance_setup_tab()
373      g_free(layout);
374  
375      w = get_widget("font_active");
376 -    f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow");
377 +    f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow", TRUE);
378      preview_update_set_active_font(f);
379  
380      w = get_widget("font_inactive");
381 -    f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow");
382 +    f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow", TRUE);
383      preview_update_set_inactive_font(f);
384  
385      w = get_widget("font_menu_header");
386 -    f = read_font(GTK_FONT_BUTTON(w), "MenuHeader");
387 +    f = read_font(GTK_FONT_BUTTON(w), "MenuHeader", TRUE);
388      preview_update_set_menu_header_font(f);
389  
390      w = get_widget("font_menu_item");
391 -    f = read_font(GTK_FONT_BUTTON(w), "MenuItem");
392 +    f = read_font(GTK_FONT_BUTTON(w), "MenuItem", TRUE);
393      preview_update_set_menu_item_font(f);
394  
395 -    w = get_widget("font_display");
396 -    f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay");
397 -    preview_update_set_osd_font(f);
398 +    w = get_widget("font_active_display");
399 +    if (!(f = read_font(GTK_FONT_BUTTON(w), "ActiveOnScreenDisplay", FALSE))) {
400 +        f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay", TRUE);
401 +        tree_delete_node("theme/font:place=OnScreenDisplay");
402 +    }
403 +    preview_update_set_osd_active_font(f);
404 +
405 +    w = get_widget("font_inactive_display");
406 +    f = read_font(GTK_FONT_BUTTON(w), "InactiveOnScreenDisplay", TRUE);
407 +    preview_update_set_osd_inactive_font(f);
408  
409      mapping = FALSE;
410  }
411 @@ -185,14 +192,23 @@ void on_font_menu_item_font_set(GtkFontButton *w, gpointer data)
412      preview_update_set_menu_item_font(write_font(w, "MenuItem"));
413  }
414  
415 -void on_font_display_font_set(GtkFontButton *w, gpointer data)
416 +void on_font_active_display_font_set(GtkFontButton *w, gpointer data)
417  {
418      if (mapping) return;
419  
420 -    preview_update_set_osd_font(write_font(w, "OnScreenDisplay"));
421 +    preview_update_set_osd_active_font(write_font(w, "ActiveOnScreenDisplay"));
422  }
423  
424 -static RrFont *read_font(GtkFontButton *w, const gchar *place)
425 +void on_font_inactive_display_font_set(GtkFontButton *w, gpointer data)
426 +{
427 +    if (mapping) return;
428 +
429 +    preview_update_set_osd_inactive_font
430 +        (write_font(w, "InactiveOnScreenDisplay"));
431 +}
432 +
433 +static RrFont *read_font(GtkFontButton *w, const gchar *place,
434 +                         gboolean use_default)
435  {
436      RrFont *font;
437      gchar *fontstring, *node;
438 @@ -207,9 +223,14 @@ static RrFont *read_font(GtkFontButton *w, const gchar *place)
439      mapping = TRUE;
440  
441      node = g_strdup_printf("theme/font:place=%s/name", place);
442 -    name = tree_get_string(node, "Sans");
443 +    name = tree_get_string(node, use_default ? "Sans" : NULL);
444      g_free(node);
445  
446 +    if (name[0] == '\0') {
447 +        g_free(name);
448 +        return NULL;
449 +    }
450 +
451      node = g_strdup_printf("theme/font:place=%s/size", place);
452      size = tree_get_string(node, "8");
453      g_free(node);
454 diff --git a/src/main.c b/src/main.c
455 index 875b783..f72976e 100644
456 --- a/src/main.c
457 +++ b/src/main.c
458 @@ -297,7 +297,8 @@ int main(int argc, char **argv)
459          preview_update_set_inactive_font(NULL);
460          preview_update_set_menu_header_font(NULL);
461          preview_update_set_menu_item_font(NULL);
462 -        preview_update_set_osd_font(NULL);
463 +        preview_update_set_osd_active_font(NULL);
464 +        preview_update_set_osd_inactive_font(NULL);
465          preview_update_set_title_layout(NULL);
466      }
467  
468 diff --git a/src/obconf.glade b/src/obconf.glade
469 index 81e926f..464acff 100644
470 --- a/src/obconf.glade
471 +++ b/src/obconf.glade
472 @@ -943,7 +943,7 @@ Omnipresent (On all desktops)</property>
473                       <child>
474                         <widget class="GtkTable" id="table1">
475                           <property name="visible">True</property>
476 -                         <property name="n_rows">5</property>
477 +                         <property name="n_rows">6</property>
478                           <property name="n_columns">2</property>
479                           <property name="homogeneous">False</property>
480                           <property name="row_spacing">3</property>
481 @@ -1013,27 +1013,6 @@ Omnipresent (On all desktops)</property>
482                           </child>
483  
484                           <child>
485 -                           <widget class="GtkFontButton" id="font_display">
486 -                             <property name="visible">True</property>
487 -                             <property name="can_focus">True</property>
488 -                             <property name="show_style">True</property>
489 -                             <property name="show_size">True</property>
490 -                             <property name="use_font">True</property>
491 -                             <property name="use_size">False</property>
492 -                             <property name="focus_on_click">True</property>
493 -                             <signal name="font_set" handler="on_font_display_font_set" last_modification_time="Fri, 25 May 2007 16:03:23 GMT"/>
494 -                           </widget>
495 -                           <packing>
496 -                             <property name="left_attach">1</property>
497 -                             <property name="right_attach">2</property>
498 -                             <property name="top_attach">4</property>
499 -                             <property name="bottom_attach">5</property>
500 -                             <property name="x_options">fill</property>
501 -                             <property name="y_options"></property>
502 -                           </packing>
503 -                         </child>
504 -
505 -                         <child>
506                             <widget class="GtkLabel" id="label94">
507                               <property name="visible">True</property>
508                               <property name="label" translatable="yes">_Active window title: </property>
509 @@ -1152,7 +1131,7 @@ Omnipresent (On all desktops)</property>
510                           <child>
511                             <widget class="GtkLabel" id="label98">
512                               <property name="visible">True</property>
513 -                             <property name="label" translatable="yes">_On-screen display: </property>
514 +                             <property name="label" translatable="yes">Active _On-screen display: </property>
515                               <property name="use_underline">True</property>
516                               <property name="use_markup">False</property>
517                               <property name="justify">GTK_JUSTIFY_LEFT</property>
518 @@ -1162,7 +1141,6 @@ Omnipresent (On all desktops)</property>
519                               <property name="yalign">0.5</property>
520                               <property name="xpad">0</property>
521                               <property name="ypad">0</property>
522 -                             <property name="mnemonic_widget">font_display</property>
523                               <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
524                               <property name="width_chars">-1</property>
525                               <property name="single_line_mode">False</property>
526 @@ -1197,6 +1175,76 @@ Omnipresent (On all desktops)</property>
527                               <property name="y_options"></property>
528                             </packing>
529                           </child>
530 +
531 +                         <child>
532 +                           <widget class="GtkLabel" id="label240">
533 +                             <property name="visible">True</property>
534 +                             <property name="label" translatable="yes">Inactive O_n-screen display: </property>
535 +                             <property name="use_underline">True</property>
536 +                             <property name="use_markup">False</property>
537 +                             <property name="justify">GTK_JUSTIFY_LEFT</property>
538 +                             <property name="wrap">False</property>
539 +                             <property name="selectable">False</property>
540 +                             <property name="xalign">1</property>
541 +                             <property name="yalign">0.5</property>
542 +                             <property name="xpad">0</property>
543 +                             <property name="ypad">0</property>
544 +                             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
545 +                             <property name="width_chars">-1</property>
546 +                             <property name="single_line_mode">False</property>
547 +                             <property name="angle">0</property>
548 +                           </widget>
549 +                           <packing>
550 +                             <property name="left_attach">0</property>
551 +                             <property name="right_attach">1</property>
552 +                             <property name="top_attach">5</property>
553 +                             <property name="bottom_attach">6</property>
554 +                             <property name="x_options">fill</property>
555 +                             <property name="y_options"></property>
556 +                           </packing>
557 +                         </child>
558 +
559 +                         <child>
560 +                           <widget class="GtkFontButton" id="font_active_display">
561 +                             <property name="visible">True</property>
562 +                             <property name="can_focus">True</property>
563 +                             <property name="show_style">True</property>
564 +                             <property name="show_size">True</property>
565 +                             <property name="use_font">True</property>
566 +                             <property name="use_size">False</property>
567 +                             <property name="focus_on_click">True</property>
568 +                             <signal name="font_set" handler="on_font_active_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:46 GMT"/>
569 +                           </widget>
570 +                           <packing>
571 +                             <property name="left_attach">1</property>
572 +                             <property name="right_attach">2</property>
573 +                             <property name="top_attach">4</property>
574 +                             <property name="bottom_attach">5</property>
575 +                             <property name="x_options">fill</property>
576 +                             <property name="y_options"></property>
577 +                           </packing>
578 +                         </child>
579 +
580 +                         <child>
581 +                           <widget class="GtkFontButton" id="font_inactive_display">
582 +                             <property name="visible">True</property>
583 +                             <property name="can_focus">True</property>
584 +                             <property name="show_style">True</property>
585 +                             <property name="show_size">True</property>
586 +                             <property name="use_font">True</property>
587 +                             <property name="use_size">False</property>
588 +                             <property name="focus_on_click">True</property>
589 +                             <signal name="font_set" handler="on_font_inactive_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:52 GMT"/>
590 +                           </widget>
591 +                           <packing>
592 +                             <property name="left_attach">1</property>
593 +                             <property name="right_attach">2</property>
594 +                             <property name="top_attach">5</property>
595 +                             <property name="bottom_attach">6</property>
596 +                             <property name="x_options">fill</property>
597 +                             <property name="y_options"></property>
598 +                           </packing>
599 +                         </child>
600                         </widget>
601                         <packing>
602                           <property name="padding">0</property>
603 @@ -1576,6 +1624,301 @@ Omnipresent (On all desktops)</property>
604                   <property name="fill">True</property>
605                 </packing>
606               </child>
607 +
608 +             <child>
609 +               <widget class="GtkVBox" id="vbox86">
610 +                 <property name="visible">True</property>
611 +                 <property name="homogeneous">False</property>
612 +                 <property name="spacing">6</property>
613 +
614 +                 <child>
615 +                   <widget class="GtkLabel" id="label243">
616 +                     <property name="visible">True</property>
617 +                     <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot;&gt;Primary Monitor&lt;/span&gt;</property>
618 +                     <property name="use_underline">False</property>
619 +                     <property name="use_markup">True</property>
620 +                     <property name="justify">GTK_JUSTIFY_LEFT</property>
621 +                     <property name="wrap">False</property>
622 +                     <property name="selectable">False</property>
623 +                     <property name="xalign">0</property>
624 +                     <property name="yalign">0.5</property>
625 +                     <property name="xpad">0</property>
626 +                     <property name="ypad">0</property>
627 +                     <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
628 +                     <property name="width_chars">-1</property>
629 +                     <property name="single_line_mode">False</property>
630 +                     <property name="angle">0</property>
631 +                   </widget>
632 +                   <packing>
633 +                     <property name="padding">0</property>
634 +                     <property name="expand">False</property>
635 +                     <property name="fill">False</property>
636 +                   </packing>
637 +                 </child>
638 +
639 +                 <child>
640 +                   <widget class="GtkHBox" id="hbox120">
641 +                     <property name="visible">True</property>
642 +                     <property name="homogeneous">False</property>
643 +                     <property name="spacing">0</property>
644 +
645 +                     <child>
646 +                       <widget class="GtkLabel" id="label244">
647 +                         <property name="visible">True</property>
648 +                         <property name="label">    </property>
649 +                         <property name="use_underline">False</property>
650 +                         <property name="use_markup">False</property>
651 +                         <property name="justify">GTK_JUSTIFY_LEFT</property>
652 +                         <property name="wrap">False</property>
653 +                         <property name="selectable">False</property>
654 +                         <property name="xalign">0.5</property>
655 +                         <property name="yalign">0.5</property>
656 +                         <property name="xpad">0</property>
657 +                         <property name="ypad">0</property>
658 +                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
659 +                         <property name="width_chars">-1</property>
660 +                         <property name="single_line_mode">False</property>
661 +                         <property name="angle">0</property>
662 +                       </widget>
663 +                       <packing>
664 +                         <property name="padding">0</property>
665 +                         <property name="expand">False</property>
666 +                         <property name="fill">False</property>
667 +                       </packing>
668 +                     </child>
669 +
670 +                     <child>
671 +                       <widget class="GtkVBox" id="vbox87">
672 +                         <property name="visible">True</property>
673 +                         <property name="homogeneous">False</property>
674 +                         <property name="spacing">6</property>
675 +
676 +                         <child>
677 +                           <widget class="GtkHBox" id="hbox122">
678 +                             <property name="visible">True</property>
679 +                             <property name="homogeneous">False</property>
680 +                             <property name="spacing">0</property>
681 +
682 +                             <child>
683 +                               <widget class="GtkLabel" id="label246">
684 +                                 <property name="visible">True</property>
685 +                                 <property name="label" translatable="yes">The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows.</property>
686 +                                 <property name="use_underline">False</property>
687 +                                 <property name="use_markup">False</property>
688 +                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
689 +                                 <property name="wrap">True</property>
690 +                                 <property name="selectable">False</property>
691 +                                 <property name="xalign">0</property>
692 +                                 <property name="yalign">0</property>
693 +                                 <property name="xpad">0</property>
694 +                                 <property name="ypad">0</property>
695 +                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
696 +                                 <property name="width_chars">0</property>
697 +                                 <property name="single_line_mode">False</property>
698 +                                 <property name="angle">0</property>
699 +                               </widget>
700 +                               <packing>
701 +                                 <property name="padding">0</property>
702 +                                 <property name="expand">False</property>
703 +                                 <property name="fill">False</property>
704 +                               </packing>
705 +                             </child>
706 +                           </widget>
707 +                           <packing>
708 +                             <property name="padding">0</property>
709 +                             <property name="expand">False</property>
710 +                             <property name="fill">False</property>
711 +                           </packing>
712 +                         </child>
713 +
714 +                         <child>
715 +                           <widget class="GtkHBox" id="hbox121">
716 +                             <property name="visible">True</property>
717 +                             <property name="homogeneous">False</property>
718 +                             <property name="spacing">6</property>
719 +
720 +                             <child>
721 +                               <widget class="GtkLabel" id="label245">
722 +                                 <property name="visible">True</property>
723 +                                 <property name="label" translatable="yes">Primary _monitor:</property>
724 +                                 <property name="use_underline">True</property>
725 +                                 <property name="use_markup">False</property>
726 +                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
727 +                                 <property name="wrap">False</property>
728 +                                 <property name="selectable">False</property>
729 +                                 <property name="xalign">0</property>
730 +                                 <property name="yalign">0.5</property>
731 +                                 <property name="xpad">0</property>
732 +                                 <property name="ypad">0</property>
733 +                                 <property name="mnemonic_widget">primary_monitor_popup</property>
734 +                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
735 +                                 <property name="width_chars">-1</property>
736 +                                 <property name="single_line_mode">False</property>
737 +                                 <property name="angle">0</property>
738 +                               </widget>
739 +                               <packing>
740 +                                 <property name="padding">0</property>
741 +                                 <property name="expand">False</property>
742 +                                 <property name="fill">False</property>
743 +                               </packing>
744 +                             </child>
745 +
746 +                             <child>
747 +                               <widget class="GtkOptionMenu" id="primary_monitor_popup">
748 +                                 <property name="visible">True</property>
749 +                                 <property name="can_focus">True</property>
750 +                                 <property name="history">1</property>
751 +
752 +                                 <child>
753 +                                   <widget class="GtkMenu" id="menu16">
754 +
755 +                                     <child>
756 +                                       <widget class="GtkMenuItem" id="item1">
757 +                                         <property name="visible">True</property>
758 +                                         <property name="label" translatable="yes">Fixed Monitor</property>
759 +                                         <property name="use_underline">True</property>
760 +                                         <signal name="activate" handler="on_primary_monitor_fixed_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
761 +                                       </widget>
762 +                                     </child>
763 +
764 +                                     <child>
765 +                                       <widget class="GtkMenuItem" id="active_monitor1">
766 +                                         <property name="visible">True</property>
767 +                                         <property name="label" translatable="yes">Active Monitor</property>
768 +                                         <property name="use_underline">True</property>
769 +                                         <signal name="activate" handler="on_primary_monitor_active_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
770 +                                       </widget>
771 +                                     </child>
772 +
773 +                                     <child>
774 +                                       <widget class="GtkMenuItem" id="monitor_with_mouse_pointer1">
775 +                                         <property name="visible">True</property>
776 +                                         <property name="label" translatable="yes">Monitor With Mouse Pointer</property>
777 +                                         <property name="use_underline">True</property>
778 +                                         <signal name="activate" handler="on_primary_monitor_mouse_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
779 +                                       </widget>
780 +                                     </child>
781 +                                   </widget>
782 +                                 </child>
783 +                               </widget>
784 +                               <packing>
785 +                                 <property name="padding">0</property>
786 +                                 <property name="expand">False</property>
787 +                                 <property name="fill">False</property>
788 +                               </packing>
789 +                             </child>
790 +                           </widget>
791 +                           <packing>
792 +                             <property name="padding">0</property>
793 +                             <property name="expand">True</property>
794 +                             <property name="fill">True</property>
795 +                           </packing>
796 +                         </child>
797 +
798 +                         <child>
799 +                           <widget class="GtkHBox" id="hbox123">
800 +                             <property name="visible">True</property>
801 +                             <property name="homogeneous">False</property>
802 +                             <property name="spacing">6</property>
803 +
804 +                             <child>
805 +                               <widget class="GtkLabel" id="label249">
806 +                                 <property name="visible">True</property>
807 +                                 <property name="label">    </property>
808 +                                 <property name="use_underline">False</property>
809 +                                 <property name="use_markup">False</property>
810 +                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
811 +                                 <property name="wrap">False</property>
812 +                                 <property name="selectable">False</property>
813 +                                 <property name="xalign">0.5</property>
814 +                                 <property name="yalign">0.5</property>
815 +                                 <property name="xpad">0</property>
816 +                                 <property name="ypad">0</property>
817 +                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
818 +                                 <property name="width_chars">-1</property>
819 +                                 <property name="single_line_mode">False</property>
820 +                                 <property name="angle">0</property>
821 +                               </widget>
822 +                               <packing>
823 +                                 <property name="padding">0</property>
824 +                                 <property name="expand">False</property>
825 +                                 <property name="fill">False</property>
826 +                               </packing>
827 +                             </child>
828 +
829 +                             <child>
830 +                               <widget class="GtkLabel" id="label248">
831 +                                 <property name="visible">True</property>
832 +                                 <property name="label" translatable="yes">_Fixed monitor:</property>
833 +                                 <property name="use_underline">True</property>
834 +                                 <property name="use_markup">False</property>
835 +                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
836 +                                 <property name="wrap">False</property>
837 +                                 <property name="selectable">False</property>
838 +                                 <property name="xalign">0</property>
839 +                                 <property name="yalign">0.5</property>
840 +                                 <property name="xpad">0</property>
841 +                                 <property name="ypad">0</property>
842 +                                 <property name="mnemonic_widget">fixed_monitor</property>
843 +                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
844 +                                 <property name="width_chars">-1</property>
845 +                                 <property name="single_line_mode">False</property>
846 +                                 <property name="angle">0</property>
847 +                               </widget>
848 +                               <packing>
849 +                                 <property name="padding">0</property>
850 +                                 <property name="expand">False</property>
851 +                                 <property name="fill">False</property>
852 +                               </packing>
853 +                             </child>
854 +
855 +                             <child>
856 +                               <widget class="GtkSpinButton" id="fixed_monitor">
857 +                                 <property name="visible">True</property>
858 +                                 <property name="can_focus">True</property>
859 +                                 <property name="climb_rate">1</property>
860 +                                 <property name="digits">0</property>
861 +                                 <property name="numeric">False</property>
862 +                                 <property name="update_policy">GTK_UPDATE_ALWAYS</property>
863 +                                 <property name="snap_to_ticks">False</property>
864 +                                 <property name="wrap">False</property>
865 +                                 <property name="adjustment">1 1 100 1 10 10</property>
866 +                                 <signal name="value_changed" handler="on_fixed_monitor_value_changed" last_modification_time="Mon, 21 Dec 2009 18:32:45 GMT"/>
867 +                               </widget>
868 +                               <packing>
869 +                                 <property name="padding">0</property>
870 +                                 <property name="expand">False</property>
871 +                                 <property name="fill">False</property>
872 +                               </packing>
873 +                             </child>
874 +                           </widget>
875 +                           <packing>
876 +                             <property name="padding">0</property>
877 +                             <property name="expand">True</property>
878 +                             <property name="fill">True</property>
879 +                           </packing>
880 +                         </child>
881 +                       </widget>
882 +                       <packing>
883 +                         <property name="padding">0</property>
884 +                         <property name="expand">True</property>
885 +                         <property name="fill">True</property>
886 +                       </packing>
887 +                     </child>
888 +                   </widget>
889 +                   <packing>
890 +                     <property name="padding">0</property>
891 +                     <property name="expand">False</property>
892 +                     <property name="fill">True</property>
893 +                   </packing>
894 +                 </child>
895 +               </widget>
896 +               <packing>
897 +                 <property name="padding">0</property>
898 +                 <property name="expand">False</property>
899 +                 <property name="fill">True</property>
900 +               </packing>
901 +             </child>
902             </widget>
903             <packing>
904               <property name="tab_expand">False</property>
905 diff --git a/src/preview_update.c b/src/preview_update.c
906 index a0e17c8..2f61fb7 100644
907 --- a/src/preview_update.c
908 +++ b/src/preview_update.c
909 @@ -10,18 +10,21 @@ static RrFont       *active_window_font   = NULL;
910  static RrFont       *inactive_window_font = NULL;
911  static RrFont       *menu_title_font      = NULL;
912  static RrFont       *menu_item_font       = NULL;
913 -static RrFont       *osd_font             = NULL;
914 +static RrFont       *osd_active_font      = NULL;
915 +static RrFont       *osd_inactive_font    = NULL;
916  
917  static gboolean update_theme_preview_iterate(gpointer data);
918  
919  void preview_update_all()
920  {
921      if (!list_store) return;
922 +    if (!RR_CHECK_VERSION(3,5,0)) return;
923  
924      g_idle_remove_by_data(list_store);
925  
926      if (!(title_layout && active_window_font && inactive_window_font &&
927 -          menu_title_font && menu_item_font && osd_font))
928 +          menu_title_font && menu_item_font &&
929 +          osd_active_font && osd_inactive_font))
930          return; /* not set up */
931  
932      restart_theme_preview_update = TRUE;
933 @@ -70,10 +73,17 @@ void preview_update_set_menu_item_font(RrFont *f)
934      preview_update_all();
935  }
936  
937 -void preview_update_set_osd_font(RrFont *f)
938 +void preview_update_set_osd_active_font(RrFont *f)
939  {
940 -    RrFontClose(osd_font);
941 -    osd_font = f;
942 +    RrFontClose(osd_active_font);
943 +    osd_active_font = f;
944 +    preview_update_all();
945 +}
946 +
947 +void preview_update_set_osd_inactive_font(RrFont *f)
948 +{
949 +    RrFontClose(osd_inactive_font);
950 +    osd_inactive_font = f;
951      preview_update_all();
952  }
953  
954 @@ -123,7 +133,8 @@ static gboolean update_theme_preview_iterate(gpointer data)
955      gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1,
956                         preview_theme(name, title_layout, active_window_font,
957                                       inactive_window_font, menu_title_font,
958 -                                     menu_item_font, osd_font),
959 +                                     menu_item_font, osd_active_font,
960 +                                     osd_inactive_font),
961                         -1);
962  
963      return TRUE;
964 diff --git a/src/preview_update.h b/src/preview_update.h
965 index 5163174..596f092 100644
966 --- a/src/preview_update.h
967 +++ b/src/preview_update.h
968 @@ -11,7 +11,8 @@ void preview_update_set_active_font      (RrFont *f);
969  void preview_update_set_inactive_font    (RrFont *f);
970  void preview_update_set_menu_header_font (RrFont *f);
971  void preview_update_set_menu_item_font   (RrFont *f);
972 -void preview_update_set_osd_font         (RrFont *f);
973 +void preview_update_set_osd_active_font  (RrFont *f);
974 +void preview_update_set_osd_inactive_font(RrFont *f);
975  void preview_update_set_title_layout     (const gchar *layout);
976  
977  #endif
978 diff --git a/src/windows.c b/src/windows.c
979 index ed5ed35..d2b4d96 100644
980 --- a/src/windows.c
981 +++ b/src/windows.c
982 @@ -23,6 +23,7 @@
983  static gboolean mapping = FALSE;
984  
985  #define PLACE_ON_ALL    0
986 +#define PLACE_ON_FIXED 0
987  #define PLACE_ON_ACTIVE 1
988  #define PLACE_ON_MOUSE 2
989  
990 @@ -59,6 +60,21 @@ void windows_setup_tab()
991          gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ALL);
992      g_free(s);
993  
994 +    w = get_widget("primary_monitor_popup");
995 +    s = tree_get_string("placement/primaryMonitor", "");
996 +    if (!g_ascii_strcasecmp(s, "Active"))
997 +        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ACTIVE);
998 +    else if (!g_ascii_strcasecmp(s, "Mouse"))
999 +        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_MOUSE);
1000 +    else {
1001 +        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_FIXED);
1002 +
1003 +        w = get_widget("fixed_monitor");
1004 +        gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
1005 +                                  tree_get_int("placement/primaryMonitor", 1));
1006 +    }
1007 +    g_free(s);
1008 +
1009      enable_stuff();
1010  
1011      mapping = FALSE;
1012 @@ -71,8 +87,50 @@ static void enable_stuff()
1013  
1014      w = get_widget("place_mouse");
1015      b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
1016 +
1017      w = get_widget("place_center");
1018      gtk_widget_set_sensitive(w, !b);
1019 +
1020 +    w = get_widget("primary_monitor_popup");
1021 +    b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == PLACE_ON_FIXED;
1022 +    w = get_widget("fixed_monitor");
1023 +    gtk_widget_set_sensitive(w, b);
1024 +}
1025 +
1026 +void on_primary_monitor_active_activate(GtkMenuItem *w, gpointer data)
1027 +{
1028 +    if (mapping) return;
1029 +
1030 +    tree_set_string("placement/primaryMonitor", "Active");
1031 +    enable_stuff();
1032 +}
1033 +
1034 +void on_primary_monitor_mouse_activate(GtkMenuItem *w, gpointer data)
1035 +{
1036 +    if (mapping) return;
1037 +
1038 +    tree_set_string("placement/primaryMonitor", "Mouse");
1039 +    enable_stuff();
1040 +}
1041 +
1042 +void on_primary_monitor_fixed_activate(GtkMenuItem *w, gpointer data)
1043 +{
1044 +    GtkWidget *w2;
1045 +
1046 +    if (mapping) return;
1047 +
1048 +    w2 = get_widget("fixed_monitor");
1049 +    tree_set_int("placement/primaryMonitor",
1050 +                 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w2)));
1051 +    enable_stuff();
1052 +}
1053 +
1054 +void on_fixed_monitor_value_changed(GtkSpinButton *w, gpointer data)
1055 +{
1056 +    if (mapping) return;
1057 +
1058 +    tree_set_int("placement/primaryMonitor",
1059 +                 gtk_spin_button_get_value_as_int(w));
1060  }
1061  
1062  void on_focus_new_toggled(GtkToggleButton *w, gpointer data)
1063 commit 7562931bcf0857ce1522f81f9cb018a2f18ab817
1064 Author: Dana Jansens <danakj@orodu.net>
1065 Date:   Mon Dec 21 14:06:45 2009 -0500
1066
1067     use the new obt_xml stuff
1068
1069 diff --git a/src/desktops.c b/src/desktops.c
1070 index f1f0021..6f205c4 100644
1071 --- a/src/desktops.c
1072 +++ b/src/desktops.c
1073 @@ -156,7 +156,7 @@ static void desktops_read_names()
1074          gchar *name;
1075  
1076          if (!xmlStrcmp(n->name, (const xmlChar*)"name")) {
1077 -            name = obt_parse_node_string(n);
1078 +            name = obt_xml_node_string(n);
1079  
1080              desktop_names = g_list_append(desktop_names, name);
1081  
1082 diff --git a/src/main.c b/src/main.c
1083 index f72976e..9035e8d 100644
1084 --- a/src/main.c
1085 +++ b/src/main.c
1086 @@ -43,7 +43,7 @@ xmlNodePtr root;
1087  RrInstance *rrinst;
1088  gchar *obc_config_file = NULL;
1089  ObtPaths *paths;
1090 -ObtParseInst *parse_i;
1091 +ObtXmlInst *parse_i;
1092  
1093  static gchar *obc_theme_install = NULL;
1094  static gchar *obc_theme_archive = NULL;
1095 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
1096      }
1097  
1098      paths = obt_paths_new();
1099 -    parse_i = obt_parse_instance_new();
1100 +    parse_i = obt_xml_instance_new();
1101      rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen());
1102  
1103      if (!obc_config_file) {
1104 @@ -233,18 +233,18 @@ int main(int argc, char **argv)
1105      }
1106  
1107      xmlIndentTreeOutput = 1;
1108 -    if (!obt_parse_load_config_file(parse_i,
1109 -                                    "openbox",
1110 -                                    (obc_config_file ?
1111 -                                     obc_config_file : "rc.xml"),
1112 -                                    "openbox_config"))
1113 +    if (!obt_xml_load_config_file(parse_i,
1114 +                                  "openbox",
1115 +                                  (obc_config_file ?
1116 +                                   obc_config_file : "rc.xml"),
1117 +                                  "openbox_config"))
1118      {
1119          obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
1120          exit_with_error = TRUE;
1121      }
1122      else {
1123 -        doc = obt_parse_doc(parse_i);
1124 -        root = obt_parse_root(parse_i);
1125 +        doc = obt_xml_doc(parse_i);
1126 +        root = obt_xml_root(parse_i);
1127      }
1128  
1129      /* look for parsing errors */
1130 @@ -303,7 +303,7 @@ int main(int argc, char **argv)
1131      }
1132  
1133      RrInstanceFree(rrinst);
1134 -    obt_parse_instance_unref(parse_i);
1135 +    obt_xml_instance_unref(parse_i);
1136      obt_paths_unref(paths);
1137  
1138      xmlFreeDoc(doc);
1139 diff --git a/src/main.h b/src/main.h
1140 index 2c06630..4f3213b 100644
1141 --- a/src/main.h
1142 +++ b/src/main.h
1143 @@ -21,7 +21,7 @@
1144  
1145  #include <obrender/render.h>
1146  #include <obrender/instance.h>
1147 -#include <obt/parse.h>
1148 +#include <obt/xml.h>
1149  #include <obt/paths.h>
1150  
1151  #include <gtk/gtk.h>
1152 @@ -32,7 +32,7 @@ extern RrInstance *rrinst;
1153  extern GtkWidget *mainwin;
1154  extern gchar *obc_config_file;
1155  extern ObtPaths *paths;
1156 -extern ObtParseInst *parse_i;
1157 +extern ObtXmlInst *parse_i;
1158  
1159  #define get_widget(s) glade_xml_get_widget(glade, s)
1160  
1161 diff --git a/src/mouse.c b/src/mouse.c
1162 index 831e2e5..88f13d9 100644
1163 --- a/src/mouse.c
1164 +++ b/src/mouse.c
1165 @@ -19,7 +19,7 @@
1166  #include "main.h"
1167  #include "tree.h"
1168  #include "gettext.h"
1169 -#include <obt/parse.h>
1170 +#include <obt/xml.h>
1171  
1172  static gboolean   mapping = FALSE;
1173  static xmlNodePtr saved_custom = NULL;
1174 @@ -206,9 +206,9 @@ static gint read_doubleclick_action()
1175  
1176      while (n) {
1177          if (!xmlStrcmp(n->name, (const xmlChar*)"action")) {
1178 -            if (obt_parse_attr_contains(n, "name", "ToggleMaximizeFull"))
1179 +            if (obt_xml_attr_contains(n, "name", "ToggleMaximizeFull"))
1180                  ++max;
1181 -            else if (obt_parse_attr_contains(n, "name", "ToggleShade"))
1182 +            else if (obt_xml_attr_contains(n, "name", "ToggleShade"))
1183                  ++shade;
1184              else
1185                  ++other;
1186 diff --git a/src/tree.c b/src/tree.c
1187 index 2b39840..cbe9b90 100644
1188 --- a/src/tree.c
1189 +++ b/src/tree.c
1190 @@ -19,7 +19,7 @@
1191  #include "tree.h"
1192  #include "main.h"
1193  
1194 -#include <obt/parse.h>
1195 +#include <obt/xml.h>
1196  #include <gdk/gdkx.h>
1197  
1198  xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
1199 @@ -28,7 +28,7 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
1200      gchar **nodes;
1201      gchar **it, **next;
1202  
1203 -    n = obt_parse_root(parse_i);
1204 +    n = obt_xml_root(parse_i);
1205  
1206      nodes = g_strsplit(path, "/", 0);
1207      for (it = nodes; *it; it = next) {
1208 @@ -39,19 +39,19 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
1209          next = it + 1;
1210  
1211          /* match attributes */
1212 -        c = obt_parse_find_node(n->children, attrs[0]);
1213 +        c = obt_xml_find_node(n->children, attrs[0]);
1214          while (c && !ok) {
1215              gint i;
1216  
1217              ok = TRUE;
1218              for (i = 1; attrs[i]; ++i) {
1219                  gchar **eq = g_strsplit(attrs[i], "=", 2);
1220 -                if (eq[1] && !obt_parse_attr_contains(c, eq[0], eq[1]))
1221 +                if (eq[1] && !obt_xml_attr_contains(c, eq[0], eq[1]))
1222                      ok = FALSE;
1223                  g_strfreev(eq);
1224              }
1225              if (!ok)
1226 -                c = obt_parse_find_node(c->next, attrs[0]);
1227 +                c = obt_xml_find_node(c->next, attrs[0]);
1228          }
1229  
1230          if (!c) {
1231 @@ -100,7 +100,7 @@ void tree_apply()
1232      obt_paths_mkdir_path(d, 0700);
1233      g_free(d);
1234  
1235 -    if (!obt_parse_save_file(parse_i, p, TRUE)) {
1236 +    if (!obt_xml_save_file(parse_i, p, TRUE)) {
1237          gchar *s;
1238          s = g_strdup_printf("An error occured while saving the "
1239                              "config file '%s'", p);
1240 @@ -166,7 +166,7 @@ gchar* tree_get_string(const gchar *node, const gchar *def)
1241      xmlNodePtr n;
1242  
1243      n = tree_get_node(node, def);
1244 -    return obt_parse_node_string(n);
1245 +    return obt_xml_node_string(n);
1246  }
1247  
1248  gint tree_get_int(const gchar *node, gint def)
1249 @@ -177,7 +177,7 @@ gint tree_get_int(const gchar *node, gint def)
1250      d = g_strdup_printf("%d", def);
1251      n = tree_get_node(node, d);
1252      g_free(d);
1253 -    return obt_parse_node_int(n);
1254 +    return obt_xml_node_int(n);
1255  }
1256  
1257  gboolean tree_get_bool(const gchar *node, gboolean def)
1258 @@ -185,5 +185,5 @@ gboolean tree_get_bool(const gchar *node, gboolean def)
1259      xmlNodePtr n;
1260  
1261      n = tree_get_node(node, (def ? "yes" : "no"));
1262 -    return obt_parse_node_bool(n);
1263 +    return obt_xml_node_bool(n);
1264  }
1265 diff --git a/src/tree.h b/src/tree.h
1266 index 62a20c8..4e9e170 100644
1267 --- a/src/tree.h
1268 +++ b/src/tree.h
1269 @@ -19,7 +19,7 @@
1270  #ifndef obconf__tree_h
1271  #define obconf__tree_h
1272  
1273 -#include <obt/parse.h>
1274 +#include <obt/xml.h>
1275  
1276  xmlNodePtr tree_get_node(const gchar *path, const gchar *def);
1277  
1278 commit e3545ed4e522e3495df95a8bf0c4e16f543b9e00
1279 Author: Dana Jansens <danakj@orodu.net>
1280 Date:   Mon Dec 21 14:32:04 2009 -0500
1281
1282     don't set the theme preview if a null is returned (trying to fix bug #3285)
1283
1284 diff --git a/src/preview_update.c b/src/preview_update.c
1285 index 2f61fb7..638f364 100644
1286 --- a/src/preview_update.c
1287 +++ b/src/preview_update.c
1288 @@ -1,4 +1,5 @@
1289  #include "preview_update.h"
1290 +#include "preview.h"
1291  #include "main.h"
1292  
1293  static gboolean restart_theme_preview_update = TRUE;
1294 @@ -97,6 +98,7 @@ void preview_update_set_title_layout(const gchar *layout)
1295  static gboolean update_theme_preview_iterate(gpointer data)
1296  {
1297      GtkListStore *ls = data;
1298 +    GdkPixbuf *preview;
1299      static GtkTreeIter iter;
1300      gchar *name;
1301  
1302 @@ -130,12 +132,12 @@ static gboolean update_theme_preview_iterate(gpointer data)
1303  
1304      gtk_tree_model_get(GTK_TREE_MODEL(ls), &iter, 0, &name, -1);
1305  
1306 -    gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1,
1307 -                       preview_theme(name, title_layout, active_window_font,
1308 -                                     inactive_window_font, menu_title_font,
1309 -                                     menu_item_font, osd_active_font,
1310 -                                     osd_inactive_font),
1311 -                       -1);
1312 +    preview = preview_theme(name, title_layout, active_window_font,
1313 +                            inactive_window_font, menu_title_font,
1314 +                            menu_item_font, osd_active_font,
1315 +                            osd_inactive_font);
1316 +    if (preview)
1317 +        gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, preview, -1);
1318  
1319      return TRUE;
1320  }
1321 commit b0465895c15c544111f0dbbcbffab56b476a8749
1322 Author: Dana Jansens <danakj@orodu.net>
1323 Date:   Fri Feb 12 15:18:02 2010 -0500
1324
1325     don't use a non-zero page size for some spinners (Fix bug #4540)
1326
1327 diff --git a/src/obconf.glade b/src/obconf.glade
1328 index 464acff..0e024f8 100644
1329 --- a/src/obconf.glade
1330 +++ b/src/obconf.glade
1331 @@ -2086,7 +2086,7 @@ Omnipresent (On all desktops)</property>
1332                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1333                                   <property name="snap_to_ticks">False</property>
1334                                   <property name="wrap">False</property>
1335 -                                 <property name="adjustment">1 1 100 1 10 10</property>
1336 +                                 <property name="adjustment">1 1 100 1 10 0</property>
1337                                   <signal name="value_changed" handler="on_drag_threshold_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:02:00 GMT"/>
1338                                 </widget>
1339                                 <packing>
1340 @@ -2170,7 +2170,7 @@ Omnipresent (On all desktops)</property>
1341                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1342                                   <property name="snap_to_ticks">False</property>
1343                                   <property name="wrap">False</property>
1344 -                                 <property name="adjustment">20 0 100 1 10 10</property>
1345 +                                 <property name="adjustment">20 0 100 1 10 0</property>
1346                                   <signal name="value_changed" handler="on_resist_window_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:22:53 GMT"/>
1347                                 </widget>
1348                                 <packing>
1349 @@ -2254,7 +2254,7 @@ Omnipresent (On all desktops)</property>
1350                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1351                                   <property name="snap_to_ticks">False</property>
1352                                   <property name="wrap">False</property>
1353 -                                 <property name="adjustment">1 0 100 1 10 10</property>
1354 +                                 <property name="adjustment">1 0 100 1 10 0</property>
1355                                   <signal name="value_changed" handler="on_resist_edge_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:23:04 GMT"/>
1356                                 </widget>
1357                                 <packing>
1358 @@ -2389,7 +2389,7 @@ Omnipresent (On all desktops)</property>
1359                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1360                                       <property name="snap_to_ticks">False</property>
1361                                       <property name="wrap">False</property>
1362 -                                     <property name="adjustment">0 100 10000 10 10 10</property>
1363 +                                     <property name="adjustment">0 100 10000 10 10 0</property>
1364                                       <signal name="value_changed" handler="on_warp_edge_time_value_changed" after="yes" last_modification_time="Sat, 04 Aug 2007 15:51:02 GMT"/>
1365                                     </widget>
1366                                     <packing>
1367 @@ -2831,7 +2831,7 @@ Omnipresent (On all desktops)</property>
1368                                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1369                                                   <property name="snap_to_ticks">False</property>
1370                                                   <property name="wrap">False</property>
1371 -                                                 <property name="adjustment">1 0 1000 1 10 10</property>
1372 +                                                 <property name="adjustment">1 0 1000 1 10 0</property>
1373                                                   <signal name="value_changed" handler="on_fixed_x_pos_value_changed" after="yes" last_modification_time="Sat, 12 Jan 2008 18:21:45 GMT"/>
1374                                                 </widget>
1375                                                 <packing>
1376 @@ -2973,7 +2973,7 @@ Omnipresent (On all desktops)</property>
1377                                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1378                                                   <property name="snap_to_ticks">False</property>
1379                                                   <property name="wrap">False</property>
1380 -                                                 <property name="adjustment">1 0 1000 1 10 10</property>
1381 +                                                 <property name="adjustment">1 0 1000 1 10 0</property>
1382                                                   <signal name="value_changed" handler="on_fixed_y_pos_value_changed" after="yes" last_modification_time="Sat, 12 Jan 2008 18:22:16 GMT"/>
1383                                                 </widget>
1384                                                 <packing>
1385 @@ -3327,7 +3327,7 @@ Omnipresent (On all desktops)</property>
1386                                           <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1387                                           <property name="snap_to_ticks">False</property>
1388                                           <property name="wrap">False</property>
1389 -                                         <property name="adjustment">0 0 10000 10 10 10</property>
1390 +                                         <property name="adjustment">0 0 10000 10 10 0</property>
1391                                           <signal name="value_changed" handler="on_focus_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:24:28 GMT"/>
1392                                         </widget>
1393                                         <packing>
1394 @@ -3589,7 +3589,7 @@ Omnipresent (On all desktops)</property>
1395                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1396                                   <property name="snap_to_ticks">False</property>
1397                                   <property name="wrap">False</property>
1398 -                                 <property name="adjustment">0 0 10000 10 10 10</property>
1399 +                                 <property name="adjustment">0 0 10000 10 10 0</property>
1400                                   <signal name="value_changed" handler="on_doubleclick_time_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:09:40 GMT"/>
1401                                 </widget>
1402                                 <packing>
1403 @@ -3895,7 +3895,7 @@ Omnipresent (On all desktops)</property>
1404                                   <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1405                                   <property name="snap_to_ticks">False</property>
1406                                   <property name="wrap">False</property>
1407 -                                 <property name="adjustment">0 1 10000 10 10 10</property>
1408 +                                 <property name="adjustment">0 1 10000 10 10 0</property>
1409                                   <signal name="value_changed" handler="on_desktop_popup_time_value_changed" after="yes" last_modification_time="Sat, 04 Aug 2007 16:03:27 GMT"/>
1410                                 </widget>
1411                                 <packing>
1412 @@ -3986,7 +3986,7 @@ Omnipresent (On all desktops)</property>
1413                               <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1414                               <property name="snap_to_ticks">False</property>
1415                               <property name="wrap">False</property>
1416 -                             <property name="adjustment">1 1 100 1 10 10</property>
1417 +                             <property name="adjustment">1 1 100 1 10 0</property>
1418                               <signal name="value_changed" handler="on_desktop_num_value_changed" after="yes" last_modification_time="Mon, 15 Sep 2003 01:16:20 GMT"/>
1419                             </widget>
1420                             <packing>
1421 @@ -4331,7 +4331,7 @@ Omnipresent (On all desktops)</property>
1422                                           <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1423                                           <property name="snap_to_ticks">False</property>
1424                                           <property name="wrap">False</property>
1425 -                                         <property name="adjustment">20 0 100 1 10 10</property>
1426 +                                         <property name="adjustment">20 0 100 1 10 0</property>
1427                                           <signal name="value_changed" handler="on_margins_top_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:09 GMT"/>
1428                                         </widget>
1429                                         <packing>
1430 @@ -4573,7 +4573,7 @@ Omnipresent (On all desktops)</property>
1431                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1432                                       <property name="snap_to_ticks">False</property>
1433                                       <property name="wrap">False</property>
1434 -                                     <property name="adjustment">20 0 100 1 10 10</property>
1435 +                                     <property name="adjustment">20 0 100 1 10 0</property>
1436                                       <signal name="value_changed" handler="on_margins_left_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:31 GMT"/>
1437                                     </widget>
1438                                     <packing>
1439 @@ -4786,7 +4786,7 @@ Omnipresent (On all desktops)</property>
1440                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1441                                       <property name="snap_to_ticks">False</property>
1442                                       <property name="wrap">False</property>
1443 -                                     <property name="adjustment">20 0 100 1 10 10</property>
1444 +                                     <property name="adjustment">20 0 100 1 10 0</property>
1445                                       <signal name="value_changed" handler="on_margins_right_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:41 GMT"/>
1446                                     </widget>
1447                                     <packing>
1448 @@ -5021,7 +5021,7 @@ Omnipresent (On all desktops)</property>
1449                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1450                                       <property name="snap_to_ticks">False</property>
1451                                       <property name="wrap">False</property>
1452 -                                     <property name="adjustment">20 0 100 1 10 10</property>
1453 +                                     <property name="adjustment">20 0 100 1 10 0</property>
1454                                       <signal name="value_changed" handler="on_margins_bottom_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:59 GMT"/>
1455                                     </widget>
1456                                     <packing>
1457 @@ -5607,7 +5607,7 @@ Omnipresent (On all desktops)</property>
1458                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1459                                       <property name="snap_to_ticks">False</property>
1460                                       <property name="wrap">False</property>
1461 -                                     <property name="adjustment">1 0 10000 1 10 10</property>
1462 +                                     <property name="adjustment">1 0 10000 1 10 0</property>
1463                                       <signal name="value_changed" handler="on_dock_float_x_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:07:38 GMT"/>
1464                                     </widget>
1465                                     <packing>
1466 @@ -5652,7 +5652,7 @@ Omnipresent (On all desktops)</property>
1467                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1468                                       <property name="snap_to_ticks">False</property>
1469                                       <property name="wrap">False</property>
1470 -                                     <property name="adjustment">1 0 10000 1 10 10</property>
1471 +                                     <property name="adjustment">1 0 10000 1 10 0</property>
1472                                       <signal name="value_changed" handler="on_dock_float_y_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:08:09 GMT"/>
1473                                     </widget>
1474                                     <packing>
1475 @@ -6142,7 +6142,7 @@ Omnipresent (On all desktops)</property>
1476                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1477                                       <property name="snap_to_ticks">False</property>
1478                                       <property name="wrap">False</property>
1479 -                                     <property name="adjustment">300 0 10000 10 10 10</property>
1480 +                                     <property name="adjustment">300 0 10000 10 10 0</property>
1481                                       <signal name="value_changed" handler="on_dock_hide_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:08:49 GMT"/>
1482                                     </widget>
1483                                     <packing>
1484 @@ -6264,7 +6264,7 @@ Omnipresent (On all desktops)</property>
1485                                       <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1486                                       <property name="snap_to_ticks">False</property>
1487                                       <property name="wrap">False</property>
1488 -                                     <property name="adjustment">300 0 10000 10 10 10</property>
1489 +                                     <property name="adjustment">300 0 10000 10 10 0</property>
1490                                       <signal name="value_changed" handler="on_dock_show_delay_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 15:17:16 GMT"/>
1491                                     </widget>
1492                                     <packing>
1493 commit 500163e2c74cbbded0361574fd14d0a1168c1119
1494 Author: Dana Jansens <danakj@orodu.net>
1495 Date:   Tue Mar 9 10:51:02 2010 -0500
1496
1497     remove unneeded strdup
1498
1499 diff --git a/src/archive.c b/src/archive.c
1500 index b3404d7..1264627 100644
1501 --- a/src/archive.c
1502 +++ b/src/archive.c
1503 @@ -164,15 +164,12 @@ static gboolean change_dir(const gchar *dir)
1504  
1505  static gchar* install_theme_to(const gchar *file, const gchar *to)
1506  {
1507 -    gchar *glob;
1508      gchar **argv;
1509      gchar *errtxt = NULL, *outtxt = NULL;
1510      gint exitcode;
1511      GError *e = NULL;
1512      gchar *name = NULL;
1513  
1514 -    glob = g_strdup_printf("*/openbox-3/", name);
1515 -
1516      argv = g_new(gchar*, 11);
1517      argv[0] = g_strdup("tar");
1518      argv[1] = g_strdup("-x");
1519 @@ -183,7 +180,7 @@ static gchar* install_theme_to(const gchar *file, const gchar *to)
1520      argv[6] = g_strdup(file);
1521      argv[7] = g_strdup("-C");
1522      argv[8] = g_strdup(to);
1523 -    argv[9] = g_strdup(glob);
1524 +    argv[9] = g_strdup("*/openbox-3/");
1525      argv[10] = NULL;
1526      if (!g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
1527                        &outtxt, &errtxt, &exitcode, &e))
1528 @@ -222,6 +219,5 @@ static gchar* install_theme_to(const gchar *file, const gchar *to)
1529  
1530      g_free(outtxt);
1531      g_free(errtxt);
1532 -    g_free(glob);
1533      return name;
1534  }
1535 commit cc7a18807663313ef111d86a75844ded0416a889
1536 Author: Dana Jansens <danakj@orodu.net>
1537 Date:   Fri Aug 5 12:05:10 2011 -0400
1538
1539     Load the rc.xml config file given on --config-file the same as Openbox (use the whole path given).
1540
1541 diff --git a/src/main.c b/src/main.c
1542 index 9035e8d..a576253 100644
1543 --- a/src/main.c
1544 +++ b/src/main.c
1545 @@ -233,11 +233,10 @@ int main(int argc, char **argv)
1546      }
1547  
1548      xmlIndentTreeOutput = 1;
1549 -    if (!obt_xml_load_config_file(parse_i,
1550 -                                  "openbox",
1551 -                                  (obc_config_file ?
1552 -                                   obc_config_file : "rc.xml"),
1553 -                                  "openbox_config"))
1554 +    if (!((obc_config_file &&
1555 +           obt_xml_load_file(parse_i, obc_config_file, "openbox_config")) ||
1556 +          obt_xml_load_config_file(parse_i, "openbox", "rc.xml",
1557 +                                   "openbox_config")))
1558      {
1559          obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
1560          exit_with_error = TRUE;
This page took 0.235634 seconds and 3 git commands to generate.