Author: jasper
Date: 2006-08-09 18:36:00 +0000 (Wed, 09 Aug 2006)
New Revision: 22697
Modified:
xfce4-panel/trunk/libxfce4panel/Makefile.am
xfce4-panel/trunk/libxfce4panel/xfce-itembar.c
xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin.h
xfce4-panel/trunk/panel/panel-app.c
xfce4-panel/trunk/panel/panel-config.c
xfce4-panel/trunk/panel/panel-dialogs.c
xfce4-panel/trunk/panel/panel-item-manager.c
xfce4-panel/trunk/panel/panel.c
xfce4-panel/trunk/plugins/actions/actions.c
xfce4-panel/trunk/plugins/clock/clock.c
xfce4-panel/trunk/plugins/iconbox/iconbox.c
xfce4-panel/trunk/plugins/launcher/launcher-dialog.c
xfce4-panel/trunk/plugins/launcher/launcher.c
xfce4-panel/trunk/plugins/pager/pager.c
xfce4-panel/trunk/plugins/showdesktop/showdesktop.c
xfce4-panel/trunk/plugins/systray/systray.c
xfce4-panel/trunk/plugins/tasklist/tasklist.c
xfce4-panel/trunk/plugins/windowlist/windowlist-dialog.c
xfce4-panel/trunk/plugins/windowlist/windowlist.c
Log:
Patch by Nick:
* Use g_slice_* functions when available at compile time.
* Add macros to be used by panel and plugins. Similar to exo.
Modified: xfce4-panel/trunk/libxfce4panel/Makefile.am
===================================================================
--- xfce4-panel/trunk/libxfce4panel/Makefile.am 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/libxfce4panel/Makefile.am 2006-08-09 18:36:00 UTC (rev
22697)
@@ -49,6 +49,7 @@
xfce-panel-plugin-iface.h \
xfce-panel-internal-plugin.h \
xfce-panel-external-plugin.h \
+ xfce-panel-macros.h \
xfce-panel-plugin.h
libxfce4panel_la_CFLAGS = \
Modified: xfce4-panel/trunk/libxfce4panel/xfce-itembar.c
===================================================================
--- xfce4-panel/trunk/libxfce4panel/xfce-itembar.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/libxfce4panel/xfce-itembar.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -35,6 +35,7 @@
#include "xfce-marshal.h"
#include "xfce-panel-enum-types.h"
#include "xfce-itembar.h"
+#include "xfce-panel-macros.h"
#define XFCE_ITEMBAR_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_ITEMBAR, XfceItembarPrivate))
@@ -653,7 +654,7 @@
priv = XFCE_ITEMBAR_GET_PRIVATE (widget);
widget->window = gtk_widget_get_parent_window (widget);
- g_object_ref (widget->window);
+ g_object_ref (G_OBJECT (widget->window));
priv->event_window = gdk_window_new (widget->window,
&attributes, attributes_mask);
@@ -857,7 +858,7 @@
gtk_widget_unparent (ic->widget);
- g_free (ic);
+ panel_slice_free (XfceItembarChild, ic);
if (was_visible)
gtk_widget_queue_resize (GTK_WIDGET (container));
@@ -1073,7 +1074,7 @@
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
- child = g_new0 (XfceItembarChild, 1);
+ child = panel_slice_new0 (XfceItembarChild);
child->widget = item;
priv->children = g_list_insert (priv->children, child, position);
Modified: xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin.h
===================================================================
--- xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin.h 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin.h 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <libxfce4panel/xfce-panel-enums.h>
+#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-plugin-iface.h>
#include <libxfce4panel/xfce-panel-internal-plugin.h>
#include <libxfce4panel/xfce-panel-external-plugin.h>
Modified: xfce4-panel/trunk/panel/panel-app.c
===================================================================
--- xfce4-panel/trunk/panel/panel-app.c 2006-08-09 15:06:38 UTC (rev 22696)
+++ xfce4-panel/trunk/panel/panel-app.c 2006-08-09 18:36:00 UTC (rev 22697)
@@ -31,6 +31,7 @@
#include <X11/Xlib.h>
#include <gtk/gtk.h>
#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-convenience.h>
#include "panel-app.h"
@@ -151,7 +152,7 @@
for (i = 0; i < panel_app.monitor_list->len; ++i)
{
XfceMonitor *xmon = g_ptr_array_index (panel_app.monitor_list, i);
- g_free (xmon);
+ panel_slice_free (XfceMonitor, xmon);
}
g_ptr_array_free (panel_app.monitor_list, TRUE);
}
@@ -337,7 +338,7 @@
for (j = 0; j < n_monitors; ++j)
{
- monitor = g_new0 (XfceMonitor, 1);
+ monitor = panel_slice_new0 (XfceMonitor);
monitor->screen = screen;
monitor->num = j;
@@ -358,7 +359,7 @@
h = monitor->geometry.height;
#if TEST_MULTIPLE_MONITORS
- monitor = g_new0 (XfceMonitor, 1);
+ monitor = panel_slice_new0 (XfceMonitor);
monitor->screen = screen;
monitor->num = j;
@@ -825,7 +826,7 @@
dlg = xfce_about_dialog_new_with_values (NULL, info, pb);
gtk_window_set_screen (GTK_WINDOW (dlg),
gtk_widget_get_screen (panel));
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
gtk_widget_set_size_request (dlg, 400, 300);
Modified: xfce4-panel/trunk/panel/panel-config.c
===================================================================
--- xfce4-panel/trunk/panel/panel-config.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/panel/panel-config.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -34,6 +34,7 @@
#include <gtk/gtkenums.h>
#include <libxfce4util/libxfce4util.h>
+#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-convenience.h>
#include "panel-config.h"
@@ -64,7 +65,7 @@
DBG ("No suitable panel configuration was found.");
panel = panel_new ();
- g_object_ref (panel);
+ g_object_ref (G_OBJECT (panel));
gtk_object_sink (GTK_OBJECT (panel));
panel_add_item (panel, PANEL_LAUNCHER);
@@ -527,7 +528,8 @@
if (contents == NULL)
{
- contents = g_malloc ((size_t) sb.st_size);
+ contents = panel_slice_alloc ((size_t) sb.st_size);
+
if (contents == NULL)
{
g_critical ("Unable to allocate %lu bytes of memory to load "
@@ -595,7 +597,7 @@
#endif
if (contents != NULL)
- g_free (contents);
+ panel_slice_free1 ((size_t) sb.st_size, contents);
if (close (fd) < 0)
{
Modified: xfce4-panel/trunk/panel/panel-dialogs.c
===================================================================
--- xfce4-panel/trunk/panel/panel-dialogs.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/panel/panel-dialogs.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -30,6 +30,7 @@
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-itembar.h>
+#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-item-iface.h>
#include "panel-properties.h"
@@ -481,7 +482,7 @@
gtk_widget_destroy (dlg);
g_signal_handler_disconnect (pid->panel, pid->panel_destroy_id);
- g_free (pid);
+ panel_slice_free (PanelItemsDialog, pid);
panel_app_save ();
}
@@ -512,7 +513,7 @@
return;
}
- pid = g_new0 (PanelItemsDialog, 1);
+ pid = panel_slice_new0 (PanelItemsDialog);
/* panels */
pid->panels = panels;
@@ -1098,7 +1099,7 @@
g_signal_connect (pmd->handle_style, "changed",
G_CALLBACK (handle_style_changed), pmd);
- g_object_unref (sg);
+ g_object_unref (G_OBJECT (sg));
}
/* monitors */
@@ -1490,8 +1491,8 @@
gtk_widget_destroy (dlg);
- g_object_unref (pmd->tips);
- g_free (pmd);
+ g_object_unref (G_OBJECT (pmd->tips));
+ panel_slice_free (PanelManagerDialog, pmd);
panel_app_save ();
}
@@ -1515,7 +1516,7 @@
return;
}
- pmd = g_new0 (PanelManagerDialog, 1);
+ pmd = panel_slice_new0 (PanelManagerDialog);
/* panels */
pmd->panels = panels;
@@ -1534,7 +1535,7 @@
gtk_window_set_icon_name (GTK_WINDOW (pmd->dlg), "xfce4-panel");
pmd->tips = gtk_tooltips_new ();
- g_object_ref (pmd->tips);
+ g_object_ref (G_OBJECT (pmd->tips));
gtk_object_sink (GTK_OBJECT (pmd->tips));
/* main container */
Modified: xfce4-panel/trunk/panel/panel-item-manager.c
===================================================================
--- xfce4-panel/trunk/panel/panel-item-manager.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/panel/panel-item-manager.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -31,6 +31,7 @@
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-panel-item-iface.h>
+#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-internal-plugin.h>
#include <libxfce4panel/xfce-panel-external-item.h>
#include <libxfce4panel/xfce-panel-enums.h>
@@ -85,7 +86,7 @@
g_free (class->file);
- g_free (class);
+ panel_slice_free (XfcePanelItemClass, class);
}
static void
@@ -95,7 +96,7 @@
GPtrArray *array = data;
XfcePanelItemInfo *info;
- info = g_new0 (XfcePanelItemInfo, 1);
+ info = panel_slice_new0 (XfcePanelItemInfo);
info->name = plugin_name;
info->display_name = class->name;
@@ -158,7 +159,7 @@
g_file_test (value, G_FILE_TEST_EXISTS))
{
- class = g_new0 (XfcePanelItemClass, 1);
+ class = panel_slice_new0 (XfcePanelItemClass);
class->file = g_strdup (value);
@@ -169,7 +170,7 @@
else if ((value = xfce_rc_read_entry (rc, "X-XFCE-Module", NULL)) &&
g_file_test (value, G_FILE_TEST_EXISTS))
{
- class = g_new0 (XfcePanelItemClass, 1);
+ class = panel_slice_new0 (XfcePanelItemClass);
class->file = g_strdup (value);
@@ -485,9 +486,9 @@
XfcePanelItemInfo *info = g_ptr_array_index (info_list, i);
if (info->icon)
- g_object_unref (info->icon);
+ g_object_unref (G_OBJECT (info->icon));
- g_free (info);
+ panel_slice_free (XfcePanelItemInfo, info);
}
g_ptr_array_free (info_list, TRUE);
Modified: xfce4-panel/trunk/panel/panel.c
===================================================================
--- xfce4-panel/trunk/panel/panel.c 2006-08-09 15:06:38 UTC (rev 22696)
+++ xfce4-panel/trunk/panel/panel.c 2006-08-09 18:36:00 UTC (rev 22697)
@@ -546,7 +546,7 @@
gdk_drawable_get_size (d, &w, &h);
pb = gdk_pixbuf_get_from_drawable (NULL, d, NULL, 0, 0, 0, 0, w, h);
gtk_drag_set_icon_pixbuf (drag_context, pb, 0, 0);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
priv->drag_widget = plugin;
}
Modified: xfce4-panel/trunk/plugins/actions/actions.c
===================================================================
--- xfce4-panel/trunk/plugins/actions/actions.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/plugins/actions/actions.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -129,11 +129,11 @@
width = size / 2 - 2 * border;
pb = actions_load_icon (ACTION_LOCK, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
pb = actions_load_icon (ACTION_QUIT, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image2), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
break;
case ACTION_QUIT:
@@ -141,7 +141,7 @@
width = MIN(size - border, MAX(16, size/2 - border));
pb = actions_load_icon (action->type, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
break;
}
@@ -209,7 +209,7 @@
if (dlg)
gtk_widget_destroy (dlg);
- g_free (action);
+ panel_slice_free (Action, action);
}
/* create widgets and connect to signals */
@@ -314,7 +314,7 @@
static void
actions_construct (XfcePanelPlugin *plugin)
{
- Action *action = g_new0 (Action, 1);
+ Action *action = panel_slice_new0 (Action);
action->plugin = plugin;
Modified: xfce4-panel/trunk/plugins/clock/clock.c
===================================================================
--- xfce4-panel/trunk/plugins/clock/clock.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/plugins/clock/clock.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -228,8 +228,8 @@
gtk_widget_destroy (dlg);
g_source_remove (clock->timeout_id);
- g_object_unref (clock->tips);
- g_free (clock);
+ g_object_unref (G_OBJECT (clock->tips));
+ panel_slice_free (Clock, clock);
}
static void
@@ -309,7 +309,7 @@
static void
clock_construct (XfcePanelPlugin *plugin)
{
- Clock *clock = g_new0 (Clock, 1);
+ Clock *clock = panel_slice_new0 (Clock);
clock->plugin = plugin;
@@ -339,7 +339,7 @@
clock_read_rc_file (plugin, clock);
clock->tips = gtk_tooltips_new ();
- g_object_ref (clock->tips);
+ g_object_ref (G_OBJECT (clock->tips));
gtk_object_sink (GTK_OBJECT (clock->tips));
clock_date_tooltip (clock);
Modified: xfce4-panel/trunk/plugins/iconbox/iconbox.c
===================================================================
--- xfce4-panel/trunk/plugins/iconbox/iconbox.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/plugins/iconbox/iconbox.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -168,7 +168,7 @@
xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE
(icon->image),
scaled);
- g_object_unref (scaled);
+ g_object_unref (G_OBJECT (scaled));
icon->was_minimized = TRUE;
}
@@ -254,12 +254,12 @@
Icon *icon = (Icon *)data;
if (icon->pb)
- g_object_unref (icon->pb);
+ g_object_unref (G_OBJECT (icon->pb));
icon->pb = netk_window_get_icon (icon->window);
if (icon->pb)
- g_object_ref (icon->pb);
+ g_object_ref (G_OBJECT (icon->pb));
icon_update_image (icon);
}
@@ -278,15 +278,15 @@
}
if (icon->pb)
- g_object_unref (icon->pb);
+ g_object_unref (G_OBJECT (icon->pb));
- g_free (icon);
+ panel_slice_free (Icon, icon);
}
static Icon *
icon_new (NetkWindow *window, Iconbox *ib)
{
- Icon *icon = g_new0 (Icon, 1);
+ Icon *icon = panel_slice_new0 (Icon);
int i = 0;
icon->ib = ib;
@@ -307,7 +307,7 @@
{
xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (icon->image),
icon->pb);
- g_object_ref (icon->pb);
+ g_object_ref (G_OBJECT (icon->pb));
}
icon->connections[i++] =
@@ -481,9 +481,9 @@
{
cleanup_icons (ib);
- g_object_unref (ib->icon_tooltips);
+ g_object_unref (G_OBJECT (ib->icon_tooltips));
- g_free (ib);
+ panel_slice_free (Iconbox, ib);
}
@@ -678,7 +678,7 @@
static void
iconbox_construct (XfcePanelPlugin *plugin)
{
- Iconbox *iconbox = g_new0 (Iconbox, 1);
+ Iconbox *iconbox = panel_slice_new0 (Iconbox);
g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (iconbox_orientation_changed), iconbox);
@@ -739,7 +739,7 @@
G_CALLBACK (handle_expose), iconbox);
iconbox->icon_tooltips = gtk_tooltips_new ();
- g_object_ref (iconbox->icon_tooltips);
+ g_object_ref (G_OBJECT (iconbox->icon_tooltips));
gtk_object_sink (GTK_OBJECT (iconbox->icon_tooltips));
iconbox->screen_changed_id =
Modified: xfce4-panel/trunk/plugins/launcher/launcher-dialog.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher-dialog.c 2006-08-09
15:06:38 UTC (rev 22696)
+++ xfce4-panel/trunk/plugins/launcher/launcher-dialog.c 2006-08-09
18:36:00 UTC (rev 22697)
@@ -208,7 +208,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &ld->entry->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
else if (ld->entry->icon.type != LAUNCHER_ICON_TYPE_NAME ||
strcmp (text, ld->entry->icon.icon.name) != 0)
@@ -222,7 +222,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &ld->entry->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
gtk_widget_queue_draw (ld->tree);
@@ -382,7 +382,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &ld->entry->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
if (ld->entry == g_ptr_array_index (ld->launcher->entries, 0))
set_panel_icon (ld);
@@ -415,7 +415,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &ld->entry->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
if (ld->entry == g_ptr_array_index (ld->launcher->entries, 0))
set_panel_icon (ld);
@@ -536,7 +536,7 @@
img = gtk_image_new_from_pixbuf (pb);
gtk_widget_show (img);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
mi = gtk_separator_menu_item_new ();
@@ -718,7 +718,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &ld->entry->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
if (ld->entry->icon.type != LAUNCHER_ICON_TYPE_CATEGORY)
gtk_widget_show (ld->icon_file_align);
@@ -783,7 +783,7 @@
add_entry_exec_options (ld, GTK_BOX (vbox), sg);
- g_object_unref (sg);
+ g_object_unref (G_OBJECT (sg));
launcher_dialog_update_entry_properties (ld);
@@ -877,7 +877,7 @@
{
pb = launcher_icon_load_pixbuf (tree, &entry->icon, DLG_ICON_SIZE);
g_object_set (cell, "pixbuf", pb, NULL);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
else
{
@@ -1291,7 +1291,7 @@
launcher_save (ld->plugin, ld->launcher);
- g_free (ld);
+ panel_slice_free (LauncherDialog, ld);
}
void
@@ -1300,7 +1300,7 @@
LauncherDialog *ld;
GtkWidget *vbox, *hbox;
- ld = g_new0 (LauncherDialog, 1);
+ ld = panel_slice_new0 (LauncherDialog);
ld->plugin = plugin;
ld->launcher = launcher;
@@ -1469,9 +1469,9 @@
}
}
- g_object_unref(info->plugin);
+ g_object_unref(G_OBJECT (info->plugin));
g_free(info->interface_uri);
- g_free(info);
+ panel_slice_free(ZeroInstallProcess, info);
}
/** The user wants to add a launcher for 'interface'. Confirm that it
@@ -1506,13 +1506,13 @@
else
{
ZeroInstallProcess *info;
- info = g_new0 (ZeroInstallProcess, 1);
+ info = panel_slice_new0 (ZeroInstallProcess);
info->interface_uri = g_strdup(interface);
info->plugin = G_OBJECT(ld->plugin);
info->entry = entry;
- g_object_ref (info->plugin);
+ g_object_ref (G_OBJECT (info->plugin));
g_child_watch_add (pid,
(GChildWatchFunc) zero_install_launch_done,
info);
@@ -1612,7 +1612,7 @@
g_free (value);
}
- g_object_unref (dentry);
+ g_object_unref (G_OBJECT (dentry));
return e;
}
@@ -1709,7 +1709,7 @@
pb = launcher_icon_load_pixbuf (ld->icon_img, &e->icon,
DLG_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (ld->icon_img), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
}
@@ -1797,7 +1797,7 @@
}
tmp = gdk_pixbuf_scale_simple (pb, w, h, GDK_INTERP_BILINEAR);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
pb = tmp;
}
}
@@ -1807,7 +1807,7 @@
gtk_image_set_from_pixbuf(preview, pb);
if (pb)
- g_object_unref(pb);
+ g_object_unref(G_OBJECT (pb));
}
/* Any of the arguments may be NULL */
Modified: xfce4-panel/trunk/plugins/launcher/launcher.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/plugins/launcher/launcher.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -339,7 +339,7 @@
LauncherEntry *
launcher_entry_new (void)
{
- return g_new0 (LauncherEntry, 1);
+ return panel_slice_new0 (LauncherEntry);
}
void
@@ -352,7 +352,7 @@
g_free (e->exec);
g_free (e->real_exec);
- g_free (e);
+ panel_slice_free (LauncherEntry, e);
}
static void
@@ -640,7 +640,7 @@
img = gtk_image_new_from_pixbuf (pb);
gtk_widget_show (img);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
g_list_free (children);
@@ -732,7 +732,7 @@
pb = launcher_icon_load_pixbuf (launcher->image, &(entry->icon), size);
gtk_image_set_from_pixbuf (GTK_IMAGE (launcher->image), pb);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
if (entry->name)
{
@@ -1211,12 +1211,12 @@
size = xfce_panel_plugin_get_size (plugin);
screen_position = xfce_panel_plugin_get_screen_position (plugin);
- launcher = g_new0 (LauncherPlugin, 1);
+ launcher = panel_slice_new0 (LauncherPlugin);
launcher->plugin = GTK_WIDGET (plugin);
launcher->tips = gtk_tooltips_new ();
- g_object_ref (launcher->tips);
+ g_object_ref (G_OBJECT (launcher->tips));
gtk_object_sink (GTK_OBJECT (launcher->tips));
launcher->entries = g_ptr_array_new ();
@@ -1295,7 +1295,7 @@
if (launcher->entries->len == 0)
{
- LauncherEntry *entry = entry = g_new0 (LauncherEntry, 1);
+ LauncherEntry *entry = entry = panel_slice_new0 (LauncherEntry);
entry->name = g_strdup (_("New Item"));
entry->comment = g_strdup (_("This item has not yet been configured"));
@@ -1322,7 +1322,7 @@
{
int i;
- g_object_unref (launcher->tips);
+ g_object_unref (G_OBJECT (launcher->tips));
for (i = 0; i < launcher->entries->len; ++i)
{
@@ -1337,5 +1337,5 @@
gtk_widget_destroy (launcher->menu);
launcher->plugin = NULL;
- g_free (launcher);
+ panel_slice_free (LauncherPlugin, launcher);
}
Modified: xfce4-panel/trunk/plugins/pager/pager.c
===================================================================
--- xfce4-panel/trunk/plugins/pager/pager.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/plugins/pager/pager.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -111,7 +111,7 @@
}
- g_free (pager);
+ panel_slice_free (Pager, pager);
}
static void
@@ -205,7 +205,7 @@
{
GdkScreen *screen;
int screen_idx;
- Pager *pager = g_new0 (Pager, 1);
+ Pager *pager = panel_slice_new0 (Pager);
g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (pager_orientation_changed), pager);
Modified: xfce4-panel/trunk/plugins/showdesktop/showdesktop.c
===================================================================
--- xfce4-panel/trunk/plugins/showdesktop/showdesktop.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/plugins/showdesktop/showdesktop.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -91,7 +91,7 @@
sdd->netk_id = sdd->screen_id = sdd->style_id = 0;
gtk_object_sink (GTK_OBJECT (sdd->tooltips));
- g_free (sdd);
+ panel_slice_free (ShowDesktopData, sdd);
}
static void
@@ -171,7 +171,7 @@
static void
showdesktop_construct (XfcePanelPlugin * plugin)
{
- ShowDesktopData *sdd = g_new0 (ShowDesktopData, 1);
+ ShowDesktopData *sdd = panel_slice_new0 (ShowDesktopData);
sdd->plugin = plugin;
Modified: xfce4-panel/trunk/plugins/systray/systray.c
===================================================================
--- xfce4-panel/trunk/plugins/systray/systray.c 2006-08-09 15:06:38 UTC (rev
22696)
+++ xfce4-panel/trunk/plugins/systray/systray.c 2006-08-09 18:36:00 UTC (rev
22697)
@@ -224,7 +224,7 @@
gtk_widget_destroy (dlg);
systray_stop (systray);
- g_free (systray);
+ panel_slice_free (Systray, systray);
}
static void
@@ -274,7 +274,7 @@
static void
systray_construct (XfcePanelPlugin *plugin)
{
- Systray *systray = g_new0 (Systray, 1);
+ Systray *systray = panel_slice_new0 (Systray);
g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (systray_orientation_changed), systray);
Modified: xfce4-panel/trunk/plugins/tasklist/tasklist.c
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/tasklist.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/plugins/tasklist/tasklist.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -122,7 +122,7 @@
gtk_widget_destroy (dlg);
g_signal_handler_disconnect (plugin, tasklist->screen_changed_id);
- g_free (tasklist);
+ panel_slice_free (Tasklist, tasklist);
}
static void
@@ -240,7 +240,7 @@
{
GdkScreen *screen;
int screen_idx;
- Tasklist *tasklist = g_new0 (Tasklist, 1);
+ Tasklist *tasklist = panel_slice_new0 (Tasklist);
tasklist->plugin = plugin;
Modified: xfce4-panel/trunk/plugins/windowlist/windowlist-dialog.c
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/windowlist-dialog.c 2006-08-09
15:06:38 UTC (rev 22696)
+++ xfce4-panel/trunk/plugins/windowlist/windowlist-dialog.c 2006-08-09
18:36:00 UTC (rev 22697)
@@ -100,7 +100,7 @@
xfce_panel_plugin_unblock_menu (wd->wl->plugin);
- g_free (wd);
+ panel_slice_free (WindowlistDialog, wd);
}
void
@@ -112,7 +112,7 @@
GtkWidget *dlg, *vbox, *vbox2, *frame, *hbox,
*alignment, *label, *button, *image;
- wd = g_new0 (WindowlistDialog, 1);
+ wd = panel_slice_new0 (WindowlistDialog);
wd->wl = wl;
Modified: xfce4-panel/trunk/plugins/windowlist/windowlist.c
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/windowlist.c 2006-08-09 15:06:38 UTC
(rev 22696)
+++ xfce4-panel/trunk/plugins/windowlist/windowlist.c 2006-08-09 18:36:00 UTC
(rev 22697)
@@ -64,8 +64,8 @@
/**
* Common functions
**/
-static gchar *
-menulist_utf8_string (gchar *string)
+static char *
+menulist_utf8_string (const char *string)
{
char *utf8 = NULL;
if (!g_utf8_validate(string, -1, NULL))
@@ -358,7 +358,7 @@
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
if (G_LIKELY (tmp))
- g_object_unref (tmp);
+ g_object_unref (G_OBJECT (tmp));
}
else
{
@@ -821,7 +821,7 @@
GTK_ICON_SIZE_MENU, NULL);
wl->icon = xfce_scaled_image_new_from_pixbuf (pb);
gtk_container_add (GTK_CONTAINER (wl->button), wl->icon);
- g_object_unref (pb);
+ g_object_unref (G_OBJECT (pb));
wl->screen_callback_id =
g_signal_connect (wl->screen, "active-window-changed",
@@ -1058,7 +1058,7 @@
GdkScreen *screen;
int screen_idx;
- Windowlist *wl = g_new0 (Windowlist, 1);
+ Windowlist *wl = panel_slice_new0 (Windowlist);
/* Some default values if everything goes wrong */
wl->layout = DEF_BUTTON_LAYOUT;
@@ -1079,7 +1079,7 @@
wl->plugin = plugin;
wl->tooltips = gtk_tooltips_new ();
- g_object_ref (wl->tooltips);
+ g_object_ref (G_OBJECT (wl->tooltips));
gtk_object_sink (GTK_OBJECT (wl->tooltips));
/* get the screen where the widget is, for dual screen */
@@ -1144,7 +1144,7 @@
windowlist_free (XfcePanelPlugin * plugin,
Windowlist * wl)
{
- g_object_unref (wl->tooltips);
+ g_object_unref (G_OBJECT (wl->tooltips));
if (wl->screen_callback_id)
g_signal_handler_disconnect (wl->screen, wl->screen_callback_id);
@@ -1169,7 +1169,7 @@
if (wl->button)
gtk_widget_destroy (wl->button);
- g_free (wl);
+ panel_slice_free (Windowlist, wl);
}
static void
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits