aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorN.N. <sevyves@users.sourceforge.net>2005-10-27 13:20:43 +0000
committerN.N. <sevyves@users.sourceforge.net>2005-10-27 13:20:43 +0000
commitbd0e7606604ce39c6f5914f6d61d4d1feaaf1904 (patch)
treec0e9147ea449784f11cb75219cc32f80231a04b7 /modules
parent3f6ad372d2f45b9e21e4cec9843a064429332738 (diff)
adapted to newer Image Magick
svn path=/trunk/externals/pidip/; revision=3771
Diffstat (limited to 'modules')
-rw-r--r--modules/pdp_capture.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/modules/pdp_capture.c b/modules/pdp_capture.c
index ccdc5c1..509ee2d 100644
--- a/modules/pdp_capture.c
+++ b/modules/pdp_capture.c
@@ -200,11 +200,11 @@ static Image *XMyGetWindowImage(t_pdp_capture *o, Display *display,const Window
max_windows+=1024;
if (window_info == (WindowInfo *) NULL)
{
- window_info=(WindowInfo *) AcquireMemory(max_windows*sizeof(WindowInfo));
+ window_info=(WindowInfo *) AcquireMemory(max_windows*sizeof(*window_info));
}
else
{
- ReacquireMemory((void **) &window_info,max_windows*sizeof(WindowInfo));
+ window_info=(WindowInfo *) ResizeMagickMemory(window_info,max_windows*sizeof(*window_info));
}
}
if (window_info == (WindowInfo *) NULL)
@@ -335,8 +335,13 @@ static Image *XMyGetWindowImage(t_pdp_capture *o, Display *display,const Window
XDestroyImage(ximage);
return((Image *) NULL);
}
+#if MagickLibVersion >= 0x608
+ if ((window_info[id].visual->klass != DirectColor) &&
+ (window_info[id].visual->klass != TrueColor))
+#else
if ((window_info[id].visual->storage_class != DirectColor) &&
(window_info[id].visual->storage_class != TrueColor))
+#endif
{
for (i=0; i < (int) number_colors; i++)
{
@@ -389,8 +394,13 @@ static Image *XMyGetWindowImage(t_pdp_capture *o, Display *display,const Window
XDestroyImage(ximage);
return((Image *) NULL);
}
- if ((window_info[id].visual->storage_class != TrueColor) &&
- (window_info[id].visual->storage_class != DirectColor))
+#if MagickLibVersion >= 0x608
+ if ((window_info[id].visual->klass != DirectColor) &&
+ (window_info[id].visual->klass != TrueColor))
+#else
+ if ((window_info[id].visual->storage_class != DirectColor) &&
+ (window_info[id].visual->storage_class != TrueColor))
+#endif
{
composite_image->storage_class=PseudoClass;
}
@@ -426,7 +436,11 @@ static Image *XMyGetWindowImage(t_pdp_capture *o, Display *display,const Window
blue_shift++;
}
if ((number_colors != 0) &&
+#if MagickLibVersion >= 0x608
+ (window_info[id].visual->klass == DirectColor))
+#else
(window_info[id].visual->storage_class == DirectColor))
+#endif
{
for (y=0; y < (long) composite_image->rows; y++)
{
@@ -535,14 +549,23 @@ static Image *XMyGetWindowImage(t_pdp_capture *o, Display *display,const Window
while (colormap_info != (ColormapInfo *) NULL)
{
next=colormap_info->next;
+#if MagickLibVersion >= 0x608
+ colormap_info->colors=(XColor *) RelinquishMagickMemory(colormap_info->colors);
+ colormap_info=(ColormapInfo *) RelinquishMagickMemory(colormap_info);
+#else
LiberateMemory((void **) &colormap_info->colors);
LiberateMemory((void **) &colormap_info);
+#endif
colormap_info=next;
}
/*
Free resources and restore initial state.
*/
+#if MagickLibVersion >= 0x608
+ window_info=(WindowInfo *) RelinquishMagickMemory(window_info);
+#else
LiberateMemory((void **) &window_info);
+#endif
window_info=(WindowInfo *) NULL;
max_windows=0;
number_windows=0;