Mercurial > projects > dwt-linux
diff dwt/graphics/Image.d @ 33:27324bbbac70
changed to regenerated BCD bindings
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 10 Jan 2008 02:18:07 +0100 |
parents | 10acbb123580 |
children | 93981635e709 |
line wrap: on
line diff
--- a/dwt/graphics/Image.d Wed Jan 09 07:07:50 2008 +0100 +++ b/dwt/graphics/Image.d Thu Jan 10 02:18:07 2008 +0100 @@ -13,8 +13,6 @@ import dwt.internal.Converter; import dwt.internal.cairo.Cairo; import dwt.internal.gtk.OS; -import dwt.internal.gtk.c.cairotypes; -import dwt.internal.gtk.c.gdktypes; import dwt.SWT; import dwt.SWTException; import dwt.graphics.Color; @@ -298,7 +296,7 @@ } /* Retrieve the source pixmap data */ - auto pixbuf = OS.gdk_pixbuf_new(cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, false, 8, width, height); + auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height); if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES); auto colormap = OS.gdk_colormap_get_system(); OS.gdk_pixbuf_get_from_drawable(pixbuf, srcImage.pixmap, colormap, 0, 0, 0, 0, width, height); @@ -360,7 +358,7 @@ } /* Copy data back to destination pixmap */ - OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, cast(GdkRgbDither)OS.GDK_RGB_DITHER_NORMAL, 0, 0); + OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, OS.GDK_RGB_DITHER_NORMAL, 0, 0); /* Free resources */ OS.g_object_unref(pixbuf); @@ -663,7 +661,7 @@ OS.gdk_drawable_get_size(pixmap, &w, &h); int width = w, height = h; if (mask !is null || alpha != -1 || alphaData != null) { - auto pixbuf = OS.gdk_pixbuf_new( cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, true, 8, width, height); + auto pixbuf = OS.gdk_pixbuf_new( OS.GDK_COLORSPACE_RGB, true, 8, width, height); if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES); auto colormap = OS.gdk_colormap_get_system(); OS.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height); @@ -671,7 +669,7 @@ auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf); byte[] line = new byte[stride]; if (mask !is null && OS.gdk_drawable_get_depth(mask) == 1) { - auto maskPixbuf = OS.gdk_pixbuf_new(cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, false, 8, width, height); + auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height); if (maskPixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES); OS.gdk_pixbuf_get_from_drawable(maskPixbuf, mask, null, 0, 0, 0, 0, width, height); int maskStride = OS.gdk_pixbuf_get_rowstride(maskPixbuf); @@ -751,7 +749,7 @@ } surfaceData = cast(cairo_surface_t*) OS.g_malloc(stride * height); memmove(surfaceData, pixels, stride * height); - surface = Cairo.cairo_image_surface_create_for_data(cast(ubyte*)surfaceData, cast(cairo_format_t)Cairo.CAIRO_FORMAT_ARGB32, width, height, stride); + surface = Cairo.cairo_image_surface_create_for_data(cast(char*)surfaceData, Cairo.CAIRO_FORMAT_ARGB32, width, height, stride); OS.g_object_unref(pixbuf); } else { auto xDisplay = OS.GDK_DISPLAY(); @@ -880,7 +878,7 @@ int w, h; OS.gdk_drawable_get_size(pixmap, &w, &h); int width = w, height = h; - auto pixbuf = OS.gdk_pixbuf_new(cast(GdkColorspace)OS.GDK_COLORSPACE_RGB, false, 8, width, height); + auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height); if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES); auto colormap = OS.gdk_colormap_get_system(); OS.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height); @@ -1006,7 +1004,7 @@ if (!(((image.depth == 1 || image.depth == 2 || image.depth == 4 || image.depth == 8) && !palette.isDirect) || ((image.depth == 8) || (image.depth == 16 || image.depth == 24 || image.depth == 32) && palette.isDirect))) SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH); - auto pixbuf = OS.gdk_pixbuf_new(cast(GdkColorspace) OS.GDK_COLORSPACE_RGB, false, 8, width, height); + auto pixbuf = OS.gdk_pixbuf_new( OS.GDK_COLORSPACE_RGB, false, 8, width, height); if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES); int stride = OS.gdk_pixbuf_get_rowstride(pixbuf); auto data = OS.gdk_pixbuf_get_pixels(pixbuf); @@ -1044,7 +1042,7 @@ if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES); auto gdkGC = OS.gdk_gc_new(pixmap); if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES); - OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, cast(GdkRgbDither)OS.GDK_RGB_DITHER_NORMAL, 0, 0); + OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, OS.GDK_RGB_DITHER_NORMAL, 0, 0); OS.g_object_unref(gdkGC); OS.g_object_unref(pixbuf);