Browse Source

Patch by Nick:

* Use g_slice_* functions when available at compile time.
 * Add macros to be used by panel and plugins. Similar to exo.


(Old svn revision: 22697)
upstream/xfce4-panel-4.10.1
Jasper Huijsmans 17 years ago
parent
commit
c7b0fb6dda
  1. 1
      libxfce4panel/Makefile.am
  2. 7
      libxfce4panel/xfce-itembar.c
  3. 1
      libxfce4panel/xfce-panel-plugin.h
  4. 9
      panel/panel-app.c
  5. 8
      panel/panel-config.c
  6. 15
      panel/panel-dialogs.c
  7. 13
      panel/panel-item-manager.c
  8. 2
      panel/panel.c
  9. 10
      plugins/actions/actions.c
  10. 8
      plugins/clock/clock.c
  11. 22
      plugins/iconbox/iconbox.c
  12. 36
      plugins/launcher/launcher-dialog.c
  13. 18
      plugins/launcher/launcher.c
  14. 4
      plugins/pager/pager.c
  15. 4
      plugins/showdesktop/showdesktop.c
  16. 4
      plugins/systray/systray.c
  17. 4
      plugins/tasklist/tasklist.c
  18. 4
      plugins/windowlist/windowlist-dialog.c
  19. 16
      plugins/windowlist/windowlist.c

1
libxfce4panel/Makefile.am

@ -49,6 +49,7 @@ xfce4_panelinclude_HEADERS = \
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 = \

7
libxfce4panel/xfce-itembar.c

@ -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 @@ xfce_itembar_realize (GtkWidget * widget)
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 @@ xfce_itembar_remove (GtkContainer * container, GtkWidget *child)
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 @@ xfce_itembar_insert (XfceItembar * itembar, GtkWidget * item, int position)
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);

1
libxfce4panel/xfce-panel-plugin.h

@ -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>

9
panel/panel-app.c

@ -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 @@ cleanup_panels (void)
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 @@ create_monitor_list (void)
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 @@ create_monitor_list (void)
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 @@ panel_app_about (GtkWidget *panel)
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);

8
panel/panel-config.c

@ -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 @@ create_fallback_panel_array (void)
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 @@ config_parse_file (const char *filename)
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 @@ finished:
#endif
if (contents != NULL)
g_free (contents);
panel_slice_free1 ((size_t) sb.st_size, contents);
if (close (fd) < 0)
{

15
panel/panel-dialogs.c

@ -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 @@ item_dialog_response (GtkWidget *dlg, int response, PanelItemsDialog *pid)
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 @@ add_items_dialog (GPtrArray *panels, GtkWidget *active_item)
return;
}
pid = g_new0 (PanelItemsDialog, 1);
pid = panel_slice_new0 (PanelItemsDialog);
/* panels */
pid->panels = panels;
@ -1098,7 +1099,7 @@ add_position_options (GtkBox *box, PanelManagerDialog *pmd)
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 @@ panel_dialog_response (GtkWidget *dlg, int response, PanelManagerDialog *pmd)
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 @@ panel_manager_dialog (GPtrArray *panels)
return;
}
pmd = g_new0 (PanelManagerDialog, 1);
pmd = panel_slice_new0 (PanelManagerDialog);
/* panels */
pmd->panels = panels;
@ -1534,7 +1535,7 @@ panel_manager_dialog (GPtrArray *panels)
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 */

13
panel/panel-item-manager.c

@ -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 @@ _free_item_class (XfcePanelItemClass *class)
g_free (class->file);
g_free (class);
panel_slice_free (XfcePanelItemClass, class);
}
static void
@ -95,7 +96,7 @@ _add_item_info_to_array (char *plugin_name, XfcePanelItemClass *class,
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 @@ _new_plugin_class_from_desktop_file (const char *file)
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 @@ _new_plugin_class_from_desktop_file (const char *file)
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 @@ xfce_panel_item_manager_free_item_info_list (GPtrArray *info_list)
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);

2
panel/panel.c

@ -546,7 +546,7 @@ _panel_drag_begin (GtkWidget *widget, GdkDragContext *drag_context,
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;
}

10
plugins/actions/actions.c

@ -129,11 +129,11 @@ actions_set_size (XfcePanelPlugin *plugin, int size, Action *action)
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 @@ actions_set_size (XfcePanelPlugin *plugin, int size, Action *action)
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 @@ actions_free_data (XfcePanelPlugin *plugin, Action *action)
if (dlg)
gtk_widget_destroy (dlg);
g_free (action);
panel_slice_free (Action, action);
}
/* create widgets and connect to signals */
@ -314,7 +314,7 @@ actions_icontheme_changed (XfcePanelPlugin *plugin, gpointer ignored,
static void
actions_construct (XfcePanelPlugin *plugin)
{
Action *action = g_new0 (Action, 1);
Action *action = panel_slice_new0 (Action);
action->plugin = plugin;

8
plugins/clock/clock.c

@ -228,8 +228,8 @@ clock_free_data (XfcePanelPlugin *plugin, Clock *clock)
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 @@ clock_write_rc_file (XfcePanelPlugin *plugin, Clock *clock)
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_construct (XfcePanelPlugin *plugin)
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);

22
plugins/iconbox/iconbox.c

@ -168,7 +168,7 @@ icon_update_image (Icon *icon)
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_changed (NetkWindow *window, gpointer data)
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 @@ icon_destroy (Icon *icon)
}
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 @@ icon_new (NetkWindow *window, Iconbox *ib)
{
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_iconbox (Iconbox *ib)
{
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 @@ iconbox_screen_changed (GtkWidget *plugin, GdkScreen *screen, Iconbox *ib)
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 @@ iconbox_construct (XfcePanelPlugin *plugin)
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 =

36
plugins/launcher/launcher-dialog.c

@ -208,7 +208,7 @@ update_entry_icon (LauncherDialog *ld)
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 @@ update_entry_icon (LauncherDialog *ld)
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 @@ icon_menu_activated (GtkWidget *mi, LauncherDialog *ld)
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 @@ icon_browse (GtkWidget *b, LauncherDialog *ld)
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 @@ create_icon_category_menu (LauncherDialog *ld)
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 @@ launcher_dialog_update_entry_properties (LauncherDialog *ld)
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 @@ launcher_dialog_add_entry_properties (LauncherDialog *ld, GtkBox *box)
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 @@ render_icon (GtkTreeViewColumn * col, GtkCellRenderer * cell,
{
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_dialog_response (GtkWidget *dlg, int response, LauncherDialog *ld)
launcher_save (ld->plugin, ld->launcher);
g_free (ld);
panel_slice_free (LauncherDialog, ld);
}
void
@ -1300,7 +1300,7 @@ launcher_properties_dialog (XfcePanelPlugin *plugin, LauncherPlugin * launcher)
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 @@ zero_install_launch_done (GPid pid, gint status, ZeroInstallProcess *info)
}
}
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 @@ start_entry_from_interface_file (LauncherDialog *ld,
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 @@ update_entry_from_desktop_file (LauncherEntry *e, const char *path)
g_free (value);
}
g_object_unref (dentry);
g_object_unref (G_OBJECT (dentry));
return e;
}
@ -1709,7 +1709,7 @@ entry_dialog_data_received (GtkWidget *w, GdkDragContext *context,
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 @@ update_preview_cb (GtkFileChooser *chooser, gpointer data)
}
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 @@ update_preview_cb (GtkFileChooser *chooser, gpointer data)
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 */

18
plugins/launcher/launcher.c

