return NULL;
}
- theme = g_new0(RrTheme, 1);
+ theme = g_slice_new0(RrTheme);
theme->inst = inst;
theme->name = g_strdup(name ? name : DEFAULT_THEME);
RrAppearanceFree(theme->osd_unhilite_bg);
RrAppearanceFree(theme->osd_unhilite_label);
- g_free(theme);
+ g_slice_free(RrTheme, theme);
}
}
{
ObtMainLoop *loop;
- loop = g_new0(ObtMainLoop, 1);
+ loop = g_slice_new0(ObtMainLoop);
loop->ref = 1;
FD_ZERO(&loop->fd_set);
loop->fd_x = -1;
}
}
- obt_free0(loop, ObtMainLoop, 1);
+ g_slice_free(ObtMainLoop, loop);
}
}
ObtPaths *p;
const gchar *path;
- p = g_new0(ObtPaths, 1);
+ p = g_slice_new0(ObtPaths);
p->ref = 1;
path = g_getenv("XDG_CONFIG_HOME");
g_free(p->data_home);
g_free(p->cache_home);
- obt_free0(p, ObtPaths, 1);
+ g_slice_free(ObtPaths, p);
}
}
{
ObtXEventHandler *h;
- h = g_new0(ObtXEventHandler, 1);
+ h = g_slice_new0(ObtXEventHandler);
h->ref = 1;
return h;
g_hash_table_destroy(h->bindings[i]);
g_free(h->bindings);
- obt_free0(h, ObtXEventHandler, 1);
+ g_slice_free(ObtXEventHandler, h);
}
}
static gpointer setup_func(xmlNodePtr node);
static gpointer setup_add_func(xmlNodePtr node);
static gpointer setup_remove_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_addcurrent_func(xmlNodePtr node);
void action_addremovedesktop_startup(void)
{
- actions_register("AddDesktop", setup_add_func, g_free, run_func);
- actions_register("RemoveDesktop", setup_remove_func, g_free, run_func);
+ actions_register("AddDesktop", setup_add_func, free_func, run_func);
+ actions_register("RemoveDesktop", setup_remove_func, free_func, run_func);
/* 3.4-compatibility */
- actions_register("AddDesktopLast", setup_addlast_func, g_free, run_func);
+ actions_register("AddDesktopLast", setup_addlast_func,
+ free_func, run_func);
actions_register("RemoveDesktopLast", setup_removelast_func,
- g_free, run_func);
+ free_func, run_func);
actions_register("AddDesktopCurrent", setup_addcurrent_func,
- g_free, run_func);
+ free_func, run_func);
actions_register("RemoveDesktopCurrent", setup_removecurrent_func,
- g_free, run_func);
+ free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "where"))) {
gchar *s = obt_xml_node_string(n);
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->bar = TRUE;
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
o->actions = g_slist_delete_link(o->actions, o->actions);
}
- g_free(o);
+ g_slice_free(Options, o);
}
static gboolean run_func(ObActionsData *data, gpointer options)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "string")))
o->str = obt_xml_node_string(n);
{
Options *o = options;
g_free(o->str);
- g_free(o);
+ g_slice_free(Options, o);
}
/* Always return FALSE because its not interactive */
ObActionsIInputFunc *input,
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
static gboolean i_pre_func(guint state, gpointer options);
ObActionsIInputFunc *input,
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post);
-
+
void action_desktop_startup(void)
{
- actions_register_i("GoToDesktop", setup_go_func, g_free, run_func);
- actions_register_i("SendToDesktop", setup_send_func, g_free, run_func);
+ actions_register_i("GoToDesktop", setup_go_func, free_func, run_func);
+ actions_register_i("SendToDesktop", setup_send_func, free_func, run_func);
/* 3.4-compatibility */
- actions_register("DesktopLast", setup_go_last_func, g_free, run_func);
+ actions_register("DesktopLast", setup_go_last_func, free_func, run_func);
actions_register("SendToDesktopLast", setup_send_last_func,
- g_free, run_func);
- actions_register("Desktop", setup_go_abs_func, g_free, run_func);
- actions_register("SendToDesktop", setup_send_abs_func, g_free, run_func);
- actions_register_i("DesktopNext", setup_go_next_func, g_free, run_func);
+ free_func, run_func);
+ actions_register("Desktop", setup_go_abs_func, free_func, run_func);
+ actions_register("SendToDesktop", setup_send_abs_func,
+ free_func, run_func);
+ actions_register_i("DesktopNext", setup_go_next_func, free_func, run_func);
actions_register_i("SendToDesktopNext", setup_send_next_func,
- g_free, run_func);
+ free_func, run_func);
actions_register_i("DesktopPrevious", setup_go_prev_func,
- g_free, run_func);
+ free_func, run_func);
actions_register_i("SendToDesktopPrevious", setup_send_prev_func,
- g_free, run_func);
- actions_register_i("DesktopLeft", setup_go_left_func, g_free, run_func);
+ free_func, run_func);
+ actions_register_i("DesktopLeft", setup_go_left_func, free_func, run_func);
actions_register_i("SendToDesktopLeft", setup_send_left_func,
- g_free, run_func);
- actions_register_i("DesktopRight", setup_go_right_func, g_free, run_func);
+ free_func, run_func);
+ actions_register_i("DesktopRight", setup_go_right_func,
+ free_func, run_func);
actions_register_i("SendToDesktopRight", setup_send_right_func,
- g_free, run_func);
- actions_register_i("DesktopUp", setup_go_up_func, g_free, run_func);
+ free_func, run_func);
+ actions_register_i("DesktopUp", setup_go_up_func, free_func, run_func);
actions_register_i("SendToDesktopUp", setup_send_up_func,
- g_free, run_func);
- actions_register_i("DesktopDown", setup_go_down_func, g_free, run_func);
+ free_func, run_func);
+ actions_register_i("DesktopDown", setup_go_down_func, free_func, run_func);
actions_register_i("SendToDesktopDown", setup_send_down_func,
- g_free, run_func);
+ free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node,
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
/* don't go anywhere if there are no options given */
o->type = ABSOLUTE;
o->u.abs.desktop = screen_desktop;
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
static gpointer setup_follow(xmlNodePtr node)
{
xmlNodePtr n;
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->send = TRUE;
o->follow = TRUE;
if ((n = obt_xml_find_node(node, "follow")))
static gpointer setup_go_last_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->type = LAST;
return o;
}
static gpointer setup_go_abs_func(xmlNodePtr node)
{
xmlNodePtr n;
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->type = ABSOLUTE;
if ((n = obt_xml_find_node(node, "desktop")))
o->u.abs.desktop = obt_xml_node_int(n) - 1;
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, TRUE, OB_DIRECTION_EAST, pre, input, post);
return o;
}
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, TRUE, OB_DIRECTION_WEST, pre, input, post);
return o;
}
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, FALSE, OB_DIRECTION_WEST, pre, input, post);
return o;
}
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, FALSE, OB_DIRECTION_EAST, pre, input, post);
return o;
}
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, FALSE, OB_DIRECTION_NORTH, pre, input, post);
return o;
}
ObActionsICancelFunc *cancel,
ObActionsIPostFunc *post)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
setup_rel(o, node, FALSE, OB_DIRECTION_SOUTH, pre, input, post);
return o;
}
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->dialog = TRUE;
o->bar = TRUE;
o->actions = g_slist_delete_link(o->actions, o->actions);
}
- g_free(o);
+ g_slice_free(Options, o);
}
static gboolean run_func(ObActionsData *data, gpointer options)
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
void action_exit_startup(void)
{
- actions_register("Exit", setup_func, NULL, run_func);
- actions_register("SessionLogout", setup_func, NULL, run_func);
+ actions_register("Exit", setup_func, free_func, run_func);
+ actions_register("SessionLogout", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->prompt = TRUE;
if ((n = obt_xml_find_node(node, "prompt")))
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
static void do_exit(void)
{
if (session_connected())
prompt_unref(p);
}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
void action_focus_startup(void)
{
- actions_register("Focus", setup_func, g_free, run_func);
+ actions_register("Focus", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->stop_int = TRUE;
if ((n = obt_xml_find_node(node, "here")))
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
static gpointer setup_func(xmlNodePtr node);
static gpointer setup_shrink_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_north_func(xmlNodePtr node);
void action_growtoedge_startup(void)
{
actions_register("GrowToEdge", setup_func,
- g_free, run_func);
+ free_func, run_func);
actions_register("ShrinkToEdge", setup_shrink_func,
- g_free, run_func);
+ free_func, run_func);
/* 3.4-compatibility */
- actions_register("GrowToEdgeNorth", setup_north_func, g_free, run_func);
- actions_register("GrowToEdgeSouth", setup_south_func, g_free, run_func);
- actions_register("GrowToEdgeEast", setup_east_func, g_free, run_func);
- actions_register("GrowToEdgeWest", setup_west_func, g_free, run_func);
+ actions_register("GrowToEdgeNorth", setup_north_func, free_func, run_func);
+ actions_register("GrowToEdgeSouth", setup_south_func, free_func, run_func);
+ actions_register("GrowToEdgeEast", setup_east_func, free_func, run_func);
+ actions_register("GrowToEdgeWest", setup_west_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->dir = OB_DIRECTION_NORTH;
o->shrink = FALSE;
return FALSE;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
/* 3.4-compatibility */
static gpointer setup_north_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->shrink = FALSE;
o->dir = OB_DIRECTION_NORTH;
return o;
static gpointer setup_south_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->shrink = FALSE;
o->dir = OB_DIRECTION_SOUTH;
return o;
static gpointer setup_east_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->shrink = FALSE;
o->dir = OB_DIRECTION_EAST;
return o;
static gpointer setup_west_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->shrink = FALSE;
o->dir = OB_DIRECTION_WEST;
return o;
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "shaded"))) {
if (obt_xml_node_bool(n))
o->elseacts = g_slist_delete_link(o->elseacts, o->elseacts);
}
- g_free(o);
+ g_slice_free(Options, o);
}
/* Always return FALSE because its not interactive */
static gpointer setup_func_top(xmlNodePtr node);
static gpointer setup_func_bottom(xmlNodePtr node);
static gpointer setup_func_send(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_sendtop_func(xmlNodePtr node);
void action_layer_startup(void)
{
- actions_register("ToggleAlwaysOnTop", setup_func_top, g_free,
+ actions_register("ToggleAlwaysOnTop", setup_func_top, free_func,
run_func);
- actions_register("ToggleAlwaysOnBottom", setup_func_bottom, g_free,
+ actions_register("ToggleAlwaysOnBottom", setup_func_bottom, free_func,
run_func);
- actions_register("SendToLayer", setup_func_send, g_free,
+ actions_register("SendToLayer", setup_func_send, free_func,
run_func);
/* 3.4-compatibility */
- actions_register("SendToTopLayer", setup_sendtop_func, g_free,
+ actions_register("SendToTopLayer", setup_sendtop_func, free_func,
run_func);
- actions_register("SendToBottomLayer", setup_sendbottom_func, g_free,
+ actions_register("SendToBottomLayer", setup_sendbottom_func, free_func,
run_func);
- actions_register("SendToNormalLayer", setup_sendnormal_func, g_free,
+ actions_register("SendToNormalLayer", setup_sendnormal_func, free_func,
run_func);
}
static gpointer setup_func_top(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->layer = 1;
o->toggle = TRUE;
return o;
static gpointer setup_func_bottom(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->layer = -1;
o->toggle = TRUE;
return o;
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "layer"))) {
gchar *s = obt_xml_node_string(n);
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
/* 3.4-compatibility */
static gpointer setup_sendtop_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->layer = 1;
o->toggle = FALSE;
return o;
static gpointer setup_sendbottom_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->layer = -1;
o->toggle = FALSE;
return o;
static gpointer setup_sendnormal_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->layer = 0;
o->toggle = FALSE;
return o;
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func_on(ObActionsData *data, gpointer options);
static gboolean run_func_off(ObActionsData *data, gpointer options);
static gboolean run_func_toggle(ObActionsData *data, gpointer options);
void action_maximize_startup(void)
{
- actions_register("Maximize", setup_func, g_free, run_func_on);
- actions_register("Unmaximize", setup_func, g_free, run_func_off);
- actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle);
+ actions_register("Maximize", setup_func, free_func, run_func_on);
+ actions_register("Unmaximize", setup_func, free_func, run_func_off);
+ actions_register("ToggleMaximize", setup_func, free_func, run_func_toggle);
/* 3.4-compatibility */
- actions_register("MaximizeFull", setup_both_func, g_free,
+ actions_register("MaximizeFull", setup_both_func, free_func,
run_func_on);
- actions_register("UnmaximizeFull", setup_both_func, g_free,
+ actions_register("UnmaximizeFull", setup_both_func, free_func,
run_func_off);
- actions_register("ToggleMaximizeFull", setup_both_func, g_free,
+ actions_register("ToggleMaximizeFull", setup_both_func, free_func,
run_func_toggle);
- actions_register("MaximizeHorz", setup_horz_func, g_free,
+ actions_register("MaximizeHorz", setup_horz_func, free_func,
run_func_on);
- actions_register("UnmaximizeHorz", setup_horz_func, g_free,
+ actions_register("UnmaximizeHorz", setup_horz_func, free_func,
run_func_off);
- actions_register("ToggleMaximizeHorz", setup_horz_func, g_free,
+ actions_register("ToggleMaximizeHorz", setup_horz_func, free_func,
run_func_toggle);
- actions_register("MaximizeVert", setup_vert_func, g_free,
+ actions_register("MaximizeVert", setup_vert_func, free_func,
run_func_on);
- actions_register("UnmaximizeVert", setup_vert_func, g_free,
+ actions_register("UnmaximizeVert", setup_vert_func, free_func,
run_func_off);
- actions_register("ToggleMaximizeVert", setup_vert_func, g_free,
+ actions_register("ToggleMaximizeVert", setup_vert_func, free_func,
run_func_toggle);
}
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->dir = BOTH;
if ((n = obt_xml_find_node(node, "direction"))) {
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func_on(ObActionsData *data, gpointer options)
{
/* 3.4-compatibility */
static gpointer setup_both_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = BOTH;
return o;
}
static gpointer setup_horz_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = HORZ;
return o;
}
static gpointer setup_vert_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = VERT;
return o;
}
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
void action_moverelative_startup(void)
{
- actions_register("MoveRelative", setup_func, g_free, run_func);
+ actions_register("MoveRelative", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "x")))
o->x = obt_xml_node_int(n);
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_center_func(xmlNodePtr node);
void action_moveresizeto_startup(void)
{
- actions_register("MoveResizeTo", setup_func, g_free, run_func);
+ actions_register("MoveResizeTo", setup_func, free_func, run_func);
/* 3.4-compatibility */
- actions_register("MoveToCenter", setup_center_func, g_free, run_func);
+ actions_register("MoveToCenter", setup_center_func, free_func, run_func);
}
static void parse_coord(xmlNodePtr n, gint *pos,
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->x = G_MININT;
o->y = G_MININT;
o->w = G_MININT;
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
{
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->x = G_MININT;
o->y = G_MININT;
o->w = G_MININT;
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_north_func(xmlNodePtr node);
void action_movetoedge_startup(void)
{
- actions_register("MoveToEdge", setup_func, g_free, run_func);
+ actions_register("MoveToEdge", setup_func, free_func, run_func);
/* 3.4-compatibility */
- actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func);
- actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func);
- actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func);
- actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func);
+ actions_register("MoveToEdgeNorth", setup_north_func, free_func, run_func);
+ actions_register("MoveToEdgeSouth", setup_south_func, free_func, run_func);
+ actions_register("MoveToEdgeEast", setup_east_func, free_func, run_func);
+ actions_register("MoveToEdgeWest", setup_west_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
o->dir = OB_DIRECTION_NORTH;
if ((n = obt_xml_find_node(node, "direction"))) {
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
/* 3.4-compatibility */
static gpointer setup_north_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = OB_DIRECTION_NORTH;
return o;
}
static gpointer setup_south_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = OB_DIRECTION_SOUTH;
return o;
}
static gpointer setup_east_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = OB_DIRECTION_EAST;
return o;
}
static gpointer setup_west_func(xmlNodePtr node)
{
- Options *o = g_new0(Options, 1);
+ Options *o = g_slice_new0(Options);
o->dir = OB_DIRECTION_WEST;
return o;
}
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
static gboolean run_func(ObActionsData *data, gpointer options);
static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
void action_resize_startup(void)
{
- actions_register("Resize", setup_func, g_free, run_func);
+ actions_register("Resize", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "edge"))) {
gchar *s = obt_xml_node_string(n);
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
} Options;
static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer options);
static gboolean run_func(ObActionsData *data, gpointer options);
void action_resizerelative_startup(void)
{
- actions_register("ResizeRelative", setup_func, g_free, run_func);
+ actions_register("ResizeRelative", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "left")))
o->left = obt_xml_node_int(n);
return o;
}
+static void free_func(gpointer o)
+{
+ g_slice_free(Options, o);
+}
+
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "command")) ||
(n = obt_xml_find_node(node, "execute")))
{
Options *o = options;
g_free(o->cmd);
- g_free(o);
+ g_slice_free(Options, o);
}
/* Always return FALSE because its not interactive */
xmlNodePtr n;
Options *o;
- o = g_new0(Options, 1);
+ o = g_slice_new0(Options);
if ((n = obt_xml_find_node(node, "menu")))
o->name = obt_xml_node_string(n);
{
Options *o = options;
g_free(o->name);
- g_free(o);
+ g_slice_free(Options, o);
}
/* Always return FALSE because its not interactive */
ObAppSettings* config_create_app_settings(void)
{
- ObAppSettings *settings = g_new0(ObAppSettings, 1);
+ ObAppSettings *settings = g_slice_new0(ObAppSettings);
settings->type = -1;
settings->decor = -1;
settings->shade = -1;
if (class_set || name_set || role_set || title_set || type_set) {
xmlNodePtr n, c;
- ObAppSettings *settings = config_create_app_settings();;
+ ObAppSettings *settings = config_create_app_settings();
if (name_set)
settings->name = g_pattern_spec_new(name);
if (itd->role) g_pattern_spec_free(itd->role);
if (itd->title) g_pattern_spec_free(itd->title);
if (itd->class) g_pattern_spec_free(itd->class);
- g_free(it->data);
+ g_slice_free(ObAppSettings, it->data);
}
g_slist_free(config_per_app_settings);
}
STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0);
- dock = g_new0(ObDock, 1);
+ dock = g_slice_new0(ObDock);
dock->obwin.type = OB_WINDOW_CLASS_DOCK;
dock->hidden = TRUE;
RrAppearanceFree(dock->a_frame);
window_remove(dock->frame);
stacking_remove(dock);
+ g_slice_free(ObDock, dock);
+ dock = NULL;
}
void dock_manage(Window icon_win, Window name_win)
XWindowAttributes attrib;
gchar **data;
- app = g_new0(ObDockApp, 1);
+ app = g_slice_new0(ObDockApp);
app->name_win = name_win;
app->icon_win = icon_win;
g_free(app->name);
g_free(app->class);
- g_free(app);
+ g_slice_free(ObDockApp, app);
}
void dock_configure(void)
ObFrame *self;
Visual *visual;
- self = g_new0(ObFrame, 1);
+ self = g_slice_new0(ObFrame);
self->client = client;
visual = check_32bit_client(client);
if (self->colormap)
XFreeColormap(obt_display, self->colormap);
- g_free(self);
+ g_slice_free(ObFrame, self);
}
void frame_show(ObFrame *self)
actions_act_unref(sit->data);
g_slist_free(tree->actions);
}
- g_free(tree);
+ g_slice_free(KeyBindingTree, tree);
tree = c;
}
}
GList *kit;
p = ret;
- ret = g_new0(KeyBindingTree, 1);
+ ret = g_slice_new0(KeyBindingTree);
for (kit = it; kit != NULL; kit = g_list_previous(kit))
ret->keylist = g_list_prepend(ret->keylist,
} else {
tmp = b;
b = b->first_child;
- g_free(tmp);
+ g_slice_free(KeyBindingTree, tmp);
a = a->first_child;
}
}
} else {
last->first_child = b->first_child;
last->first_child->parent = last;
- g_free(b);
+ g_slice_free(KeyBindingTree, b);
}
}
}
{
ObMenu *self;
- self = g_new0(ObMenu, 1);
+ self = g_slice_new0(ObMenu);
self->name = g_strdup(name);
self->data = data;
more_menu->more_menu will always be NULL, since there is only 1 for
each menu. */
- self->more_menu = g_new0(ObMenu, 1);
+ self->more_menu = g_slice_new0(ObMenu);
self->more_menu->name = _("More...");
self->more_menu->title = _("More...");
self->more_menu->data = data;
g_free(self->name);
g_free(self->title);
g_free(self->execute);
- g_free(self->more_menu);
+ g_slice_free(ObMenu, self->more_menu);
- g_free(self);
+ g_slice_free(ObMenu, self);
}
void menu_free(ObMenu *menu)
g_assert(menu);
- self = g_new0(ObMenuEntry, 1);
+ self = g_slice_new0(ObMenuEntry);
self->ref = 1;
self->type = type;
self->menu = menu;
break;
}
- g_free(self);
+ g_slice_free(ObMenuEntry, self);
}
}
ObMenuFrame *self;
XSetWindowAttributes attr;
- self = g_new0(ObMenuFrame, 1);
+ self = g_slice_new0(ObMenuFrame);
self->obwin.type = OB_WINDOW_CLASS_MENUFRAME;
self->menu = menu;
self->selected = NULL;
XDestroyWindow(obt_display, self->window);
- g_free(self);
+ g_slice_free(ObMenuFrame, self);
}
}
ObMenuEntryFrame *self;
XSetWindowAttributes attr;
- self = g_new0(ObMenuEntryFrame, 1);
+ self = g_slice_new0(ObMenuEntryFrame);
self->entry = entry;
self->frame = frame;
g_hash_table_remove(menu_frame_map, &self->bullet);
}
- g_free(self);
+ g_slice_free(ObMenuEntryFrame, self);
}
}
actions_act_unref(jt->data);
g_slist_free(b->actions[j]);
}
- g_free(b);
+ g_slice_free(ObMouseBinding, b);
}
g_slist_free(bound_contexts[i]);
bound_contexts[i] = NULL;
}
/* add the binding */
- b = g_new0(ObMouseBinding, 1);
+ b = g_slice_new0(ObMouseBinding);
b->state = state;
b->button = button;
b->actions[mact] = g_slist_append(NULL, action);
/* make sure we're not already pinging the client */
if (g_hash_table_find(ping_ids, find_client, client) != NULL) return;
- t = g_new0(ObPingTarget, 1);
+ t = g_slice_new0(ObPingTarget);
t->client = client;
t->h = h;
obt_main_loop_timeout_remove_data(ob_main_loop, ping_timeout,
t, FALSE);
- g_free(t);
+ g_slice_free(ObPingTarget, t);
}
}
attrib.override_redirect = FALSE;
- self = g_new0(ObPrompt, 1);
+ self = g_slice_new0(ObPrompt);
self->ref = 1;
self->func = func;
self->cleanup = cleanup;
XDestroyWindow(obt_display, self->msg.window);
XDestroyWindow(obt_display, self->super.window);
- g_free(self);
+ g_slice_free(ObPrompt, self);
}
}