stop using python internally. add an event dispatcher
[dana/openbox.git] / src / config.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #include "config.h"
4
5 /*
6   python_get_stringlist("DESKTOP_NAMES", &desktop_names);
7
8   python_get_string("THEME", &theme);
9   // initialize the screen's style
10   otk::RenderStyle::setStyle(_screen, theme);
11   // draw the root window
12   otk::bexec("obsetroot " + otk::RenderStyle::style(_screen)->rootArgs(),
13              info->displayString());
14
15
16   if (!python_get_string("TITLEBAR_LAYOUT", &titlebar_layout)) {
17     fprintf(stderr, _("Unable to load config.%s\n"), "TITLEBAR_LAYOUT");
18     ::exit(1);
19   }
20
21   if (!python_get_long("DOUBLE_CLICK_DELAY", &double_click_delay)) {
22     fprintf(stderr, _("Unable to load config.%s\n"), "DOUBLE_CLICK_DELAY");
23     ::exit(1);
24   }
25   if (!python_get_long("DRAG_THRESHOLD", &drag_threshold)) {
26     fprintf(stderr, _("Unable to load config.%s\n"), "DRAG_THRESHOLD");
27     ::exit(1);
28   }
29   if (!python_get_long("NUMBER_OF_DESKTOPS", (long*)&num_desktops)) {
30     fprintf(stderr, _("Unable to load config.%s\n"), "NUMBER_OF_DESKTOPS");
31     ::exit(1);
32   }
33
34   // Set the net_desktop_names property
35   otk::Property::set(root,
36                      otk::Property::atoms.net_desktop_names,
37                      otk::Property::utf8, desktop_names);
38   // the above set() will cause screen::updateDesktopNames to fire right away
39   // so we have a list of desktop names
40
41   XEvent ce;
42   ce.xclient.type = ClientMessage;
43   ce.xclient.message_type = otk::Property::atoms.net_number_of_desktops;
44   ce.xclient.display = **otk::display;
45   ce.xclient.window = root;
46   ce.xclient.format = 32;
47   ce.xclient.data.l[0] = num_desktops;
48   XSendEvent(**otk::display, root, False,
49              SubstructureNotifyMask | SubstructureRedirectMask, &ce);
50 }
51
52 Config::Config(int screen)
53   : _screen(screen)
54 {
55 }
56
57 Config::~Config()
58 {
59 }
60
61 */