Commit 33fda156 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Compile also with GDK_DISABLE_DEPRECATED and

Wed Dec 26 16:25:50 2001  George Lebl <jirka@5z.com>

	* Makefile.am, basep-widget.c, button-widget.c, foobar-widget.c,
	  global-keys.c, gnome-panel-properties.c, gnome-panel-screenshot.c,
	  gnome-run.c, launcher.c, main.c, menu.c, nothing.cP, panel-util.c,
	  panel-widget.c, panel.c, rgb-stuff.c, xstuff.c:  Compile also
	  with GDK_DISABLE_DEPRECATED and GDK_PIXBUF_DISABLE_DEPRECATED,
	  and all except gnome-run.c with GTK_DISABLE_DEPRECATED

	* foobar-widget.c: always convert to utf8 after getting something
	  from strftime
parent 4c2aba7f
Wed Dec 26 16:25:50 2001 George Lebl <jirka@5z.com>
* Makefile.am, basep-widget.c, button-widget.c, foobar-widget.c,
global-keys.c, gnome-panel-properties.c, gnome-panel-screenshot.c,
gnome-run.c, launcher.c, main.c, menu.c, nothing.cP, panel-util.c,
panel-widget.c, panel.c, rgb-stuff.c, xstuff.c: Compile also
with GDK_DISABLE_DEPRECATED and GDK_PIXBUF_DISABLE_DEPRECATED,
and all except gnome-run.c with GTK_DISABLE_DEPRECATED
* foobar-widget.c: always convert to utf8 after getting something
from strftime
Wed Dec 26 14:01:24 2001 George Lebl <jirka@5z.com>
* foobar-widget.c: fix width of clock label. Now if the time
......
......@@ -14,6 +14,9 @@ INCLUDES = \
-I$(top_builddir)/panel \
-DPANEL_DEBUG \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED \
-DGNOME_CORE_INTERNAL \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
......@@ -29,11 +32,6 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(NULL)
# we want this eventually
#-DGTK_DISABLE_DEPRECATED \
#
bin_PROGRAMS = \
gnome-panel-2 \
gnome-panel-properties \
......
......@@ -1904,7 +1904,7 @@ basep_widget_autohide (gpointer data)
return TRUE;
if (!gdk_pointer_is_grabbed ()) {
if (gdk_pointer_grab (GDK_ROOT_PARENT(), FALSE,
if (gdk_pointer_grab (gdk_get_default_root_window (), FALSE,
0, NULL, NULL, GDK_CURRENT_TIME)
!= GrabSuccess) {
return TRUE;
......
......@@ -300,7 +300,7 @@ button_widget_realize(GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y;
widget->window = gtk_widget_get_parent_window(widget);
gdk_window_ref(widget->window);
g_object_ref (G_OBJECT (widget->window));
button_widget->event_window = gdk_window_new (parent->window,
&attributes,
......@@ -361,13 +361,13 @@ button_widget_destroy(GtkWidget *w, gpointer data)
gtk_timeout_remove(button->pressed_timeout);
if(button->pixbuf)
gdk_pixbuf_unref(button->pixbuf);
g_object_unref (G_OBJECT (button->pixbuf));
button->pixbuf = NULL;
if(button->pixbuf_hc)
gdk_pixbuf_unref(button->pixbuf_hc);
g_object_unref (G_OBJECT (button->pixbuf_hc));
button->pixbuf_hc = NULL;
if(button->cache)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
g_free(button->filename);
......@@ -544,7 +544,7 @@ button_widget_set_dnd_highlight(ButtonWidget *button, gboolean highlight)
if(button->dnd_highlight != highlight) {
button->dnd_highlight = highlight;
if(button->cache)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
panel_widget_draw_icon (PANEL_WIDGET(GTK_WIDGET(button)->parent), button);
......@@ -656,7 +656,7 @@ button_widget_draw_xlib(ButtonWidget *button, GdkPixmap *pixmap)
widget->allocation.height - 1);
}
gdk_gc_destroy(gc);
g_object_unref (G_OBJECT (gc));
}
static void
......@@ -791,7 +791,7 @@ button_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event)
#endif
button->in_button = TRUE;
if (button->cache)
gdk_pixmap_unref (button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
panel_widget_draw_icon (PANEL_WIDGET(widget->parent),
button);
......@@ -820,7 +820,7 @@ button_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event)
button->in_button = FALSE;
if (global_config.highlight_when_over) {
if (button->cache)
gdk_pixmap_unref (button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
panel_widget_draw_icon (PANEL_WIDGET(widget->parent),
button);
......@@ -846,7 +846,7 @@ button_widget_pressed(ButtonWidget *button)
button->pressed = TRUE;
if(button->cache)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
setup_no_alpha(button);
panel_widget_draw_icon(PANEL_WIDGET(GTK_WIDGET(button)->parent),
......@@ -860,7 +860,7 @@ button_widget_unpressed(ButtonWidget *button)
button->pressed = FALSE;
if(button->cache)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
setup_no_alpha(button);
panel_widget_draw_icon(PANEL_WIDGET(GTK_WIDGET(button)->parent),
......@@ -950,9 +950,9 @@ button_widget_set_pixmap(ButtonWidget *button, const char *pixmap, int size)
size = PANEL_WIDGET(GTK_WIDGET(button)->parent)->sz;
if (button->pixbuf != NULL)
gdk_pixbuf_unref(button->pixbuf);
g_object_unref (G_OBJECT (button->pixbuf));
if (button->pixbuf_hc != NULL)
gdk_pixbuf_unref(button->pixbuf_hc);
g_object_unref (G_OBJECT (button->pixbuf_hc));
button->pixbuf = loadup_file(pixmap);
button->pixbuf_hc = make_hc_pixbuf(button->pixbuf);
......@@ -961,7 +961,7 @@ button_widget_set_pixmap(ButtonWidget *button, const char *pixmap, int size)
button->filename = g_strdup(pixmap);
button->size = size;
if (button->cache != NULL)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
panel_widget_draw_icon(PANEL_WIDGET(GTK_WIDGET(button)->parent),
......@@ -983,7 +983,7 @@ button_widget_set_text(ButtonWidget *button, const char *text)
button->text = text?g_strdup(text):NULL;
if (button->cache != NULL)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
panel_widget_draw_icon(PANEL_WIDGET(GTK_WIDGET(button)->parent),
......@@ -1006,7 +1006,7 @@ button_widget_set_params(ButtonWidget *button,
button->orient = orient;
if(button->cache)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
setup_no_alpha(button);
......@@ -1022,7 +1022,7 @@ button_widget_redo_all (void)
for(list = buttons; list != NULL; list = list->next) {
ButtonWidget *button = list->data;
if(button->cache != NULL)
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
setup_no_alpha(button);
gtk_widget_queue_draw (GTK_WIDGET (button));
......
......@@ -339,15 +339,18 @@ update_clock (FoobarWidget *foo)
}
hour[sizeof(hour)-1] = '\0'; /* just for sanity */
str_utf8 = g_locale_to_utf8((const gchar *)hour, strlen(hour), NULL, NULL, NULL);
gtk_tooltips_set_tip (panel_tooltips, foo->clock_ebox,
hour, NULL);
sure_string (str_utf8), NULL);
g_free (str_utf8);
day = das_tm->tm_mday;
}
if(strftime(hour, sizeof(hour), foo->clock_format, das_tm) == 0) {
/* according to docs, if the string does not fit, the
* contents of tmp2 are undefined, thus just use
* contents of hour are undefined, thus just use
* ??? */
strcpy(hour, "???");
}
......@@ -365,6 +368,8 @@ update_clock (FoobarWidget *foo)
gtk_widget_set_size_request (foo->clock_label, width, -1);
gtk_label_set_text (GTK_LABEL (foo->clock_label), str_utf8);
g_free (str_utf8);
}
}
......@@ -403,6 +408,7 @@ append_format_items (GtkWidget *menu)
struct tm *das_tm;
time_t das_time = 0;
char *key;
char *str_utf8;
char *s;
int i;
const char *formats[] = {
......@@ -427,7 +433,10 @@ append_format_items (GtkWidget *menu)
}
hour[sizeof(hour)-1] = '\0'; /* just for sanity */
item = gtk_radio_menu_item_new_with_label (group, hour);
str_utf8 = g_locale_to_utf8((const gchar *)hour, strlen(hour), NULL, NULL, NULL);
item = gtk_radio_menu_item_new_with_label (group, sure_string (str_utf8));
g_free (str_utf8);
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
......@@ -558,6 +567,7 @@ foobar_widget_set_clock_format (FoobarWidget *foo, const char *clock_format)
gtk_widget_set_size_request (foo->clock_label, width, -1);
g_object_unref (G_OBJECT(layout));
}
g_free (str_utf8);
}
update_clock (foo);
}
......@@ -657,7 +667,7 @@ get_default_image (void)
if (pb != NULL) {
scaled = gdk_pixbuf_scale_simple (pb, 20, 20,
GDK_INTERP_BILINEAR);
gdk_pixbuf_unref (pb);
g_object_unref (G_OBJECT (pb));
pixbuf = scaled;
}
......@@ -724,7 +734,7 @@ add_window (WnckWindow *window, FoobarWidget *foo)
(ICON_SIZE / greatest) * pix_y,
GDK_INTERP_BILINEAR);
image = gtk_image_new_from_pixbuf (scaled);
gdk_pixbuf_unref (scaled);
g_object_unref (G_OBJECT (scaled));
} else {
image = gtk_image_new_from_pixbuf (pb);
}
......@@ -840,7 +850,7 @@ set_das_pixmap (FoobarWidget *foo, WnckWindow *window)
(ICON_SIZE / greatest) * pix_y,
GDK_INTERP_BILINEAR);
foo->task_image = gtk_image_new_from_pixbuf (scaled);
gdk_pixbuf_unref (scaled);
g_object_unref (G_OBJECT (scaled));
} else {
foo->task_image = gtk_image_new_from_pixbuf (pb);
}
......
......@@ -199,7 +199,7 @@ panel_global_keys_setup (void)
static gboolean
check_for_grabs (void)
{
if (gdk_pointer_grab (GDK_ROOT_PARENT(), FALSE,
if (gdk_pointer_grab (gdk_get_default_root_window (), FALSE,
0, NULL, NULL, GDK_CURRENT_TIME)
!= GrabSuccess) {
return TRUE;
......
......@@ -144,7 +144,7 @@ grab_key_filter (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
gtk_widget_destroy (grab_dialog);
gdk_window_remove_filter (GDK_ROOT_PARENT (),
gdk_window_remove_filter (gdk_get_default_root_window (),
grab_key_filter, data);
return GDK_FILTER_REMOVE;
......@@ -158,8 +158,8 @@ grab_button_pressed (GtkButton *button, gpointer data)
GtkWidget *label;
grab_dialog = gtk_window_new (GTK_WINDOW_POPUP);
gdk_keyboard_grab (GDK_ROOT_PARENT(), FALSE, GDK_CURRENT_TIME);
gdk_window_add_filter (GDK_ROOT_PARENT(), grab_key_filter, data);
gdk_keyboard_grab (gdk_get_default_root_window (), FALSE, GDK_CURRENT_TIME);
gdk_window_add_filter (gdk_get_default_root_window (), grab_key_filter, data);
g_object_set (G_OBJECT (grab_dialog),
"allow_grow", FALSE,
......
......@@ -144,7 +144,7 @@ grab_key_filter (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
gtk_widget_destroy (grab_dialog);
gdk_window_remove_filter (GDK_ROOT_PARENT (),
gdk_window_remove_filter (gdk_get_default_root_window (),
grab_key_filter, data);
return GDK_FILTER_REMOVE;
......@@ -158,8 +158,8 @@ grab_button_pressed (GtkButton *button, gpointer data)
GtkWidget *label;
grab_dialog = gtk_window_new (GTK_WINDOW_POPUP);
gdk_keyboard_grab (GDK_ROOT_PARENT(), FALSE, GDK_CURRENT_TIME);
gdk_window_add_filter (GDK_ROOT_PARENT(), grab_key_filter, data);
gdk_keyboard_grab (gdk_get_default_root_window (), FALSE, GDK_CURRENT_TIME);
gdk_window_add_filter (gdk_get_default_root_window (), grab_key_filter, data);
g_object_set (G_OBJECT (grab_dialog),
"allow_grow", FALSE,
......
......@@ -452,7 +452,7 @@ print_page (GnomePrintContext *context, const GnomePaper *paper)
gnome_print_showpage (context);
gnome_print_context_close (context);
gdk_pixbuf_unref (printed_image);
g_object_unref (G_OBJECT (printed_image));
}
#endif
......@@ -528,7 +528,7 @@ print_pixbuf (void)
gtk_widget_set_sensitive (GTK_WIDGET (print_dialog), FALSE);
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (GTK_WIDGET (print_dialog)->window, cursor);
gdk_cursor_destroy (cursor);
g_object_unref (G_OBJECT (cursor));
gtk_widget_show (GTK_WIDGET (gpmp));
gtk_window_set_modal (GTK_WINDOW (gpmp), TRUE);
......@@ -616,7 +616,7 @@ on_preview_configure_event (GtkWidget *drawing_area,
gpointer data)
{
if (preview_image)
gdk_pixbuf_unref (preview_image);
g_object_unref (G_OBJECT (preview_image));
preview_image = gdk_pixbuf_scale_simple (screenshot,
event->width,
......@@ -633,7 +633,7 @@ setup_busy (gboolean busy)
/* Change cursor to busy */
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (toplevel->window, cursor);
gdk_cursor_destroy (cursor);
g_object_unref (G_OBJECT (cursor));
} else {
gdk_window_set_cursor (toplevel->window, NULL);
}
......@@ -895,9 +895,9 @@ take_window_shot (void)
&unused,
&mask);
if (child == None)
window = GDK_ROOT_PARENT ();
else {
if (child == None) {
window = gdk_get_default_root_window ();
} else {
window = gdk_window_foreign_new (child);
......@@ -914,7 +914,7 @@ take_window_shot (void)
}
}
gdk_window_get_size (window, &width, &height);
gdk_drawable_get_size (window, &width, &height);
gdk_window_get_origin (window, &x_orig, &y_orig);
......@@ -950,7 +950,7 @@ take_screen_shot (void)
width = gdk_screen_width ();
height = gdk_screen_height ();
screenshot = gdk_pixbuf_get_from_drawable (NULL, GDK_ROOT_PARENT (),
screenshot = gdk_pixbuf_get_from_drawable (NULL, gdk_get_default_root_window (),
NULL, 0, 0, 0, 0,
width, height);
}
......@@ -998,7 +998,7 @@ drag_begin (GtkWidget *widget, GdkDragContext *context)
128);
gtk_drag_set_icon_pixmap
(context, gdk_rgb_get_cmap (), pixmap, mask, 0, 0);
(context, gdk_rgb_get_colormap (), pixmap, mask, 0, 0);
start_temporary ();
}
......
......@@ -21,6 +21,9 @@
* USA
*/
/* FIXME: because of CList */
#undef GTK_DISABLE_DEPRECATED
#include <config.h>
#include <errno.h>
#include <sys/types.h>
......@@ -739,7 +742,7 @@ simple_contents_shown (GtkWidget *vbox,
gdk_draw_rectangle (spacer_mask,
gc,
TRUE, 0, 0, CLIST_ICON_SIZE, CLIST_ICON_SIZE);
gdk_gc_unref (gc);
g_object_unref (G_OBJECT (gc));
gc = NULL;
entries = fr_get_all_dirs ();
......@@ -799,8 +802,8 @@ simple_contents_shown (GtkWidget *vbox,
scaled = gdk_pixbuf_scale_simple (pixbuf, CLIST_ICON_SIZE, CLIST_ICON_SIZE, GDK_INTERP_BILINEAR);
gdk_pixbuf_render_pixmap_and_mask (scaled,
&pixmap, &mask, 128);
gdk_pixbuf_unref (pixbuf);
gdk_pixbuf_unref (scaled);
g_object_unref (G_OBJECT (pixbuf));
g_object_unref (G_OBJECT (scaled));
} else {
pixmap = spacer_pixmap;
mask = spacer_mask;
......@@ -819,9 +822,9 @@ simple_contents_shown (GtkWidget *vbox,
if (pixbuf) {
if (pixmap)
gdk_pixmap_unref (pixmap);
g_object_unref (G_OBJECT (pixmap));
if (mask)
gdk_bitmap_unref (mask);
g_object_unref (G_OBJECT (mask));
}
gtk_clist_set_row_data (GTK_CLIST (clist),
......@@ -830,8 +833,8 @@ simple_contents_shown (GtkWidget *vbox,
tmp = tmp->next;
}
gdk_pixmap_unref (spacer_pixmap);
gdk_bitmap_unref (spacer_mask);
g_object_unref (G_OBJECT (spacer_pixmap));
g_object_unref (G_OBJECT (spacer_mask));
g_slist_free (files);
}
}
......
......@@ -682,7 +682,6 @@ ask_about_launcher (const char *file, PanelWidget *panel, int pos, gboolean exac
gtk_window_set_wmclass (GTK_WINDOW (dialog),
"create_launcher", "Panel");
gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, FALSE, TRUE);
dee = GNOME_DITEM_EDIT (gnome_ditem_edit_new ());
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
......
......@@ -145,12 +145,6 @@ find_kde_directory (void)
kde_mini_icondir = g_strdup (KDE_MINI_ICONDIR);
}
static void
setup_visuals (void)
{
gdk_rgb_init ();
}
static void
kill_free_drawers (void)
{
......@@ -237,8 +231,6 @@ main(int argc, char **argv)
if (!panel_shell_register ())
return -1;
setup_visuals ();
find_kde_directory();
client = gnome_master_client ();
......
......@@ -608,7 +608,7 @@ remove_pixmap_from_loaded (GtkWidget *pixmap, gpointer data)
static gboolean
load_icons_handler (gpointer data)
{
GtkPixmap *pixmap;
GtkImage *pixmap;
GdkPixbuf *pb;
IconToLoad *icon;
char *file;
......@@ -656,7 +656,7 @@ load_icons_handler_again:
(pixmap = g_hash_table_lookup (loaded_icons, file)) != NULL) {
pb = gtk_image_get_pixbuf (GTK_IMAGE (pixmap));
if (pb != NULL)
gdk_pixbuf_ref (pb);
g_object_ref (G_OBJECT (pb));
}
if (pb == NULL) {
......@@ -676,12 +676,12 @@ load_icons_handler_again:
GdkPixbuf *pb2;
pb2 = gdk_pixbuf_scale_simple (pb, ICON_SIZE, ICON_SIZE,
GDK_INTERP_BILINEAR);
gdk_pixbuf_unref (pb);
g_object_unref (G_OBJECT (pb));
pb = pb2;
}
gtk_image_set_from_pixbuf (GTK_IMAGE (icon->pixmap), pb);
gdk_pixbuf_unref (pb);
g_object_unref (G_OBJECT (pb));
if (loaded) {
if (loaded_icons == NULL)
......@@ -1153,7 +1153,7 @@ restore_grabs(GtkWidget *w, gpointer data)
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK,
NULL, cursor, 0) == 0);
gdk_cursor_destroy (cursor);
g_object_unref (G_OBJECT (cursor));
}
gtk_grab_add (GTK_WIDGET (menu));
......@@ -1324,7 +1324,6 @@ edit_dentry (GtkWidget *widget, ShowItemMenu *sim)
gtk_window_set_wmclass(GTK_WINDOW(dialog),
"desktop_entry_properties","Panel");
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
g_object_set_data_full (G_OBJECT (dedit), "location",
g_strdup (sim->item_loc),
......@@ -1393,7 +1392,6 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
gtk_window_set_wmclass (GTK_WINDOW (dialog),
"desktop_entry_properties", "Panel");
gtk_window_set_policy (GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
dedit = gnome_ditem_edit_new ();
gtk_widget_show (dedit);
......@@ -1748,7 +1746,7 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context)
}
}
gdk_cursor_destroy (cursor);
g_object_unref (G_OBJECT (cursor));
}
}
......@@ -2221,7 +2219,6 @@ show_tearoff_menu (GtkWidget *menu, const char *title, gboolean cursor_position,
GDK_DECOR_RESIZEH |
GDK_DECOR_MINIMIZE |
GDK_DECOR_MAXIMIZE);
gtk_window_set_policy (GTK_WINDOW (win), FALSE, FALSE, TRUE);
my_gtk_menu_reparent (GTK_MENU (menu), win, FALSE);
/* set sticky so that we mask the fact that we have no clue
......@@ -2233,7 +2230,7 @@ show_tearoff_menu (GtkWidget *menu, const char *title, gboolean cursor_position,
if (cursor_position)
our_gtk_menu_position (GTK_MENU (menu));
else
gtk_widget_set_uposition (win, x, y);
gtk_window_move (GTK_WINDOW (win), x, y);
gtk_widget_show (GTK_WIDGET (menu));
gtk_widget_show (win);
......
......@@ -137,7 +137,7 @@ goat_realize(GtkWidget *widget)
transform_pixbuf(rgb,
0,0,goat_width,goat_height,goat_width*3,
pb,affine,ART_FILTER_NEAREST,NULL);
gdk_pixbuf_unref(pb);
g_object_unref (G_OBJECT (pb));
goat_pix[frame] = gdk_pixmap_new(widget->window,
goat_width,goat_height,
......@@ -147,7 +147,7 @@ goat_realize(GtkWidget *widget)
goat_width,goat_height,
GDK_RGB_DITHER_NORMAL,
rgb, goat_width*3);
gdk_gc_destroy(gc);
g_object_unref (G_OBJECT (gc));
#define GUCHARSWAP(x,y) { guchar tmp=(x); (x)=(y); (y)=tmp; }
for(i=0;i<goat_width/2;i++)
......@@ -170,7 +170,7 @@ goat_realize(GtkWidget *widget)
GDK_RGB_DITHER_NORMAL,
rgb, goat_width*3);
gdk_gc_destroy(gc);
g_object_unref (G_OBJECT (gc));
g_free(rgb);
}
}
......@@ -245,8 +245,8 @@ phsh_kill (void)
{
int i;
for (i = 0; i < 4; i++) {
gdk_pixmap_unref (phsh.phsh[i]);
gdk_bitmap_unref (phsh.phsh_mask[i]);
g_object_unref (G_OBJECT (phsh.phsh[i]));
g_object_unref (G_OBJECT (phsh.phsh_mask[i]));
}
gdk_window_destroy (phsh.win);
gtk_timeout_remove (phsh.handler);
......@@ -399,7 +399,7 @@ check_screen (void)
if (gdk_pixbuf_get_width (tmp) != 180 ||
gdk_pixbuf_get_height (tmp) != 40) {
gdk_pixbuf_unref (tmp);
g_object_unref (G_OBJECT (tmp));
return;
}
......@@ -419,9 +419,9 @@ check_screen (void)
gdk_pixbuf_render_pixmap_and_mask (gp, &phsh.phsh[3], &phsh.phsh_mask[3], 128);
phsh_reverse (gp);
gdk_pixbuf_render_pixmap_and_mask (gp, &phsh.phsh[1], &phsh.phsh_mask[1], 128);
gdk_pixbuf_unref (gp);
g_object_unref (G_OBJECT (gp));
gdk_pixbuf_unref (tmp);
g_object_unref (G_OBJECT (tmp));
phsh.x = -60;
phsh.y = (rand() % (gdk_screen_height () - 40 - 2)) + 1;
......@@ -435,7 +435,7 @@ check_screen (void)
attributes.height = 40;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gdk_rgb_get_visual();
attributes.colormap = gdk_rgb_get_cmap();
attributes.colormap = gdk_rgb_get_colormap();
attributes.event_mask = GDK_BUTTON_PRESS_MASK;
phsh.win = gdk_window_new (NULL, &attributes,
......@@ -748,7 +748,7 @@ pb_scale (GdkPixbuf *pb, double scale)
int w, h;
if (scale == 1.0)
return gdk_pixbuf_ref (pb);
return (GdkPixbuf *)g_object_ref ((GObject *)pb);
w = gdk_pixbuf_get_width (pb) * scale;
h = gdk_pixbuf_get_height (pb) * scale;
......@@ -1155,55 +1155,55 @@ ensure_creatures (void)
pb1 = get_phsh_frame (pb, 1);
phsh1 = pb_scale (pb1, inv_factor);
gdk_pixbuf_unref (pb1);
g_object_unref (G_OBJECT (pb1));
phsh_dered (phsh1);
pb1 = get_phsh_frame (pb, 2);
phsh2 = pb_scale (pb1, inv_factor);
gdk_pixbuf_unref (pb1);
g_object_unref (G_OBJECT (pb1));
phsh_dered (phsh2);
gdk_pixbuf_unref (pb);
g_object_unref (G_OBJECT (pb));
goat_file = panel_pixmap_discovery ("gnome-gegl2.png",
FALSE /* fallback */);
if (goat_file == NULL) {
gdk_pixbuf_unref (phsh1);
gdk_pixbuf_unref (phsh2);
g_object_unref (G_OBJECT (phsh1));
g_object_unref (G_OBJECT (phsh2));
return FALSE;
}
pb = gdk_pixbuf_new_from_file (goat_file, NULL);
g_free (goat_file);
if (pb == NULL) {
gdk_pixbuf_unref (phsh1);
gdk_pixbuf_unref (phsh2);
g_object_unref (G_OBJECT (phsh1));
g_object_unref (G_OBJECT (phsh2));
return FALSE;
}
goat1 = pb_scale (pb, inv_factor * 0.66);
gdk_pixbuf_unref (pb);
g_object_unref (pb);
goat_file = panel_pixmap_discovery ("gnome-gegl2-2.png",
FALSE /* fallback */);
if (goat_file == NULL) {
gdk_pixbuf_unref (goat1);
gdk_pixbuf_unref (phsh1);
gdk_pixbuf_unref (phsh2);
g_object_unref (G_OBJECT (goat1));
g_object_unref (G_OBJECT (phsh1));
g_object_unref (G_OBJECT (phsh2));
return FALSE;
}
pb = gdk_pixbuf_new_from_file (goat_file, NULL);
g_free (goat_file);
if (pb == NULL) {
gdk_pixbuf_unref (goat1);
gdk_pixbuf_unref (phsh1);
gdk_pixbuf_unref (phsh2);
g_object_unref (G_OBJECT (goat1));
g_object_unref (G_OBJECT (phsh1));
g_object_unref (G_OBJECT (phsh2));
return FALSE;
}
goat2 = pb_scale (pb, inv_factor * 0.66);
gdk_pixbuf_unref (pb);
g_object_unref (pb);
inv_goat_width = gdk_pixbuf_get_width (goat1);
inv_goat_height = gdk_pixbuf_get_height (goat1);
......@@ -1211,13 +1211,13 @@ ensure_creatures (void)
inv_phsh_height = gdk_pixbuf_get_height (phsh1);
gdk_pixbuf_render_pixmap_and_mask (goat1, &inv_goat1, NULL, 127);
gdk_pixbuf_unref (goat1);
g_object_unref (G_OBJECT (goat1));
gdk_pixbuf_render_pixmap_and_mask (goat2, &inv_goat2, NULL, 127);
gdk_pixbuf_unref (goat2);
g_object_unref (G_OBJECT (goat2));
gdk_pixbuf_render_pixmap_and_mask (phsh1, &inv_phsh1, &inv_phsh1_mask, 127);
gdk_pixbuf_unref (phsh1);
g_object_unref (G_OBJECT (phsh1));
gdk_pixbuf_render_pixmap_and_mask (phsh2, &inv_phsh2, &inv_phsh2_mask, 127);
gdk_pixbuf_unref (phsh2);
g_object_unref (G_OBJECT (phsh2));
return TRUE;
}
......@@ -1227,7 +1227,7 @@ geginv_destroyed (GtkWidget *w, gpointer data)
{
geginv = NULL;
if (geginv_pixmap != NULL)
gdk_pixmap_unref (geginv_pixmap);
g_object_unref (G_OBJECT (geginv_pixmap));
geginv_pixmap = NULL;
}
......@@ -1290,6 +1290,7 @@ start_geginv (void)
return;
geginv = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (geginv), _("Killer GEGLs from Outer Space"));
g_object_set (G_OBJECT (geginv), "resizable", FALSE, NULL);
g_signal_connect (G_OBJECT (geginv), "destroy",
G_CALLBACK (geginv_destroyed),
......
......@@ -950,7 +950,7 @@ panel_push_window_busy (GtkWidget *window)
if (window->window != NULL) {
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (window->window, cursor);
gdk_cursor_destroy (cursor);
g_object_unref (G_OBJECT (cursor));
gdk_flush ();
}
}
......
......@@ -284,7 +284,7 @@ applet_move(PanelWidget *panel, GtkWidget *applet)
if(BUTTON_IS_WIDGET(applet)) {
ButtonWidget *button = BUTTON_WIDGET(applet);
if(!button->no_alpha && button->cache) {
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
}
}
......@@ -1010,7 +1010,7 @@ kill_cache_on_all_buttons(PanelWidget *panel, gboolean even_no_alpha)
ButtonWidget *button = BUTTON_WIDGET(ad->applet);
if((even_no_alpha || !button->no_alpha)
&& button->cache) {
gdk_pixmap_unref(button->cache);
g_object_unref (G_OBJECT (button->cache));
button->cache = NULL;
}