return 0;
}
-const gchar *obt_keyboard_keycode_to_string(guint keycode)
+gchar *obt_keyboard_keycode_to_string(guint keycode)
{
KeySym sym;
const gchar *ret = NULL;
{
gunichar unikey = 0;
- const char *key;
+ char *key;
if ((key = obt_keyboard_keycode_to_string(keycode)) != NULL &&
/* don't accept keys that aren't a single letter, like "space" */
key[1] == '\0')
KeyCode obt_keyboard_keysym_to_keycode(KeySym sym);
/*! Give the string form of a KeyCode */
-const gchar *obt_keyboard_keycode_to_string(guint keycode);
+gchar *obt_keyboard_keycode_to_string(guint keycode);
/*! Translate a KeyCode to the unicode character it represents */
gunichar obt_keyboard_keycode_to_unichar(guint keycode);
{
GSList *it;
for (it = loop->timers; it; it = g_slist_next(it)) {
- ObMainLoopTimer *t = it->data;
+ ObtMainLoopTimer *t = it->data;
if (timecompare(&ins->timeout, &t->timeout) <= 0) {
loop->timers = g_slist_insert_before(loop->timers, it, ins);
break;
GEqualFunc cmp,
GDestroyNotify notify)
{
- ObMainLoopTimer *t = g_new(ObMainLoopTimer, 1);
+ ObtMainLoopTimer *t = g_new(ObtMainLoopTimer, 1);
g_assert(microseconds > 0); /* if it's 0 it'll cause an infinite loop */
data0, data1, data2, data3, data4, \
SubstructureNotifyMask | SubstructureRedirectMask))
-#define OBT_PROP_MSG(to, about, msgtype, data0, data1, data2, data3, \
- data4, mask) \
- (obt_prop_message_to(to, OBT_PROP_ATOM(msgtype), \
- data0, data1, data2, data3, data4, mask))
+#define OBT_PROP_MSG_TO(to, about, msgtype, data0, data1, data2, data3, \
+ data4, mask) \
+ (obt_prop_message_to(to, about, OBT_PROP_ATOM(msgtype), \
+ data0, data1, data2, data3, data4, mask))
G_END_DECLS
/* these should not be left on the window ever. other window managers
don't necessarily use them and it will mess them up (like compiz) */
- PROP_ERASE(self->window, net_wm_visible_name);
- PROP_ERASE(self->window, net_wm_visible_icon_name);
+ OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_NAME);
+ OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_ICON_NAME);
/* update the list hints */
client_set_list();
/* if this protocol is requested, then the window will be
notified whenever we want it to receive focus */
self->focus_notify = TRUE;
- else if (proto[i] == prop_atoms.net_wm_ping)
+ else if (proto[i] == OBT_PROP_ATOM(NET_WM_PING))
/* if this protocol is requested, then the window will allow
pings to determine if it is still alive */
self->ping = TRUE;
/* see if it has the PID set too (the PID requires that the
WM_CLIENT_MACHINE be set) */
- if (PROP_GET32(self->window, net_wm_pid, cardinal, &pid))
+ if (OBT_PROP_GET32(self->window, NET_WM_PID, CARDINAL, &pid))
self->pid = pid;
}
}
else
/* request the client to close with WM_DELETE_WINDOW */
OBT_PROP_MSG_TO(self->window, self->window, WM_PROTOCOLS,
- OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, 0, 0,
- NoEventMask);
+ OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime,
+ 0, 0, 0, NoEventMask);
}
void client_kill(ObClient *self)
}
if (x_pos_given && (c = obt_parse_find_node(n->children, "y")))
- if (!obt_parse_node_contains("default", doc, c)) {
+ if (!obt_parse_node_contains(c, "default")) {
config_parse_gravity_coord(c, &settings->position.y);
settings->pos_given = TRUE;
}
/* keyboard layout changes for modifier mapping changes. reload the
modifier map, and rebind all the key bindings as appropriate */
ob_debug("Kepboard map changed. Reloading keyboard bindings.\n");
- modkeys_shutdown(TRUE);
- modkeys_startup(TRUE);
+ obt_keyboard_reload();
keyboard_rebind();
}
else if (e->type == ClientMessage) {
ob_restart();
else if (e->xclient.data.l[0] == 3)
ob_exit(0);
- } else if (msgtype == prop_atoms.wm_protocols) {
- if ((Atom)e->xclient.data.l[0] == prop_atoms.net_wm_ping)
+ } else if (msgtype == OBT_PROP_ATOM(WM_PROTOCOLS)) {
+ if ((Atom)e->xclient.data.l[0] == OBT_PROP_ATOM(NET_WM_PING))
ping_got_pong(e->xclient.data.l[1]);
}
break;
#include "group.h"
#include "config.h"
#include "ping.h"
-#include "mainloop.h"
#include "gettext.h"
#include "render/render.h"
#include "render/theme.h"
#include "ping.h"
#include "client.h"
-#include "prop.h"
#include "event.h"
#include "debug.h"
-#include "mainloop.h"
#include "openbox.h"
+#include "obt/mainloop.h"
+#include "obt/prop.h"
typedef struct _ObPingTarget
{
t->client = client;
t->h = h;
- ob_main_loop_timeout_add(ob_main_loop, PING_TIMEOUT, ping_timeout,
- t, g_direct_equal, NULL);
+ obt_main_loop_timeout_add(ob_main_loop, PING_TIMEOUT, ping_timeout,
+ t, g_direct_equal, NULL);
/* act like we just timed out immediately, to start the pinging process
now instead of after the first delay. this makes sure the client
ends up in the ping_ids hash table now. */
}
/*ob_debug("+PING: '%s' (id %u)\n", t->client->title, t->id);*/
- PROP_MSG_TO(t->client->window, t->client->window, wm_protocols,
- prop_atoms.net_wm_ping, t->id, t->client->window, 0, 0,
- NoEventMask);
+ OBT_PROP_MSG_TO(t->client->window, t->client->window, WM_PROTOCOLS,
+ OBT_PROP_ATOM(NET_WM_PING), t->id, t->client->window, 0, 0,
+ NoEventMask);
}
static gboolean ping_timeout(gpointer data)
if ((t = g_hash_table_find(ping_ids, find_client, client))) {
g_hash_table_remove(ping_ids, &t->id);
- ob_main_loop_timeout_remove_data(ob_main_loop, ping_timeout, t, FALSE);
+ obt_main_loop_timeout_remove_data(ob_main_loop, ping_timeout,
+ t, FALSE);
g_free(t);
}
#ifndef ob__resist_h
#define ob__resist_h
-struct _ObClient;
+#include "misc.h"
#include <glib.h>
+struct _ObClient;
+
/*! @x The client's x destination (in the client's coordinates, not the frame's
@y The client's y destination (in the client's coordinates, not the frame's
*/
#include "startupnotify.h"
#include "moveresize.h"
#include "config.h"
-#include "mainloop.h"
#include "screen.h"
#include "client.h"
#include "session.h"
#include "gettext.h"
#include "obt/display.h"
#include "obt/prop.h"
+#include "obt/mainloop.h"
#include <X11/Xlib.h>
#ifdef HAVE_UNISTD_H
}
}
screen_desktop_timeout = FALSE;
- ob_main_loop_timeout_remove(ob_main_loop, last_desktop_func);
- ob_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME,
- last_desktop_func, NULL, NULL, NULL);
+ obt_main_loop_timeout_remove(ob_main_loop, last_desktop_func);
+ obt_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME,
+ last_desktop_func, NULL, NULL, NULL);
ob_debug("Moving to desktop %d\n", num+1);
MAX(a->width/3, POPUP_WIDTH));
pager_popup_show(desktop_popup, screen_desktop_names[d], d);
- ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func);
- ob_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000,
- hide_desktop_popup_func, NULL, NULL, NULL);
+ obt_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func);
+ obt_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000,
+ hide_desktop_popup_func, NULL, NULL, NULL);
g_free(a);
}
void screen_hide_desktop_popup(void)
{
- ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func);
+ obt_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func);
pager_popup_hide(desktop_popup);
}
}
win[1] = window_top(window);
- XRestackWindows(ob_display, win, 2);
+ XRestackWindows(obt_display, win, 2);
pause_changes = TRUE;
}
win[0] = screen_support_win;
for (i = 1, it = stacking_list; it; ++i, it = g_list_next(it))
win[i] = window_top(it->data);
- XRestackWindows(ob_display, win, i);
+ XRestackWindows(obt_display, win, i);
g_free(win);
pause_changes = FALSE;