Commit f2690b34 authored by Claes Sjofors's avatar Claes Sjofors

Imlib removed for motif

parent 00d68f10
...@@ -1687,17 +1687,26 @@ void FlowDrawXLib::set_white_background( FlowCtx *ctx) ...@@ -1687,17 +1687,26 @@ void FlowDrawXLib::set_white_background( FlowCtx *ctx)
int FlowDrawXLib::image_get_width( flow_tImImage image) int FlowDrawXLib::image_get_width( flow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width; return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
} }
int FlowDrawXLib::image_get_height( flow_tImImage image) int FlowDrawXLib::image_get_height( flow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_height; return ((ImlibImage *)image)->rgb_height;
#else
return 0;
#endif
} }
void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im_pixmap, void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im_pixmap,
flow_tPixmap *im_mask) flow_tPixmap *im_mask)
{ {
#if defined IMLIB
int current_width = int( ((ImlibImage *)*im)->rgb_width * scale); int current_width = int( ((ImlibImage *)*im)->rgb_width * scale);
int current_height = int( ((ImlibImage *)*im)->rgb_height * scale); int current_height = int( ((ImlibImage *)*im)->rgb_height * scale);
...@@ -1707,6 +1716,7 @@ void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im ...@@ -1707,6 +1716,7 @@ void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im
Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)*im_pixmap); Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)*im_pixmap);
*im_pixmap = (flow_tPixmap) Imlib_move_image( (ImlibData *)imlib, (ImlibImage *)*im); *im_pixmap = (flow_tPixmap) Imlib_move_image( (ImlibData *)imlib, (ImlibImage *)*im);
*im_mask = (flow_tPixmap) Imlib_move_mask( (ImlibData *)imlib, (ImlibImage *)*im); *im_mask = (flow_tPixmap) Imlib_move_mask( (ImlibData *)imlib, (ImlibImage *)*im);
#endif
} }
int FlowDrawXLib::image_load( const char *imagefile, float scale, float nav_scale, int FlowDrawXLib::image_load( const char *imagefile, float scale, float nav_scale,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#if defined OS_LINUX #if defined OS_LINUX
#define IMLIB 1 // #define IMLIB 1
#endif #endif
#if defined IMLIB #if defined IMLIB
......
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
#include <stdlib.h> #include <stdlib.h>
#if defined OS_LINUX
#define IMLIB 1
#endif
class FlowCtx; class FlowCtx;
class FlowDraw { class FlowDraw {
......
...@@ -2813,26 +2813,43 @@ x/scalex/width << " " << (y - height*scaley)/scaley/height << " translate" << en ...@@ -2813,26 +2813,43 @@ x/scalex/width << " " << (y - height*scaley)/scaley/height << " translate" << en
// Image functions // Image functions
int GlowDrawXLib::image_get_width( glow_tImImage image) int GlowDrawXLib::image_get_width( glow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width; return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
} }
int GlowDrawXLib::image_get_height( glow_tImImage image) int GlowDrawXLib::image_get_height( glow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_height; return ((ImlibImage *)image)->rgb_height;
#else
return 0;
#endif
} }
int GlowDrawXLib::image_get_rowstride( glow_tImImage image) int GlowDrawXLib::image_get_rowstride( glow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width; return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
} }
unsigned char *GlowDrawXLib::image_get_data( glow_tImImage image) unsigned char *GlowDrawXLib::image_get_data( glow_tImImage image)
{ {
#if defined IMLIB
return ((ImlibImage *)image)->rgb_data; return ((ImlibImage *)image)->rgb_data;
#else
return 0;
#endif
} }
void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from_rotation) void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from_rotation)
{ {
#if defined IMLIB
int drot = to_rotation - from_rotation; int drot = to_rotation - from_rotation;
drot = int( (float(drot) / 360 - floor( float(drot) / 360)) * 360); drot = int( (float(drot) / 360 - floor( float(drot) / 360)) * 360);
printf( "Drot: %d\n", drot); printf( "Drot: %d\n", drot);
...@@ -2845,16 +2862,21 @@ void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from ...@@ -2845,16 +2862,21 @@ void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from
if ( drot == 90 || drot == 180) if ( drot == 90 || drot == 180)
Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image); Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image);
} }
#endif
} }
void GlowDrawXLib::image_flip_vertical( glow_tImImage *image) void GlowDrawXLib::image_flip_vertical( glow_tImImage *image)
{ {
#if defined IMLIB
Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image); Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
} }
void GlowDrawXLib::image_flip_horizontal( glow_tImImage *image) void GlowDrawXLib::image_flip_horizontal( glow_tImImage *image)
{ {
#if defined IMLIB
Imlib_flip_image_vertical( (ImlibData *)imlib, (ImlibImage *)*image); Imlib_flip_image_vertical( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
} }
void GlowDrawXLib::image_scale( int width, int height, glow_tImImage orig_im, glow_tImImage *im, void GlowDrawXLib::image_scale( int width, int height, glow_tImImage orig_im, glow_tImImage *im,
...@@ -2918,17 +2940,22 @@ int GlowDrawXLib::image_render( int width, int height, ...@@ -2918,17 +2940,22 @@ int GlowDrawXLib::image_render( int width, int height,
void GlowDrawXLib::image_free( glow_tImImage image) void GlowDrawXLib::image_free( glow_tImImage image)
{ {
#if defined IMLIB
Imlib_destroy_image( (ImlibData *)imlib, (ImlibImage *)image); Imlib_destroy_image( (ImlibData *)imlib, (ImlibImage *)image);
#endif
} }
void GlowDrawXLib::pixmap_free( glow_tPixmap pixmap) void GlowDrawXLib::pixmap_free( glow_tPixmap pixmap)
{ {
#if defined IMLIB
Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)pixmap); Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)pixmap);
#endif
} }
void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *image, void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *image,
void (* pixel_cb)(void *, unsigned char *), void *userdata) void (* pixel_cb)(void *, unsigned char *), void *userdata)
{ {
#if defined IMLIB
unsigned char *rgb; unsigned char *rgb;
int rgb_height; int rgb_height;
int rgb_width; int rgb_width;
...@@ -2957,4 +2984,5 @@ void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *im ...@@ -2957,4 +2984,5 @@ void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *im
} }
Imlib_changed_image( (ImlibData *)imlib, (ImlibImage *)*image); Imlib_changed_image( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#if defined OS_LINUX #if defined OS_LINUX
#define IMLIB 1 // #define IMLIB 1
#endif #endif
#if defined IMLIB #if defined IMLIB
......
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
#include <stdlib.h> #include <stdlib.h>
#if defined OS_LINUX
#define IMLIB 1
#endif
#define DRAW_CLIP_SIZE 10 #define DRAW_CLIP_SIZE 10
class GlowCtx; class GlowCtx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment