diff --git a/libdockapp/examples/basic/Imakefile b/libdockapp/examples/basic/Imakefile index 2847178..18d9be7 100644 --- a/libdockapp/examples/basic/Imakefile +++ b/libdockapp/examples/basic/Imakefile @@ -1,7 +1,7 @@ # $Id: Imakefile,v 1.4 2002/10/16 07:19:18 dalroi Exp $ STD_INCLUDES = $(INC_PATH) -I/usr/local/include -I. -DEPLIBS = $(DEPXLIB) +DEPLIBS = $(DEPXLIB) LOCAL_LIBRARIES = $(LIB_PATH) -L/usr/local/lib -L/usr/X11R6/lib \ -L../../src/.libs \ diff --git a/libdockapp/examples/basic/README b/libdockapp/examples/basic/README index 745fe68..27bf48b 100644 --- a/libdockapp/examples/basic/README +++ b/libdockapp/examples/basic/README @@ -12,7 +12,7 @@ Public Domain Icons These icons were originally made for Mosaic for X and have been included in the NCSA httpd and Apache server distributions in the past. They are in the public domain and may be freely included in any - application. The originals were done by Kevin Hughes + application. The originals were done by Kevin Hughes (kevinh@kevcom.com). Many thanks to Andy Polyakov for tuning the icon colors and adding a diff --git a/libdockapp/examples/basic/basic.c b/libdockapp/examples/basic/basic.c index 683438c..a27be86 100644 --- a/libdockapp/examples/basic/basic.c +++ b/libdockapp/examples/basic/basic.c @@ -1,7 +1,7 @@ /* $Id: basic.c,v 1.10 2003/02/10 12:35:03 dalroi Exp $ * * Copyright (c) 2002 Alban G. Hertroys - * + * * Basic example of libDockapp usage * * This dockapp will draw a rectangle with a @@ -179,7 +179,7 @@ moveBall() x = 1; dx = -dx + var; } - + if (y < 1) { y = 1; dy = -dy + var; @@ -189,7 +189,7 @@ moveBall() x = 46 - ballPix->geometry.width; dx = -dx + var; } - + if (y + ballPix->geometry.height > 46) { y = 46 - ballPix->geometry.height; dy = -dy + var; diff --git a/libdockapp/examples/rectangles/Imakefile b/libdockapp/examples/rectangles/Imakefile index 8a858c6..c8b0f1b 100644 --- a/libdockapp/examples/rectangles/Imakefile +++ b/libdockapp/examples/rectangles/Imakefile @@ -1,7 +1,7 @@ # $Id: Imakefile,v 1.1 2002/10/16 07:19:18 dalroi Exp $ STD_INCLUDES = $(INC_PATH) -I/usr/local/include -I. -DEPLIBS = $(DEPXLIB) +DEPLIBS = $(DEPXLIB) LOCAL_LIBRARIES = $(LIB_PATH) -L/usr/local/lib -L/usr/X11R6/lib \ -L../../src/.libs \ diff --git a/libdockapp/examples/rectangles/rectangles.c b/libdockapp/examples/rectangles/rectangles.c index 6e8d5e7..82104f8 100644 --- a/libdockapp/examples/rectangles/rectangles.c +++ b/libdockapp/examples/rectangles/rectangles.c @@ -33,7 +33,7 @@ struct Colors { GC black; /* background color, idem */ GC lightGray; /* Some GC's we'll have to define for colors */ GC darkGray; - GC slider; /* draw-color when not highlighted, + GC slider; /* draw-color when not highlighted, * dark-color when highlighted */ GC sliderLight; /* draw-color when highlighted */ @@ -125,7 +125,7 @@ main(int argc, char **argv) /* define what to do if an event occurs in a rectangle */ DAActionRect *buttonPressRects, *buttonReleaseRects, *mouseMoveRects, *mouseEnterRects, *mouseLeaveRects; - + buttonPressRects = malloc(3 * sizeof(DAActionRect)); buttonPressRects[0] = setRectAction(btn, btnDown); buttonPressRects[1] = setRectAction(square, squareDown); @@ -144,7 +144,7 @@ main(int argc, char **argv) mouseLeaveRects = malloc(2 * sizeof(DAActionRect)); mouseLeaveRects[0] = setRectAction(btn, btnLeave); mouseLeaveRects[1] = setRectAction(slider, sliderLeave); - + /* XXX: make action rectangles available outside main() * ...libDockapp should be able to do this... (reminder) @@ -208,7 +208,7 @@ main(int argc, char **argv) */ pointer = XCreateFontCursor(DADisplay, XC_based_arrow_up); XDefineCursor(DADisplay, DAWindow, pointer); - + /* a square with an image that changes when clicked (A button). */ createBtn(btn); @@ -258,7 +258,7 @@ setGCs(Drawable d) /* don't send expose events */ gcv.graphics_exposures = False; - + /* GC for white color */ gcv.foreground = WhitePixel(DADisplay, DefaultScreen(DADisplay)); colors->white = XCreateGC(DADisplay, d, @@ -272,7 +272,7 @@ setGCs(Drawable d) #endif colors->black = XCreateGC(DADisplay, d, GCForeground|GCGraphicsExposures, &gcv); - + /* GC for light borders */ gcv.foreground = DAGetColor("lightGray"); colors->lightGray = XCreateGC(DADisplay, d, @@ -329,7 +329,7 @@ adjustColor(unsigned long color, signed int adjustment) r += adjustment; g += adjustment; b += adjustment; - + if (r > 0xff) r = 0xff; if (g > 0xff) g = 0xff; if (b > 0xff) b = 0xff; @@ -337,7 +337,7 @@ adjustColor(unsigned long color, signed int adjustment) if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; - + return ((unsigned short)r << 16) + ((unsigned short)g << 8) + (unsigned short)b; @@ -449,7 +449,7 @@ squareDown(int x, int y, DARect rect, void *data) if (data) { int *tmp = (int*)data; - + button = *tmp; } else button = 0; @@ -490,7 +490,7 @@ sliderMove(int x, int y, DARect rect, void *data) sliderPos = (float)(rect.height - y)/(float)rect.height; if (sliderPos > 1.0) sliderPos = 1.0; if (sliderPos < 0.0) sliderPos = 0.0; - + drawSlider(rect); } @@ -556,7 +556,7 @@ drawSunkenFrame(DARect rect) DASetPixmap(pixmap); } - + void createSquare(DARect rect) { diff --git a/libdockapp/fonts/Makefile.am b/libdockapp/fonts/Makefile.am index d25cc92..6d39ff0 100644 --- a/libdockapp/fonts/Makefile.am +++ b/libdockapp/fonts/Makefile.am @@ -1,6 +1,6 @@ fontdir = @FONTDIR@ dist_font_DATA = luxel-ascii-06x09.pcf.gz \ - seg7-ascii-05x07.pcf.gz + seg7-ascii-05x07.pcf.gz install-data-hook: @rm -f $(DESTDIR)$(fontdir)/font.dir diff --git a/libdockapp/src/dacallback.c b/libdockapp/src/dacallback.c index 8264b99..922c0c5 100644 --- a/libdockapp/src/dacallback.c +++ b/libdockapp/src/dacallback.c @@ -30,7 +30,7 @@ void DASetCallbacks(DACallbacks *callbacks) { long mask = 0; - + _daContext->callbacks = *callbacks; if (callbacks->destroy) @@ -45,7 +45,7 @@ DASetCallbacks(DACallbacks *callbacks) mask |= EnterWindowMask; if (callbacks->leave) mask |= LeaveWindowMask; - + XSelectInput(DADisplay, DAWindow, mask); XFlush(DADisplay); } diff --git a/libdockapp/src/dacolor.c b/libdockapp/src/dacolor.c index b6fe8f6..77d00a3 100644 --- a/libdockapp/src/dacolor.c +++ b/libdockapp/src/dacolor.c @@ -31,17 +31,17 @@ unsigned long DAGetColor(char *colorName) { XColor color; - + if (!XParseColor(DADisplay, DefaultColormap(DADisplay, DefaultScreen(DADisplay)), colorName, &color)) DAError("could not parse color %s", colorName); - + if (!XAllocColor(DADisplay, DefaultColormap(DADisplay, DefaultScreen(DADisplay)), &color)) { DAWarning("could not allocate color %s. Using black instead", colorName); return BlackPixel(DADisplay, DefaultScreen(DADisplay)); } - + return color.pixel; } diff --git a/libdockapp/src/daevent.c b/libdockapp/src/daevent.c index a85afee..4f6337e 100644 --- a/libdockapp/src/daevent.c +++ b/libdockapp/src/daevent.c @@ -102,7 +102,7 @@ DAProcessEventForWindow(Window window, XEvent *event) default: return False; } - + return True; } @@ -137,24 +137,24 @@ DANextEventOrTimeout(XEvent *event, unsigned long milliseconds) { struct timeval timeout; fd_set rset; - + XSync(DADisplay, False); if (XPending(DADisplay)) { XNextEvent(DADisplay, event); return True; } - + timeout.tv_sec = milliseconds / 1000; timeout.tv_usec = (milliseconds % 1000) * 1000; - + FD_ZERO(&rset); FD_SET(ConnectionNumber(DADisplay), &rset); - + if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, &timeout) > 0) { XNextEvent(DADisplay, event); return True; } - + return False; } diff --git a/libdockapp/src/damain.c b/libdockapp/src/damain.c index 80065c1..66a6518 100644 --- a/libdockapp/src/damain.c +++ b/libdockapp/src/damain.c @@ -70,7 +70,7 @@ DAProposeIconSize(unsigned width, unsigned height) /* Get the nearest allowed icon size if the WM specifies such */ iconSizes = XAllocIconSize(); - if (XGetIconSizes(DADisplay, DefaultRootWindow(DADisplay), + if (XGetIconSizes(DADisplay, DefaultRootWindow(DADisplay), &iconSizes, &nrSizes)) { int i; int da = -1; @@ -80,25 +80,25 @@ DAProposeIconSize(unsigned width, unsigned height) for (i = 0; i < nrSizes; i++) { int w1, h1, w, h; - if ((max_w < iconSizes[i].max_width) || + if ((max_w < iconSizes[i].max_width) || (max_h < iconSizes[i].max_height)) { max_w = iconSizes[i].max_width; max_h = iconSizes[i].max_height; } - - if ((min_w > iconSizes[i].min_width) || - (min_h > iconSizes[i].min_height) || + + if ((min_w > iconSizes[i].min_width) || + (min_h > iconSizes[i].min_height) || (min_w == -1)) { min_w = iconSizes[i].min_width; min_h = iconSizes[i].min_height; } - + if ((width > iconSizes[i].max_width) || (width < iconSizes[i].min_width) || (height > iconSizes[i].max_height) || (height < iconSizes[i].min_height)) continue; - + w1 = (iconSizes[i].max_width - width ) % iconSizes[i].width_inc; h1 = (iconSizes[i].max_height - height) % iconSizes[i].height_inc; w = MIN(w1, iconSizes[i].width_inc - w1); @@ -181,7 +181,7 @@ DACreateIcon(char *name, unsigned width, unsigned height, int argc, char **argv) /* Set WMProtocols */ WM_DELETE_WINDOW = XInternAtom(DADisplay, "WM_DELETE_WINDOW", True); XSetWMProtocols(DADisplay, DALeader, &WM_DELETE_WINDOW, 1); - + /* Set Command to start the app so it can be docked properly */ XSetCommand(DADisplay, DALeader, argv, argc); diff --git a/libdockapp/src/dapixmap.c b/libdockapp/src/dapixmap.c index 7543223..901a6f5 100644 --- a/libdockapp/src/dapixmap.c +++ b/libdockapp/src/dapixmap.c @@ -118,11 +118,11 @@ _daMakePixmap(daXpmSource source, unsigned short *width, unsigned short *height) { XpmAttributes xpmAttr; - + xpmAttr.valuemask = XpmCloseness; xpmAttr.closeness = 40000; - - + + if (source == daXpmSourceData && (XpmCreatePixmapFromData( DADisplay, DAWindow, data, pixmap, mask, &xpmAttr) != 0)) @@ -135,7 +135,7 @@ _daMakePixmap(daXpmSource source, *width = xpmAttr.width; *height = xpmAttr.height; - + return True; } diff --git a/libdockapp/src/dashaped.c b/libdockapp/src/dashaped.c index 97c7b3c..2beacda 100644 --- a/libdockapp/src/dashaped.c +++ b/libdockapp/src/dashaped.c @@ -17,7 +17,7 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * * $Id: dashaped.c,v 1.11 2008/05/01 09:49:06 dalroi Exp $ */ @@ -57,7 +57,7 @@ DAMakeShapedPixmap() dasp->shape = DAMakeShape(); dasp->geometry.width = _daContext->width; dasp->geometry.height = _daContext->height; - + setGCs(dasp); DASPClear(dasp); @@ -177,7 +177,7 @@ _daMakeShapedPixmap(daShapeSource source, char **data) if (dasp == NULL) return NULL; - + memset(dasp, 0, sizeof(DAShapedPixmap)); if (source == daShapeSourceData) @@ -189,7 +189,7 @@ _daMakeShapedPixmap(daShapeSource source, char **data) if (!success) return NULL; - + setGCs(dasp); return dasp; diff --git a/libdockapp/src/dockapp.h b/libdockapp/src/dockapp.h index 1e67d7c..e76845d 100644 --- a/libdockapp/src/dockapp.h +++ b/libdockapp/src/dockapp.h @@ -17,7 +17,7 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * * $Id: dockapp.h,v 1.18 2005/07/16 11:49:10 dalroi Exp $ */ @@ -49,7 +49,7 @@ /* !!! DEPRECATED !!! * This feature may be removed in the future. Use DAEventCallbacks instead. - * + * * the callbacks for events related to the dockapp window your program wants * to handle */ @@ -75,10 +75,10 @@ typedef struct { char *shortForm; /* short form for option, like -w */ char *longForm; /* long form for option, like --withdrawn */ char *description; /* description for the option */ - + short type; /* type of argument */ Bool used; /* if the argument was passed on the cmd-line */ - + /* the following are only set if the "used" field is True */ union { void *ptr; /* a ptr for the value that was passed */