summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gdevm2.c')
-rw-r--r--base/gdevm2.c46
1 files changed, 32 insertions, 14 deletions
diff --git a/base/gdevm2.c b/base/gdevm2.c
index 863811b8..107e0700 100644
--- a/base/gdevm2.c
+++ b/base/gdevm2.c
@@ -31,10 +31,20 @@ declare_mem_procs(mem_mapped2_copy_mono, mem_mapped2_copy_color, mem_mapped2_fil
/* The device descriptor. */
const gx_device_memory mem_mapped2_device =
-mem_device("image2", 2, 0,
- mem_mapped_map_rgb_color, mem_mapped_map_color_rgb,
- mem_mapped2_copy_mono, mem_mapped2_copy_color,
- mem_mapped2_fill_rectangle, mem_gray_strip_copy_rop);
+ mem_device("image2", 2, 0, mem_dev_initialize_device_procs);
+
+const gdev_mem_functions gdev_mem_fns_2 =
+{
+ mem_mapped_map_rgb_color,
+ mem_mapped_map_color_rgb,
+ mem_mapped2_fill_rectangle,
+ mem_mapped2_copy_mono,
+ mem_mapped2_copy_color,
+ gx_default_copy_alpha,
+ gx_default_strip_tile_rectangle,
+ mem_gray_strip_copy_rop2,
+ mem_get_bits_rectangle
+};
/* Convert x coordinate to byte offset in scan line. */
#undef x_to_byte
@@ -157,9 +167,9 @@ mem_mapped2_copy_color(gx_device * dev,
/* Use monobit copy_mono. */
/* Patch the width in the device temporarily. */
dev->width <<= 1;
- code = (*dev_proc(&mem_mono_device, copy_mono))
- (dev, base, sourcex << 1, sraster, id,
- x << 1, y, w << 1, h, (gx_color_index) 0, (gx_color_index) 1);
+ code = mem_mono_copy_mono(dev, base, sourcex << 1, sraster, id,
+ x << 1, y, w << 1, h,
+ (gx_color_index) 0, (gx_color_index) 1);
/* Restore the correct width. */
dev->width >>= 1;
return code;
@@ -177,12 +187,20 @@ declare_mem_procs(mem2_word_copy_mono, mem2_word_copy_color, mem2_word_fill_rect
/* Here is the device descriptor. */
const gx_device_memory mem_mapped2_word_device =
-mem_full_device("image2w", 2, 0, mem_open,
- mem_mapped_map_rgb_color, mem_mapped_map_color_rgb,
- mem2_word_copy_mono, mem2_word_copy_color,
- mem2_word_fill_rectangle, gx_default_map_cmyk_color,
- gx_default_strip_tile_rectangle, gx_no_strip_copy_rop,
- mem_word_get_bits_rectangle);
+ mem_device("image2w", 2, 0, mem_word_dev_initialize_device_procs);
+
+const gdev_mem_functions gdev_mem_fns_2w =
+{
+ mem_mapped_map_rgb_color,
+ mem_mapped_map_color_rgb,
+ mem2_word_fill_rectangle,
+ mem2_word_copy_mono,
+ mem2_word_copy_color,
+ gx_default_copy_alpha,
+ gx_default_strip_tile_rectangle,
+ gx_no_strip_copy_rop2,
+ mem_word_get_bits_rectangle
+};
/* Fill a rectangle with a color. */
static int
@@ -238,7 +256,7 @@ mem2_word_copy_color(gx_device * dev,
/* Use monobit copy_mono. */
/* Patch the width in the device temporarily. */
dev->width <<= 1;
- code = (*dev_proc(&mem_mono_word_device, copy_mono))
+ code = gdev_mem_word_functions_for_bits(1)->copy_mono
(dev, base, sourcex << 1, sraster, id,
x << 1, y, w << 1, h, (gx_color_index) 0, (gx_color_index) 1);
/* Restore the correct width. */