| version 1.3, 2004/07/27 17:07:50 | version 1.9, 2011/01/15 18:43:13 | 
| Line 1 | Line 1 | 
 | /*      $Id$    */ |  | 
 |  |  | 
 | /* | /* | 
 | * Copyright (c) 2003 NONAKA Kimihiro | * Copyright (c) 2003 NONAKA Kimihiro | 
 | * All rights reserved. | * All rights reserved. | 
| Line 12 | Line 10 | 
 | * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | 
 | *    notice, this list of conditions and the following disclaimer in the | *    notice, this list of conditions and the following disclaimer in the | 
 | *    documentation and/or other materials provided with the distribution. | *    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 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 
 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 
| Line 132  destroy: | Line 128  destroy: | 
 | GtkWidget *da = hdl->drawarea; | GtkWidget *da = hdl->drawarea; | 
 | drawmng_release((DRAWMNG_HDL)hdl); | drawmng_release((DRAWMNG_HDL)hdl); | 
 | if (da) { | if (da) { | 
| gtk_widget_unref(da); | g_object_unref(da); | 
 | } | } | 
 | } | } | 
 | return NULL; | return NULL; | 
| Line 147  drawmng_release(DRAWMNG_HDL dhdl) | Line 143  drawmng_release(DRAWMNG_HDL dhdl) | 
 | while (hdl->d.drawing) | while (hdl->d.drawing) | 
 | usleep(1); | usleep(1); | 
 | if (hdl->backsurf) { | if (hdl->backsurf) { | 
| gdk_pixmap_unref(hdl->backsurf); | g_object_unref(hdl->backsurf); | 
 | } | } | 
 | if (hdl->surface) { | if (hdl->surface) { | 
| gdk_image_destroy(hdl->surface); | g_object_unref(hdl->surface); | 
 | } | } | 
 | _MFREE(hdl); | _MFREE(hdl); | 
 | } | } | 
| Line 178  drawmng_surfunlock(DRAWMNG_HDL dhdl) | Line 174  drawmng_surfunlock(DRAWMNG_HDL dhdl) | 
 | GdkGC *gc; | GdkGC *gc; | 
 |  |  | 
 | if (hdl) { | 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, | gdk_draw_image(hdl->backsurf, gc, hdl->surface, | 
 | 0, 0, 0, 0, hdl->d.width, hdl->d.height); | 0, 0, 0, 0, hdl->d.width, hdl->d.height); | 
 | hdl->d.drawing = FALSE; | hdl->d.drawing = FALSE; | 
| Line 195  drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr | Line 191  drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr | 
 | int width, height; | int width, height; | 
 |  |  | 
 | if (hdl) { | 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 || dp) { | 
 |  |  | 
 | if (sr) { | if (sr) { | 
| Line 213  drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr | Line 209  drawmng_blt(DRAWMNG_HDL dhdl, RECT_T *sr | 
 | width = r.right - p.x; | width = r.right - p.x; | 
 | height = r.bottom - p.y; | height = r.bottom - p.y; | 
 |  |  | 
| gdk_draw_pixmap(hdl->drawarea->window, gc, | gdk_draw_drawable(hdl->drawarea->window, gc, | 
 | hdl->backsurf, | hdl->backsurf, | 
 | r.left, r.top, p.x, p.y, width, height); | r.left, r.top, p.x, p.y, width, height); | 
 | } else { | } else { | 
| gdk_draw_pixmap(hdl->drawarea->window, gc, | gdk_draw_drawable(hdl->drawarea->window, gc, | 
 | hdl->backsurf, | hdl->backsurf, | 
 | 0, 0, 0, 0, hdl->d.width, hdl->d.height); | 0, 0, 0, 0, hdl->d.width, hdl->d.height); | 
 | } | } | 
| Line 272  gtkdrawmng_getformat(GtkWidget *w, GtkWi | Line 268  gtkdrawmng_getformat(GtkWidget *w, GtkWi | 
 | break; | break; | 
 |  |  | 
 | default: | default: | 
| fprintf(stderr, "No support visual class.\n"); | g_printerr("No support visual class.\n"); | 
 | return FALSE; | return FALSE; | 
 | } | } | 
 |  |  | 
| Line 294  gtkdrawmng_getformat(GtkWidget *w, GtkWi | Line 290  gtkdrawmng_getformat(GtkWidget *w, GtkWi | 
 |  |  | 
 | default: | default: | 
 | if (visual->depth < 8) { | 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; | return FALSE; | 
 | } | } | 
 |  |  |