@ -339,7 +339,7 @@ launcher_icon_load_pixbuf (GtkWidget *w, LauncherIcon * icon, int size)
LauncherEntry *
launcher_entry_new (void)
{
return g_new0 (LauncherEntry, 1);
return panel_slice_new0 (LauncherEntry);
}
void
@ -352,7 +352,7 @@ launcher_entry_free (LauncherEntry *e)
g_free (e->exec);
g_free (e->real_exec);
g_free (e);
panel_slice_free (LauncherEntry, e);
}
static void
@ -640,7 +640,7 @@ load_menu_icons (LauncherPlugin *launcher)
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 @@ launcher_update_panel_entry (LauncherPlugin *launcher)
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 @@ launcher_new (XfcePanelPlugin *plugin)
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 @@ launcher_new (XfcePanelPlugin *plugin)
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 @@ launcher_free (LauncherPlugin *launcher)
{
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 @@ launcher_free (LauncherPlugin *launcher)
gtk_widget_destroy (launcher->menu);
launcher->plugin = NULL;
g_free (launcher);
panel_slice_free (LauncherPlugin, launcher);
}

4
plugins/pager/pager.c

@ -111,7 +111,7 @@ pager_free_data (XfcePanelPlugin *plugin, Pager *pager)
}
g_free (pager);
panel_slice_free (Pager, pager);
}
static void
@ -205,7 +205,7 @@ pager_construct (XfcePanelPlugin *plugin)
{
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);

4
plugins/showdesktop/showdesktop.c

@ -91,7 +91,7 @@ showdesktop_free_data (XfcePanelPlugin * plugin, ShowDesktopData * sdd)
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 @@ showdesktop_style_set (XfcePanelPlugin *plugin, gpointer ignored,
static void
showdesktop_construct (XfcePanelPlugin * plugin)
{
ShowDesktopData *sdd = g_new0 (ShowDesktopData, 1);
ShowDesktopData *sdd = panel_slice_new0 (ShowDesktopData);
sdd->plugin = plugin;

4
plugins/systray/systray.c

@ -224,7 +224,7 @@ systray_free_data (XfcePanelPlugin *plugin, Systray *systray)
gtk_widget_destroy (dlg);
systray_stop (systray);
g_free (systray);
panel_slice_free (Systray, systray);
}
static void
@ -274,7 +274,7 @@ systray_write_rc_file (XfcePanelPlugin *plugin, Systray *systray)
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);

4
plugins/tasklist/tasklist.c

@ -122,7 +122,7 @@ tasklist_free_data (XfcePanelPlugin *plugin, Tasklist *tasklist)
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 @@ tasklist_construct (XfcePanelPlugin *plugin)
{
GdkScreen *screen;
int screen_idx;
Tasklist *tasklist = g_new0 (Tasklist, 1);
Tasklist *tasklist = panel_slice_new0 (Tasklist);
tasklist->plugin = plugin;

4
plugins/windowlist/windowlist-dialog.c

@ -100,7 +100,7 @@ windowlist_properties_response (GtkWidget *dlg,
xfce_panel_plugin_unblock_menu (wd->wl->plugin);
g_free (wd);
panel_slice_free (WindowlistDialog, wd);
}
void
@ -112,7 +112,7 @@ windowlist_properties (XfcePanelPlugin *plugin,
GtkWidget *dlg, *vbox, *vbox2, *frame, *hbox,
*alignment, *label, *button, *image;
wd = g_new0 (WindowlistDialog, 1);
wd = panel_slice_new0 (WindowlistDialog);
wd->wl = wl;

16
plugins/windowlist/windowlist.c

@ -64,8 +64,8 @@ XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (windowlist_construct);
/**
* 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 @@ menulist_menu_item (NetkWindow *window,
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 @@ windowlist_create_button (Windowlist * wl)
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 @@ windowlist_new (XfcePanelPlugin * plugin)
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 @@ windowlist_new (XfcePanelPlugin * plugin)
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 @@ static void
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 @@ windowlist_free (XfcePanelPlugin * plugin,
if (wl->button)
gtk_widget_destroy (wl->button);
g_free (wl);
panel_slice_free (Windowlist, wl);
}
static void

Loading…
Cancel
Save