--- np2/x11/gtk2/gtk_drawmng.c 2004/07/27 17:07:50 1.3 +++ np2/x11/gtk2/gtk_drawmng.c 2011/01/15 18:43:13 1.9 @@ -1,5 +1,3 @@ -/* $Id: gtk_drawmng.c,v 1.3 2004/07/27 17:07:50 monaka Exp $ */ - /* * Copyright (c) 2003 NONAKA Kimihiro * All rights reserved. @@ -12,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -132,7 +128,7 @@ destroy: GtkWidget *da = hdl->drawarea; drawmng_release((DRAWMNG_HDL)hdl); if (da) { - gtk_widget_unref(da); + g_object_unref(da); } } return NULL; @@ -147,10 +143,10 @@ drawmng_release(DRAWMNG_HDL dhdl) while (hdl->d.drawing) usleep(1); if (hdl->backsurf) { - gdk_pixmap_unref(hdl->backsurf); + g_object_unref(hdl->backsurf); } if (hdl->surface) { - gdk_image_destroy(hdl->surface); + g_object_unref(hdl->surface); } _MFREE(hdl); } @@ -178,7 +174,7 @@ drawmng_surfunlock(DRAWMNG_HDL dhdl) GdkGC *gc; if (hdl) { - gc = hdl->drawarea->style->fg_gc[GTK_WIDGET_STATE(hdl->drawarea)]; + gc = hdl->drawarea->style->fg_gc[gtk_widget_get_state(hdl->drawarea)]; gdk_draw_image(hdl->backsurf, gc, hdl->surface, 0, 0, 0, 0, hdl->d.width, hdl->d.height); hdl->d.drawing = FALSE; @@ -195,7 +191,7 @@ drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr int width, height; if (hdl) { - gc = hdl->drawarea->style->fg_gc[GTK_WIDGET_STATE(hdl->drawarea)]; + gc = hdl->drawarea->style->fg_gc[gtk_widget_get_state(hdl->drawarea)]; if (sr || dp) { if (sr) { @@ -213,11 +209,11 @@ drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr width = r.right - p.x; height = r.bottom - p.y; - gdk_draw_pixmap(hdl->drawarea->window, gc, + gdk_draw_drawable(hdl->drawarea->window, gc, hdl->backsurf, r.left, r.top, p.x, p.y, width, height); } else { - gdk_draw_pixmap(hdl->drawarea->window, gc, + gdk_draw_drawable(hdl->drawarea->window, gc, hdl->backsurf, 0, 0, 0, 0, hdl->d.width, hdl->d.height); } @@ -272,7 +268,7 @@ gtkdrawmng_getformat(GtkWidget *w, GtkWi break; default: - fprintf(stderr, "No support visual class.\n"); + g_printerr("No support visual class.\n"); return FALSE; } @@ -294,9 +290,9 @@ gtkdrawmng_getformat(GtkWidget *w, GtkWi default: if (visual->depth < 8) { - fprintf(stderr, "Too few allocable color.\n"); + g_printerr("Too few allocable color.\n"); } - fprintf(stderr, "No support depth.\n"); + g_printerr("No support depth.\n"); return FALSE; }