diff --git a/util/wmsetbg.c b/util/wmsetbg.c index 6e74c534..9f862a24 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -1213,7 +1213,8 @@ int main(int argc, char **argv) char *back_color = "gray20"; char *image_name = NULL; char *domain = "WindowMaker"; - int update = 0, cpc = 4, render_mode = RDitheredRendering, obey_user = 0; + int update = 0, cpc = 4, obey_user = 0; + RRenderingMode render_mode = RDitheredRendering; char *texture = NULL; int workspace = -1; diff --git a/wrlib/scale.c b/wrlib/scale.c index 3694be63..eafe40f9 100644 --- a/wrlib/scale.c +++ b/wrlib/scale.c @@ -247,7 +247,7 @@ static double Mitchell_filter(double t) static double (*filterf)(double) = Mitchell_filter; static double fwidth = Mitchell_support; -void wraster_change_filter(int type) +void wraster_change_filter(RScalingFilter type) { switch (type) { case RBoxFilter: diff --git a/wrlib/scale.h b/wrlib/scale.h index 887b47d6..4d2d7384 100644 --- a/wrlib/scale.h +++ b/wrlib/scale.h @@ -24,7 +24,7 @@ /* * Function to change the smoothing filter used for image scaling (RSmoothScaleImage) */ -void wraster_change_filter(int type); +void wraster_change_filter(RScalingFilter type); #endif diff --git a/wrlib/wraster.h b/wrlib/wraster.h index 45cbcc6b..66443e10 100644 --- a/wrlib/wraster.h +++ b/wrlib/wraster.h @@ -82,30 +82,43 @@ extern "C" { - +/* image display modes */ +typedef enum { + RDitheredRendering = 0, + RBestMatchRendering = 1 +} RRenderingMode; /* std colormap usage/creation modes */ -enum { - RUseStdColormap, /* default. fallbacks to RIgnore.. if - there is none defined */ - RCreateStdColormap, - RIgnoreStdColormap -}; +typedef enum { + RUseStdColormap, /* default: fallbacks to RIgnore if there is none defined */ + RCreateStdColormap, + RIgnoreStdColormap +} RStdColormapMode; +/* smoothed scaling filter types */ +typedef enum { + RBoxFilter, + RTriangleFilter, + RBellFilter, + RBSplineFilter, + RLanczos3Filter, + RMitchellFilter +} RScalingFilter; + typedef struct RContextAttributes { int flags; - int render_mode; + RRenderingMode render_mode; int colors_per_channel; /* for PseudoColor */ float rgamma; /* gamma correction for red, */ float ggamma; /* green, */ float bgamma; /* and blue */ VisualID visualid; /* visual ID to use */ int use_shared_memory; /* True of False */ - int scaling_filter; - int standard_colormap_mode; /* what to do with std cma */ + RScalingFilter scaling_filter; + RStdColormapMode standard_colormap_mode; /* what to do with std cma */ } RContextAttributes; @@ -211,24 +224,6 @@ typedef struct RXImage { } RXImage; -/* image display modes */ -enum { - RDitheredRendering = 0, - RBestMatchRendering = 1 -}; - - -/* smoothed scaling filter types */ -enum { - RBoxFilter, - RTriangleFilter, - RBellFilter, - RBSplineFilter, - RLanczos3Filter, - RMitchellFilter -}; - - /* note that not all operations are supported in all functions */ enum { RClearOperation, /* clear with 0 */ @@ -481,4 +476,3 @@ extern int RErrorCode; #endif /* __cplusplus */ #endif -