diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2007-01-02 23:39:40 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2007-01-02 23:39:40 (GMT) |
commit | 8cfcd8faf4b5e13f63a9eeeabe137972a58dae6a (patch) | |
tree | fe1ed7354a514a4e4ee8d144aaeb2c5a791f2211 | |
parent | 97e5b14ae49e3dc721d35c77f6d33a29f9e6f422 (diff) | |
download | tk-8cfcd8faf4b5e13f63a9eeeabe137972a58dae6a.zip tk-8cfcd8faf4b5e13f63a9eeeabe137972a58dae6a.tar.gz tk-8cfcd8faf4b5e13f63a9eeeabe137972a58dae6a.tar.bz2 |
Made the generic fake-X11 glue layer abide by the formatting rules of the core.
-rw-r--r-- | ChangeLog | 38 | ||||
-rw-r--r-- | xlib/xbytes.h | 19 | ||||
-rw-r--r-- | xlib/xcolors.c | 89 | ||||
-rw-r--r-- | xlib/xdraw.c | 52 | ||||
-rw-r--r-- | xlib/xgc.c | 492 | ||||
-rw-r--r-- | xlib/ximage.c | 37 | ||||
-rw-r--r-- | xlib/xutil.c | 47 |
7 files changed, 414 insertions, 360 deletions
@@ -1,14 +1,18 @@ +2007-01-02 Donal K. Fellows <dkf@users.sf.net> + + * xlib/*: Made the generic fake-X11 glue layer abide by the formatting + rules of the core. + 2006-12-31 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net> * macosx/tkMacOSXFont.c: Fill-in TkpGetFontAttrsForChar (TIP #300). - * macosx/ttkMacOSXTheme.c: Define a constant to make it compile on - Mac OS X 10.3. + * macosx/ttkMacOSXTheme.c: Define a constant to make it compile on Mac + OS X 10.3. 2006-12-28 Mo DeJong <mdejong@users.sourceforge.net> - * tests/wm.test: Update wm attributes output - so that tests pass after addition of - -transparentcolor for Win32. + * tests/wm.test: Update wm attributes output so that tests pass after + addition of -transparentcolor for Win32. 2006-12-26 Joe English <jenglish@users.sourceforge.net> @@ -37,20 +41,18 @@ 2006-12-18 Joe English <jenglish@users.sourceforge.net> * generic/ttk/ttkTreeview.c, library/ttk/treeview.tcl, doc/treeview.n: - Added column '-stretch' and '-minwidth' options. - Improved column drag and resize behavior. - Added horizontal scrolling [#1518650]. - Row height and child indent specifiable on Treeview style. - Decreased default row height, no default -padding. - Use correct heading height [#1163349]. - Apply tag settings to tree item as well as to data columns - [NOTE: 'tag configure' still buggy]. - Fix off-by-one condition when moving nodes forward [#1618142] - * generic/ttk/ttkScroll.c(TtkScrollTo): Prevent overscroll ([#1173434]) + Added column '-stretch' and '-minwidth' options. Improved column drag + and resize behavior. Added horizontal scrolling [#1518650]. Row height + and child indent specifiable on Treeview style. Decreased default row + height, no default -padding. Use correct heading height [#1163349]. + Apply tag settings to tree item as well as to data columns [NOTE: 'tag + configure' still buggy]. Fix off-by-one condition when moving nodes + forward [#1618142] + * generic/ttk/ttkScroll.c (TtkScrollTo): Prevent overscroll [#1173434] * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl, - library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl, - library/ttk/defaults.tcl, library/ttk/winTheme.tcl - library/ttk/xpTheme.tcl: Per-theme treeview settings. + * library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl, + * library/ttk/defaults.tcl, library/ttk/winTheme.tcl, + * library/ttk/xpTheme.tcl: Per-theme treeview settings. * macosx/ttkMacOSXTheme.c: Added disclosure triangle element. 2006-12-17 Joe English <jenglish@users.sourceforge.net> diff --git a/xlib/xbytes.h b/xlib/xbytes.h index 46be124..178d7ad 100644 --- a/xlib/xbytes.h +++ b/xlib/xbytes.h @@ -5,19 +5,18 @@ * * Copyright (c) 1995 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xbytes.h,v 1.2 1998/09/14 18:24:02 stanton Exp $ + * RCS: @(#) $Id: xbytes.h,v 1.3 2007/01/02 23:39:40 dkf Exp $ */ #ifndef _XBYTES #define _XBYTES /* - * The bits in a byte can be reversed so the least significant becomes - * the most significant by indexing xBitReverseTable with the byte - * to be reversed. + * The bits in a byte can be reversed so the least significant becomes the + * most significant by indexing xBitReverseTable with the byte to be reversed. */ static unsigned char xBitReverseTable[256] = { @@ -56,3 +55,11 @@ static unsigned char xBitReverseTable[256] = { }; #endif /* _XBYTES */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 21c509c..0120579 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -1,30 +1,41 @@ -/* +/* * xcolors.c -- * - * This file contains the routines used to map from X color - * names to RGB and pixel values. + * This file contains the routines used to map from X color names to RGB + * and pixel values. * * Copyright (c) 1996 by Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xcolors.c,v 1.6 2005/09/10 14:53:21 das Exp $ + * RCS: @(#) $Id: xcolors.c,v 1.7 2007/01/02 23:39:40 dkf Exp $ */ #include <tkInt.h> /* + * This value will be set to the number of colors in the color table + * the first time it is needed. + */ + +static int numXColors = 0; + +/* + * Forward declarations for functions used only in this file. + */ + +static int FindColor(const char *name, XColor *colorPtr); + +/* * Define an array that defines the mapping from color names to RGB values. - * Note that this array must be kept sorted alphabetically so that the - * binary search used in XParseColor will succeed. + * Note that this array must be kept sorted alphabetically so that the binary + * search used in XParseColor will succeed. */ typedef struct { char *name; - unsigned char red; - unsigned char green; - unsigned char blue; + unsigned char red, green, blue; } XColorEntry; static XColorEntry xColors[] = { @@ -782,32 +793,18 @@ static XColorEntry xColors[] = { { "YellowGreen", 154, 205, 50 }, { NULL, 0, 0, 0 } }; - - -/* - * This value will be set to the number of colors in the color table - * the first time it is needed. - */ - -static int numXColors = 0; - -/* - * Forward declarations for functions used only in this file. - */ - -static int FindColor _ANSI_ARGS_((const char *name, XColor *colorPtr)); /* *---------------------------------------------------------------------- * * FindColor -- * - * This routine finds the color entry that corresponds to the - * specified color. + * This routine finds the color entry that corresponds to the specified + * color. * * Results: - * Returns non-zero on success. The RGB values of the XColor - * will be initialized to the proper values on success. + * Returns non-zero on success. The RGB values of the XColor will be + * initialized to the proper values on success. * * Side effects: * None. @@ -816,15 +813,15 @@ static int FindColor _ANSI_ARGS_((const char *name, XColor *colorPtr)); */ static int -FindColor(name, colorPtr) - const char *name; - XColor *colorPtr; +FindColor( + const char *name, + XColor *colorPtr) { int l, u, r, i = 0; /* - * Count the number of elements in the color array if we haven't - * done so yet. + * Count the number of elements in the color array if we haven't done so + * yet. */ if (numXColors == 0) { @@ -877,11 +874,11 @@ FindColor(name, colorPtr) */ Status -XParseColor(display, map, spec, colorPtr) - Display *display; - Colormap map; - const char* spec; - XColor *colorPtr; +XParseColor( + Display *display, + Colormap map, + const char *spec, + XColor *colorPtr) { if (spec[0] == '#') { char fmt[16]; @@ -897,11 +894,11 @@ XParseColor(display, map, spec, colorPtr) return 0; } colorPtr->red = (((unsigned short) red) << (4 * (4 - i))) - | ((unsigned short) red); + | ((unsigned short) red); colorPtr->green = (((unsigned short) green) << (4 * (4 - i))) - | ((unsigned short) green); + | ((unsigned short) green); colorPtr->blue = (((unsigned short) blue) << (4 * (4 - i))) - | ((unsigned short) blue); + | ((unsigned short) blue); } else { if (!FindColor(spec, colorPtr)) { return 0; @@ -912,3 +909,11 @@ XParseColor(display, map, spec, colorPtr) colorPtr->pad = 0; return 1; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/xlib/xdraw.c b/xlib/xdraw.c index 796f2f7..cf035de 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -1,15 +1,14 @@ -/* +/* * xdraw.c -- * - * This file contains generic procedures related to X drawing - * primitives. + * This file contains generic procedures related to X drawing primitives. * * Copyright (c) 1995 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xdraw.c,v 1.4 1999/04/16 01:51:55 stanton Exp $ + * RCS: @(#) $Id: xdraw.c,v 1.5 2007/01/02 23:39:40 dkf Exp $ */ #include "tk.h" @@ -19,7 +18,7 @@ * * XDrawLine -- * - * Draw a single line between two points in a given drawable. + * Draw a single line between two points in a given drawable. * * Results: * None. @@ -31,11 +30,12 @@ */ void -XDrawLine(display, d, gc, x1, y1, x2, y2) - Display* display; - Drawable d; - GC gc; - int x1, y1, x2, y2; /* Coordinates of line segment. */ +XDrawLine( + Display *display, + Drawable d, + GC gc, + int x1, int y1, + int x2, int y2) /* Coordinates of line segment. */ { XPoint points[2]; @@ -51,8 +51,8 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) * * XFillRectangle -- * - * Fills a rectangular area in the given drawable. This procedure - * is implemented as a call to XFillRectangles. + * Fills a rectangular area in the given drawable. This procedure is + * implemented as a call to XFillRectangles. * * Results: * None @@ -64,14 +64,14 @@ XDrawLine(display, d, gc, x1, y1, x2, y2) */ void -XFillRectangle(display, d, gc, x, y, width, height) - Display* display; - Drawable d; - GC gc; - int x; - int y; - unsigned int width; - unsigned int height; +XFillRectangle( + Display *display, + Drawable d, + GC gc, + int x, + int y, + unsigned int width, + unsigned int height) { XRectangle rectangle; rectangle.x = x; @@ -80,3 +80,11 @@ XFillRectangle(display, d, gc, x, y, width, height) rectangle.height = height; XFillRectangles(display, d, gc, &rectangle, 1); } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ @@ -1,15 +1,15 @@ -/* +/* * xgc.c -- * * This file contains generic routines for manipulating X graphics - * contexts. + * contexts. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xgc.c,v 1.9 2006/07/20 06:24:16 das Exp $ + * RCS: @(#) $Id: xgc.c,v 1.10 2007/01/02 23:39:40 dkf Exp $ */ #include <tkInt.h> @@ -23,7 +23,6 @@ # define Cursor XCursor # define Region XRegion #endif - /* *---------------------------------------------------------------------- @@ -33,7 +32,7 @@ * Allocate a new GC, and initialize the specified fields. * * Results: - * Returns a newly allocated GC. + * Returns a newly allocated GC. * * Side effects: * None. @@ -42,55 +41,59 @@ */ GC -XCreateGC(display, d, mask, values) - Display* display; - Drawable d; - unsigned long mask; - XGCValues* values; +XCreateGC( + Display *display, + Drawable d, + unsigned long mask, + XGCValues *values) { GC gp; -/* - * In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars are - * defined, which is invisible from the outside. The list is assumed to end - * with a 0-char, so this must be set explicitely during initialization. - */ + /* + * In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars + * are defined, which is invisible from the outside. The list is assumed + * to end with a 0-char, so this must be set explicitely during + * initialization. + */ #define MAX_DASH_LIST_SIZE 10 - gp = (XGCValues *)ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE); + gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE); if (!gp) { return None; } - gp->function = (mask & GCFunction) ?values->function :GXcopy; - gp->plane_mask = (mask & GCPlaneMask) ?values->plane_mask :(unsigned long )(~0); - gp->foreground = (mask & GCForeground) ?values->foreground :0; - gp->background = (mask & GCBackground) ?values->background :0xffffff; - gp->line_width = (mask & GCLineWidth) ?values->line_width :1; - gp->line_style = (mask & GCLineStyle) ?values->line_style :LineSolid; - gp->cap_style = (mask & GCCapStyle) ?values->cap_style :0; - gp->join_style = (mask & GCJoinStyle) ?values->join_style :0; - gp->fill_style = (mask & GCFillStyle) ?values->fill_style :FillSolid; - gp->fill_rule = (mask & GCFillRule) ?values->fill_rule :WindingRule; - gp->arc_mode = (mask & GCArcMode) ?values->arc_mode :ArcPieSlice; - gp->tile = (mask & GCTile) ?values->tile :None; - gp->stipple = (mask & GCStipple) ?values->stipple :None; - gp->ts_x_origin = (mask & GCTileStipXOrigin) ?values->ts_x_origin:0; - gp->ts_y_origin = (mask & GCTileStipYOrigin) ?values->ts_y_origin:0; - gp->font = (mask & GCFont) ?values->font :None; - gp->subwindow_mode = (mask & GCSubwindowMode)?values->subwindow_mode:ClipByChildren; - gp->graphics_exposures = (mask & GCGraphicsExposures)?values->graphics_exposures:True; - gp->clip_x_origin = (mask & GCClipXOrigin) ?values->clip_x_origin :0; - gp->clip_y_origin = (mask & GCClipYOrigin) ?values->clip_y_origin :0; - gp->dash_offset = (mask & GCDashOffset) ?values->dash_offset :0; - gp->dashes = (mask & GCDashList) ?values->dashes :4; - (&(gp->dashes))[1] = 0; +#define InitField(name,maskbit,default) \ + (gp->name = (mask & (maskbit)) ? values->name : (default)) + + InitField(function, GCFunction, GXCopy); + InitField(plane_mask, GCPlaneMask, (unsigned long)(~0)); + InitField(foreground, GCForeground, 0); + InitField(background, GCBackground, 0xffffff); + InitField(line_width, GCLineWidth, 1); + InitField(line_style, GCLineStyle, LineSolid); + InitField(cap_style, GCCapStyle, 0); + InitField(join_style, GCJoinStyle, 0); + InitField(fill_style, GCFillStyle, FillSolid); + InitField(fill_rule, GCFillRule, WindingRule); + InitField(arc_mode, GCArcMode, ArcPieSlice); + InitField(tile, GCTile, None); + InitField(stipple, GCStipple, None); + InitField(ts_x_origin, GCTileStipXOrigin, 0); + InitField(ts_y_origin, GCTileStipYOrigin, 0); + InitField(font, GCFont, None); + InitField(subwindow_mode, GCSubwindowMode, ClipByChildren); + InitField(graphics_exposures, GCGraphicsExposures, True); + InitField(clip_x_origin, GCClipXOrigin, 0); + InitField(clip_y_origin, GCClipYOrigin, 0); + InitField(dash_offset, GCDashOffset, 0); + InitField(dashes, GCDashList, 4); + (&(gp->dashes))[1] = 0; if (mask & GCClipMask) { - gp->clip_mask = (Pixmap)ckalloc(sizeof(TkpClipMask)); - ((TkpClipMask*)gp->clip_mask)->type = TKP_CLIP_PIXMAP; - ((TkpClipMask*)gp->clip_mask)->value.pixmap = values->clip_mask; + gp->clip_mask = (Pixmap) ckalloc(sizeof(TkpClipMask)); + ((TkpClipMask *) gp->clip_mask)->type = TKP_CLIP_PIXMAP; + ((TkpClipMask *) gp->clip_mask)->value.pixmap = values->clip_mask; } else { gp->clip_mask = None; } @@ -103,8 +106,7 @@ XCreateGC(display, d, mask, values) * * XChangeGC -- * - * Changes the GC components specified by valuemask for the - * specified GC. + * Changes the GC components specified by valuemask for the specified GC. * * Results: * None. @@ -116,35 +118,43 @@ XCreateGC(display, d, mask, values) */ void -XChangeGC(d, gc, mask, values) - Display * d; - GC gc; - unsigned long mask; - XGCValues *values; -{ - if (mask & GCFunction) { gc->function = values->function; } - if (mask & GCPlaneMask) { gc->plane_mask = values->plane_mask; } - if (mask & GCForeground) { gc->foreground = values->foreground; } - if (mask & GCBackground) { gc->background = values->background; } - if (mask & GCLineWidth) { gc->line_width = values->line_width; } - if (mask & GCLineStyle) { gc->line_style = values->line_style; } - if (mask & GCCapStyle) { gc->cap_style = values->cap_style; } - if (mask & GCJoinStyle) { gc->join_style = values->join_style; } - if (mask & GCFillStyle) { gc->fill_style = values->fill_style; } - if (mask & GCFillRule) { gc->fill_rule = values->fill_rule; } - if (mask & GCArcMode) { gc->arc_mode = values->arc_mode; } - if (mask & GCTile) { gc->tile = values->tile; } - if (mask & GCStipple) { gc->stipple = values->stipple; } - if (mask & GCTileStipXOrigin) { gc->ts_x_origin = values->ts_x_origin; } - if (mask & GCTileStipYOrigin) { gc->ts_y_origin = values->ts_y_origin; } - if (mask & GCFont) { gc->font = values->font; } - if (mask & GCSubwindowMode) { gc->subwindow_mode = values->subwindow_mode; } - if (mask & GCGraphicsExposures) { gc->graphics_exposures = values->graphics_exposures; } - if (mask & GCClipXOrigin) { gc->clip_x_origin = values->clip_x_origin; } - if (mask & GCClipYOrigin) { gc->clip_y_origin = values->clip_y_origin; } - if (mask & GCClipMask) { XSetClipMask(d, gc, values->clip_mask); } - if (mask & GCDashOffset) { gc->dash_offset = values->dash_offset; } - if (mask & GCDashList) { gc->dashes = values->dashes; (&(gc->dashes))[1] = 0;} +XChangeGC( + Display *d, + GC gc, + unsigned long mask, + XGCValues *values) +{ +#define ModifyField(name,maskbit) \ + if (mask & (maskbit)) { gc->name = values->name; } + + ModifyField(function, GCFunction); + ModifyField(plane_mask, GCPlaneMask); + ModifyField(foreground, GCForeground); + ModifyField(background, GCBackground); + ModifyField(line_width, GCLineWidth); + ModifyField(line_style, GCLineStyle); + ModifyField(cap_style, GCCapStyle); + ModifyField(join_style, GCJoinStyle); + ModifyField(fill_style, GCFillStyle); + ModifyField(fill_rule, GCFillRule); + ModifyField(arc_mode, GCArcMode); + ModifyField(tile, GCTile); + ModifyField(stipple, GCStipple); + ModifyField(ts_x_origin, GCTileStipXOrigin); + ModifyField(ts_y_origin, GCTileStipYOrigin); + ModifyField(font, GCFont); + ModifyField(subwindow_mode, GCSubwindowMode); + ModifyField(graphics_exposures, GCGraphicsExposures); + ModifyField(clip_x_origin, GCClipXOrigin); + ModifyField(clip_y_origin, GCClipYOrigin); + ModifyField(dash_offset, GCDashOffset); + if (mask & GCClipMask) { + XSetClipMask(d, gc, values->clip_mask); + } + if (mask & GCDashList) { + gc->dashes = values->dashes; + (&(gc->dashes))[1] = 0; + } } /* @@ -163,9 +173,9 @@ XChangeGC(d, gc, mask, values) *---------------------------------------------------------------------- */ -void XFreeGC(d, gc) - Display * d; - GC gc; +void XFreeGC( + Display *d, + GC gc) { if (gc != None) { if (gc->clip_mask != None) { @@ -180,8 +190,8 @@ void XFreeGC(d, gc) * * XSetForeground, etc. -- * - * The following functions are simply accessor functions for - * the GC slots. + * The following functions are simply accessor functions for the GC + * slots. * * Results: * None. @@ -192,31 +202,31 @@ void XFreeGC(d, gc) *---------------------------------------------------------------------- */ -void -XSetForeground(display, gc, foreground) - Display *display; - GC gc; - unsigned long foreground; +void +XSetForeground( + Display *display, + GC gc, + unsigned long foreground) { gc->foreground = foreground; } -void -XSetBackground(display, gc, background) - Display *display; - GC gc; - unsigned long background; +void +XSetBackground( + Display *display, + GC gc, + unsigned long background) { gc->background = background; } void -XSetDashes(display, gc, dash_offset, dash_list, n) - Display* display; - GC gc; - int dash_offset; - _Xconst char* dash_list; - int n; +XSetDashes( + Display *display, + GC gc, + int dash_offset, + _Xconst char *dash_list, + int n) { char *p = &(gc->dashes); @@ -235,78 +245,77 @@ XSetDashes(display, gc, dash_offset, dash_list, n) } void -XSetFunction(display, gc, function) - Display *display; - GC gc; - int function; +XSetFunction( + Display *display, + GC gc, + int function) { gc->function = function; } void -XSetFillRule(display, gc, fill_rule) - Display *display; - GC gc; - int fill_rule; +XSetFillRule( + Display *display, + GC gc, + int fill_rule) { gc->fill_rule = fill_rule; } void -XSetFillStyle(display, gc, fill_style) - Display *display; - GC gc; - int fill_style; +XSetFillStyle( + Display *display, + GC gc, + int fill_style) { gc->fill_style = fill_style; } void -XSetTSOrigin(display, gc, x, y) - Display *display; - GC gc; - int x, y; +XSetTSOrigin( + Display *display, + GC gc, + int x, int y) { gc->ts_x_origin = x; gc->ts_y_origin = y; } void -XSetFont(display, gc, font) - Display *display; - GC gc; - Font font; +XSetFont( + Display *display, + GC gc, + Font font) { gc->font = font; } void -XSetArcMode(display, gc, arc_mode) - Display *display; - GC gc; - int arc_mode; +XSetArcMode( + Display *display, + GC gc, + int arc_mode) { gc->arc_mode = arc_mode; } void -XSetStipple(display, gc, stipple) - Display *display; - GC gc; - Pixmap stipple; +XSetStipple( + Display *display, + GC gc, + Pixmap stipple) { gc->stipple = stipple; } void -XSetLineAttributes(display, gc, line_width, line_style, cap_style, - join_style) - Display *display; - GC gc; - unsigned int line_width; - int line_style; - int cap_style; - int join_style; +XSetLineAttributes( + Display *display, + GC gc, + unsigned int line_width, + int line_style, + int cap_style, + int join_style) { gc->line_width = line_width; gc->line_style = line_style; @@ -315,11 +324,11 @@ XSetLineAttributes(display, gc, line_width, line_style, cap_style, } void -XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) - Display* display; - GC gc; - int clip_x_origin; - int clip_y_origin; +XSetClipOrigin( + Display *display, + GC gc, + int clip_x_origin, + int clip_y_origin) { gc->clip_x_origin = clip_x_origin; gc->clip_y_origin = clip_y_origin; @@ -332,10 +341,9 @@ XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) * * Sets the clipping region/pixmap for a GC. * - * Note that unlike the Xlib equivalent, it is not safe to delete - * the region after setting it into the GC. The only use of - * TkSetRegion is currently in ImgPhotoDisplay, which uses the GC - * immediately. + * Note that unlike the Xlib equivalent, it is not safe to delete the + * region after setting it into the GC. The only use of TkSetRegion is + * currently in ImgPhotoDisplay, which uses the GC immediately. * * Results: * None. @@ -347,10 +355,10 @@ XSetClipOrigin(display, gc, clip_x_origin, clip_y_origin) */ void -TkSetRegion(display, gc, r) - Display* display; - GC gc; - TkRegion r; +TkSetRegion( + Display *display, + GC gc, + TkRegion r) { if (r == None) { if (gc->clip_mask) { @@ -363,15 +371,15 @@ TkSetRegion(display, gc, r) if (gc->clip_mask == None) { gc->clip_mask = (Pixmap)ckalloc(sizeof(TkpClipMask)); } - ((TkpClipMask*)gc->clip_mask)->type = TKP_CLIP_REGION; - ((TkpClipMask*)gc->clip_mask)->value.region = r; + ((TkpClipMask*) gc->clip_mask)->type = TKP_CLIP_REGION; + ((TkpClipMask*) gc->clip_mask)->value.region = r; } void -XSetClipMask(display, gc, pixmap) - Display* display; - GC gc; - Pixmap pixmap; +XSetClipMask( + Display *display, + GC gc, + Pixmap pixmap) { if (pixmap == None) { if (gc->clip_mask) { @@ -384,8 +392,8 @@ XSetClipMask(display, gc, pixmap) if (gc->clip_mask == None) { gc->clip_mask = (Pixmap)ckalloc(sizeof(TkpClipMask)); } - ((TkpClipMask*)gc->clip_mask)->type = TKP_CLIP_PIXMAP; - ((TkpClipMask*)gc->clip_mask)->value.pixmap = pixmap; + ((TkpClipMask*) gc->clip_mask)->type = TKP_CLIP_PIXMAP; + ((TkpClipMask*) gc->clip_mask)->value.pixmap = pixmap; } /* @@ -394,157 +402,167 @@ XSetClipMask(display, gc, pixmap) #if 0 Cursor -XCreateFontCursor(display, shape) - Display* display; - unsigned int shape; +XCreateFontCursor( + Display *display, + unsigned int shape) { return (Cursor) 0; } void -XDrawImageString(display, d, gc, x, y, string, length) - Display* display; - Drawable d; - GC gc; - int x; - int y; - _Xconst char* string; - int length; +XDrawImageString( + Display *display, + Drawable d, + GC gc, + int x, + int y, + _Xconst char *string, + int length) { } #endif void -XDrawPoint(display, d, gc, x, y) - Display* display; - Drawable d; - GC gc; - int x; - int y; +XDrawPoint( + Display *display, + Drawable d, + GC gc, + int x, + int y) { XDrawLine(display, d, gc, x, y, x, y); } void -XDrawPoints(display, d, gc, points, npoints, mode) - Display* display; - Drawable d; - GC gc; - XPoint* points; - int npoints; - int mode; +XDrawPoints( + Display *display, + Drawable d, + GC gc, + XPoint *points, + int npoints, + int mode) { int i; for (i=0; i<npoints; i++) { - XDrawPoint(display, d, gc, points[i].x, points[i].y); + XDrawLine(display, d, gc, + points[i].x, points[i].y, points[i].x, points[i].y); } } #if !defined(MAC_OSX_TK) void -XDrawSegments(display, d, gc, segments, nsegments) - Display* display; - Drawable d; - GC gc; - XSegment* segments; - int nsegments; +XDrawSegments( + Display *display, + Drawable d, + GC gc, + XSegment *segments, + int nsegments) { } #endif #if 0 char * -XFetchBuffer(display, nbytes_return, buffer) - Display* display; - int* nbytes_return; - int buffer; +XFetchBuffer( + Display *display, + int *nbytes_return, + int buffer) { return (char *) 0; } -Status XFetchName(display, w, window_name_return) - Display* display; - Window w; - char** window_name_return; +Status +XFetchName( + Display *display, + Window w, + char **window_name_return) { return (Status) 0; } -Atom *XListProperties(display, w, num_prop_return) - Display* display; - Window w; - int* num_prop_return; +Atom * +XListProperties( + Display* display, + Window w, + int *num_prop_return) { return (Atom *) 0; } void -XMapRaised(display, w) - Display* display; - Window w; +XMapRaised( + Display *display, + Window w) { } void -XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height) - Display* display; - Drawable d; - GC gc; - XImage* image; - int src_x; - int src_y; - int dest_x; - int dest_y; - unsigned int width; - unsigned int height; +XPutImage( + Display *display, + Drawable d, + GC gc, + XImage *image, + int src_x, + int src_y, + int dest_x, + int dest_y, + unsigned int width, + unsigned int height) { } void -XQueryTextExtents(display, font_ID, string, nchars, direction_return, - font_ascent_return, font_descent_return, overall_return) - Display* display; - XID font_ID; - _Xconst char* string; - int nchars; - int* direction_return; - int* font_ascent_return; - int* font_descent_return; - XCharStruct* overall_return; +XQueryTextExtents( + Display *display, + XID font_ID, + _Xconst char *string, + int nchars, + int *direction_return, + int *font_ascent_return, + int *font_descent_return, + XCharStruct *overall_return) { } void -XReparentWindow(display, w, parent, x, y) - Display* display; - Window w; - Window parent; - int x; - int y; +XReparentWindow( + Display *display, + Window w, + Window parent, + int x, + int y) { } void -XRotateBuffers(display, rotate) - Display* display; - int rotate; +XRotateBuffers( + Display *display, + int rotate) { } void -XStoreBuffer(display, bytes, nbytes, buffer) - Display* display; - _Xconst char* bytes; - int nbytes; - int buffer; +XStoreBuffer( + Display *display, + _Xconst char *bytes, + int nbytes, + int buffer) { } void -XUndefineCursor(display, w) - Display* display; - Window w; +XUndefineCursor( + Display *display, + Window w) { } #endif + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/xlib/ximage.c b/xlib/ximage.c index 97a79c1..6f0c7ee 100644 --- a/xlib/ximage.c +++ b/xlib/ximage.c @@ -1,18 +1,17 @@ -/* +/* * ximage.c -- * * X bitmap and image routines. * * Copyright (c) 1995 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: ximage.c,v 1.5 2004/02/23 10:48:11 das Exp $ + * RCS: @(#) $Id: ximage.c,v 1.6 2007/01/02 23:39:40 dkf Exp $ */ #include "tkInt.h" - /* *---------------------------------------------------------------------- @@ -21,10 +20,10 @@ * * Construct a single plane pixmap from bitmap data. * - * NOTE: This procedure has the correct behavior on Windows and - * the Macintosh, but not on UNIX. This is probably because the - * emulation for XPutImage on those platforms compensates for whatever - * is wrong here :-) + * NOTE: This procedure has the correct behavior on Windows and the + * Macintosh, but not on UNIX. This is probably because the emulation for + * XPutImage on those platforms compensates for whatever is wrong here + * :-) * * Results: * Returns a new Pixmap. @@ -36,12 +35,12 @@ */ Pixmap -XCreateBitmapFromData(display, d, data, width, height) - Display* display; - Drawable d; - _Xconst char* data; - unsigned int width; - unsigned int height; +XCreateBitmapFromData( + Display *display, + Drawable d, + _Xconst char *data, + unsigned int width, + unsigned int height) { XImage ximage; GC gc; @@ -72,3 +71,11 @@ XCreateBitmapFromData(display, d, data, width, height) XFreeGC(display, gc); return pix; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ diff --git a/xlib/xutil.c b/xlib/xutil.c index d803a1d..103d995 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -1,14 +1,14 @@ -/* +/* * xutil.c -- * * This function contains generic X emulation routines. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xutil.c,v 1.3 2004/03/17 18:15:50 das Exp $ + * RCS: @(#) $Id: xutil.c,v 1.4 2007/01/02 23:39:40 dkf Exp $ */ #include <stdlib.h> @@ -22,10 +22,9 @@ * * XInternAtom -- * - * This procedure simulates the XInternAtom function by calling - * Tk_Uid to get a unique id for every atom. This is only a - * partial implementation, since it doesn't work across - * applications. + * This procedure simulates the XInternAtom function by calling Tk_Uid to + * get a unique id for every atom. This is only a partial implementation, + * since it doesn't work across applications. * * Results: * A new Atom. @@ -37,13 +36,13 @@ */ Atom -XInternAtom(display, atom_name, only_if_exists) - Display* display; - _Xconst char* atom_name; - Bool only_if_exists; +XInternAtom( + Display *display, + _Xconst char *atom_name, + Bool only_if_exists) { static Atom atom = XA_LAST_PREDEFINED; - + display->request++; return ++atom; } @@ -65,13 +64,13 @@ XInternAtom(display, atom_name, only_if_exists) */ XVisualInfo * -XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return) - Display* display; - long vinfo_mask; - XVisualInfo* vinfo_template; - int* nitems_return; +XGetVisualInfo( + Display *display, + long vinfo_mask, + XVisualInfo *vinfo_template, + int *nitems_return) { - XVisualInfo *info = (XVisualInfo *)ckalloc(sizeof(XVisualInfo)); + XVisualInfo *info = (XVisualInfo *) ckalloc(sizeof(XVisualInfo)); info->visual = DefaultVisual(display, 0); info->visualid = info->visual->visualid; info->screen = 0; @@ -82,7 +81,7 @@ XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return) info->red_mask = info->visual->red_mask; info->green_mask = info->visual->green_mask; info->blue_mask = info->visual->blue_mask; - + if (((vinfo_mask & VisualIDMask) && (vinfo_template->visualid != info->visualid)) || ((vinfo_mask & VisualScreenMask) @@ -109,3 +108,11 @@ XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return) *nitems_return = 1; return info; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ |