From 18f790a6906ca0d519020fc8d85121ad40894b1b Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Fri, 12 Oct 2007 09:32:27 +0000 Subject: [PATCH] Allow non-resizable windows to be resized programmatically. Clean up compiler warnings. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@25527 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ Source/x11/XGServerWindow.m | 12 ++++++++++++ Source/x11/XIMInputServer.m | 2 +- Source/x11/convert.c | 22 +++++++++++----------- Source/x11/raster.c | 2 +- 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b917bd..eddf983 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-10-12 Fred Kiefer + + * Source/x11/XGServerWindow.m (-placewindow:): Change window to be + temporary resizable. Patch by Wolfgang Lux . + * Source/x11/XIMInputServer.m: Clean up includes to avoid compiler warning. + * Source/x11/raster.c (calculateCombineArea): Change parameter + signedness to avoid compiler warnings. + * Source/x11/convert.c (convertTrueColor_generic, + convertPseudoColor_to_8): Change parameter signedness to avoid compiler warnings. + 2007-10-08 Fred Kiefer * Source/cairo/CairoFontInfo.m diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 86b85e8..a45c095 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -2935,6 +2935,18 @@ static BOOL didCreatePixmaps; move = YES; } + /* Temporarily remove minimum and maximum window size hints to make + * the window resizable programatically. + */ + if (window->siz_hints.flags & (PMinSize | PMaxSize)) + { + long flags = window->siz_hints.flags; + + window->siz_hints.flags &= ~(PMinSize | PMaxSize); + XSetWMNormalHints(dpy, window->ident, &window->siz_hints); + window->siz_hints.flags = flags; + } + xVal = [self _OSFrameToXFrame: rect for: window]; xHint = [self _XFrameToXHints: xVal for: window]; window->siz_hints.width = (int)xHint.size.width; diff --git a/Source/x11/XIMInputServer.m b/Source/x11/XIMInputServer.m index e45c8d5..34f9370 100644 --- a/Source/x11/XIMInputServer.m +++ b/Source/x11/XIMInputServer.m @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "x11/XGInputServer.h" #include diff --git a/Source/x11/convert.c b/Source/x11/convert.c index e248d77..036c569 100644 --- a/Source/x11/convert.c +++ b/Source/x11/convert.c @@ -140,9 +140,9 @@ computeStdTable(unsigned int mult, unsigned int max) static void convertTrueColor_generic(RXImage *ximg, RImage *image, signed char *err, signed char *nerr, - const short *rtable, - const short *gtable, - const short *btable, + const unsigned short *rtable, + const unsigned short *gtable, + const unsigned short *btable, const int dr, const int dg, const int db, const unsigned short roffs, const unsigned short goffs, @@ -342,8 +342,8 @@ image2TrueColor(RContext *ctx, RImage *image) puts("true color dither"); #endif { - char *err; - char *nerr; + signed char *err; + signed char *nerr; int ch = (image->format == RRGBAFormat ? 4 : 3); err = malloc(ch*(image->width+2)); @@ -381,9 +381,9 @@ image2TrueColor(RContext *ctx, RImage *image) static void convertPseudoColor_to_8(RXImage *ximg, RImage *image, signed char *err, signed char *nerr, - const short *rtable, - const short *gtable, - const short *btable, + const unsigned short *rtable, + const unsigned short *gtable, + const unsigned short *btable, const int dr, const int dg, const int db, unsigned long *pixels, int cpc) @@ -393,7 +393,7 @@ convertPseudoColor_to_8(RXImage *ximg, RImage *image, int pixel; int rer, ger, ber; unsigned char *ptr = image->data; - unsigned char *optr = ximg->image->data; + unsigned char *optr = (unsigned char *)ximg->image->data; int channels = (image->format == RRGBAFormat ? 4 : 3); int cpcpc = cpc*cpc; @@ -507,8 +507,8 @@ image2PseudoColor(RContext *ctx, RImage *image) } } else { /* dither */ - char *err; - char *nerr; + signed char *err; + signed char *nerr; const int dr=0xff/rmask; const int dg=0xff/gmask; const int db=0xff/bmask; diff --git a/Source/x11/raster.c b/Source/x11/raster.c index e3fad42..f53f281 100644 --- a/Source/x11/raster.c +++ b/Source/x11/raster.c @@ -299,7 +299,7 @@ RCombineImagesWithOpaqueness(RImage *image, RImage *src, int opaqueness) int calculateCombineArea(RImage *des, RImage *src, int *sx, int *sy, - int *swidth, int *sheight, int *dx, int *dy) + unsigned *swidth, unsigned *sheight, int *dx, int *dy) { if (*dx < 0) { *sx = -*dx;