1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 14:24:14 +01:00

bug fix in wbutton.c, made mouse pointer go invisible when typing in

textfield, added option to Smooth workspaceBack
This commit is contained in:
kojima
1999-04-28 23:50:52 +00:00
parent 5a156f9131
commit e50b7e9ca9
18 changed files with 193 additions and 70 deletions

View File

@@ -2,7 +2,7 @@
*
* Raster graphics library
*
* Copyright (c) 1997 Alfredo K. Kojima
* Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -34,6 +34,10 @@
#include "wraster.h"
extern void _wraster_change_filter(int type);
static Bool bestContext(Display *dpy, int screen_number, RContext *context);
static RContextAttributes DEFAULT_CONTEXT_ATTRIBS = {
@@ -44,7 +48,8 @@ static RContextAttributes DEFAULT_CONTEXT_ATTRIBS = {
0,
0,
0,
True /* use_shared_memory */
True, /* use_shared_memory */
RMitchellFilter
};
@@ -409,7 +414,9 @@ RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs)
/* get configuration from environment variables */
gatherconfig(context, screen_number);
_wraster_change_filter(context->attribs->scaling_filter);
if ((context->attribs->flags & RC_VisualID)) {
XVisualInfo *vinfo, templ;
int nret;

View File

@@ -275,6 +275,42 @@ double t;
return(0.0);
}
static double (*filterf)() = Mitchell_filter;
static double fwidth = Mitchell_support;
void
_wraster_change_filter(int type)
{
switch (type) {
case RBoxFilter:
filterf = box_filter;
fwidth = box_support;
break;
case RTriangleFilter:
filterf = triangle_filter;
fwidth = triangle_support;
break;
case RBellFilter:
filterf = bell_filter;
fwidth = bell_support;
break;
case RBSplineFilter:
filterf = B_spline_filter;
fwidth = B_spline_support;
break;
case RLanczos3Filter:
filterf = Lanczos3_filter;
fwidth = Lanczos3_support;
break;
default:
case RMitchellFilter:
filterf = Mitchell_support;
fwidth = Mitchell_filter;
break;
}
}
/*
* image rescaling routine
*/
@@ -295,14 +331,9 @@ CLIST *contrib; /* array of contribution lists */
#define CLAMP(v,l,h) ((v)<(l) ? (l) : (v) > (h) ? (h) : v)
static double (*filterf)() = Mitchell_filter;
static double fwidth = Mitchell_support;
RImage*
RSmoothScaleImage(RImage *src, int newWidth, int newHeight)
{
{
RImage *tmp; /* intermediate image */
double xscale, yscale; /* zoom scale factors */
int i, j, k; /* loop variables */

View File

@@ -68,6 +68,9 @@
/* use default instead of best visual */
#define RC_DefaultVisual (1<<5)
/* filter type for smoothed scaling */
#define RC_ScalingFilter (1<<6)
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -81,6 +84,7 @@ typedef struct RContextAttributes {
float bgamma; /* and blue */
VisualID visualid; /* visual ID to use */
int use_shared_memory; /* True of False */
int scaling_filter;
} RContextAttributes;
@@ -174,6 +178,25 @@ typedef struct RXImage {
#endif
} 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 {
@@ -185,16 +208,6 @@ enum {
};
/* image display modes */
enum {
RDitheredRendering = 0,
RBestMatchRendering = 1
};
/* bw compat */
#define RM_DITHER RDitheredRendering
#define RM_MATCH RBestMatchRendering
enum {
RAbsoluteCoordinates = 0,
RRelativeCoordinates = 1