diff options
author | nijtmans <nijtmans> | 2009-02-27 23:23:35 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2009-02-27 23:23:35 (GMT) |
commit | 2bd24991fb1306a2a230549895084b7424845fbe (patch) | |
tree | 06a8f93bcc5d7a6ab6a66ff97d59e2b67d7e6ceb | |
parent | 0aa2082226c7156d97ae4a66c508d1fd6ee421c4 (diff) | |
download | tk-2bd24991fb1306a2a230549895084b7424845fbe.zip tk-2bd24991fb1306a2a230549895084b7424845fbe.tar.gz tk-2bd24991fb1306a2a230549895084b7424845fbe.tar.bz2 |
[Feature Request 2636558] Tk_DefineBitmap
and Tk_GetBitmapFromData signature problem
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | doc/GetBitmap.3 | 4 | ||||
-rw-r--r-- | generic/tk.decls | 17 | ||||
-rw-r--r-- | generic/tkBitmap.c | 48 | ||||
-rw-r--r-- | generic/tkDecls.h | 54 | ||||
-rw-r--r-- | generic/tkInt.decls | 6 | ||||
-rw-r--r-- | generic/tkInt.h | 4 | ||||
-rw-r--r-- | generic/tkIntDecls.h | 6 | ||||
-rw-r--r-- | generic/tkStubInit.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXBitmap.c | 6 |
10 files changed, 118 insertions, 47 deletions
@@ -1,3 +1,15 @@ +2009-02-27 Jan Nijtmans <nijtmans@users.sf.net> + + * doc/GetBitmap.3 [Feature Request 2636558] Tk_DefineBitmap + * generic/tk.decls and Tk_GetBitmapFromData signature problem + * generic/tkInt.decls + * generic/tkBitmap.c + * generic/tkInt.h + * generic/tkStubInit.c + * generic/tkDecls.h (regenerated) + * generic/tkIntDecls.h (regenerated) + * macosx/tkMacOSXBitmap.c + 2009-02-27 Pat Thoyts <patthoyts@users.sourceforge.net> * generic/tkWindow.c: [Bug 2645457] check for dead windows after diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index 84f729d..7014d98 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetBitmap.3,v 1.16 2008/11/05 22:58:30 nijtmans Exp $ +'\" RCS: @(#) $Id: GetBitmap.3,v 1.17 2009/02/27 23:23:36 nijtmans Exp $ '\" .so man.macros .TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures" @@ -51,7 +51,7 @@ Same as \fIobjPtr\fR except description of bitmap is passed as a string and resulting Pixmap is not cached. .AP "const char" *name in Name for new bitmap to be defined. -.AP "const char" *source in +.AP "const void" *source in Data for bitmap, in standard bitmap format. Must be stored in static memory whose value will never change. .AP "int" width in diff --git a/generic/tk.decls b/generic/tk.decls index 4de7253..2bfcd8c 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tk.decls,v 1.46 2009/01/02 23:20:32 nijtmans Exp $ +# RCS: @(#) $Id: tk.decls,v 1.47 2009/02/27 23:23:35 nijtmans Exp $ library tk @@ -208,7 +208,7 @@ declare 43 generic { const char *pathName, const char *screenName) } declare 44 generic { - int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, + int Tk_OldDefineBitmap(Tcl_Interp *interp, const char *name, const char *source, int width, int height) } declare 45 generic { @@ -360,7 +360,7 @@ declare 85 generic { Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char * str) } declare 86 generic { - Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, + Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp, Tk_Window tkwin, const char *source, int width, int height) } declare 87 generic { @@ -1074,6 +1074,17 @@ declare 273 generic { void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) } +# See [Enhancement request 2636558] Tk_DefineBitmap and +# Tk_GetBitmapFromData signature problem +declare 274 generic { + int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, + const void *source, int width, int height) +} +declare 275 generic { + Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, + Tk_Window tkwin, const void *source, int width, int height) +} + # Define the platform specific public Tk interface. These functions are # only available on the designated platform. diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index fdb9908..adfb245 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBitmap.c,v 1.25 2009/01/09 07:03:31 nijtmans Exp $ + * RCS: @(#) $Id: tkBitmap.c,v 1.26 2009/02/27 23:23:36 nijtmans Exp $ */ #include "tkInt.h" @@ -459,7 +459,7 @@ GetBitmap( */ int -Tk_DefineBitmap( +Tk_OldDefineBitmap( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ const char *name, /* Name to use for bitmap. Must not already be * defined as a bitmap. */ @@ -467,6 +467,18 @@ Tk_DefineBitmap( int width, /* Width of bitmap. */ int height) /* Height of bitmap. */ { + return Tk_DefineBitmap(interp, name, source, width, height); +} + +int +Tk_DefineBitmap( + Tcl_Interp *interp, /* Interpreter to use for error reporting. */ + const char *name, /* Name to use for bitmap. Must not already be + * defined as a bitmap. */ + const void *source, /* Address of bits for bitmap. */ + int width, /* Width of bitmap. */ + int height) /* Height of bitmap. */ +{ int isNew; Tcl_HashEntry *predefHashPtr; TkPredefBitmap *predefPtr; @@ -795,12 +807,22 @@ DupBitmapObjProc( /* ARGSUSED */ Pixmap -Tk_GetBitmapFromData( +Tk_OldGetBitmapFromData( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which bitmap will be used. */ const char *source, /* Bitmap data for bitmap shape. */ int width, int height) /* Dimensions of bitmap. */ { + return Tk_GetBitmapFromData(interp, tkwin, source, width, height); +} + +Pixmap +Tk_GetBitmapFromData( + Tcl_Interp *interp, /* Interpreter to use for error reporting. */ + Tk_Window tkwin, /* Window in which bitmap will be used. */ + const void *source, /* Bitmap data for bitmap shape. */ + int width, int height) /* Dimensions of bitmap. */ +{ DataKey nameKey; Tcl_HashEntry *dataHashPtr; int isNew; @@ -1012,25 +1034,25 @@ BitmapInit( dummy = Tcl_CreateInterp(); Tcl_InitHashTable(&tsdPtr->predefBitmapTable, TCL_STRING_KEYS); - Tk_DefineBitmap(dummy, "error", (char *) error_bits, + Tk_DefineBitmap(dummy, "error", error_bits, error_width, error_height); - Tk_DefineBitmap(dummy, "gray75", (char *) gray75_bits, + Tk_DefineBitmap(dummy, "gray75", gray75_bits, gray75_width, gray75_height); - Tk_DefineBitmap(dummy, "gray50", (char *) gray50_bits, + Tk_DefineBitmap(dummy, "gray50", gray50_bits, gray50_width, gray50_height); - Tk_DefineBitmap(dummy, "gray25", (char *) gray25_bits, + Tk_DefineBitmap(dummy, "gray25", gray25_bits, gray25_width, gray25_height); - Tk_DefineBitmap(dummy, "gray12", (char *) gray12_bits, + Tk_DefineBitmap(dummy, "gray12", gray12_bits, gray12_width, gray12_height); - Tk_DefineBitmap(dummy, "hourglass", (char *) hourglass_bits, + Tk_DefineBitmap(dummy, "hourglass", hourglass_bits, hourglass_width, hourglass_height); - Tk_DefineBitmap(dummy, "info", (char *) info_bits, + Tk_DefineBitmap(dummy, "info", info_bits, info_width, info_height); - Tk_DefineBitmap(dummy, "questhead", (char *) questhead_bits, + Tk_DefineBitmap(dummy, "questhead", questhead_bits, questhead_width, questhead_height); - Tk_DefineBitmap(dummy, "question", (char *) question_bits, + Tk_DefineBitmap(dummy, "question", question_bits, question_width, question_height); - Tk_DefineBitmap(dummy, "warning", (char *) warning_bits, + Tk_DefineBitmap(dummy, "warning", warning_bits, warning_width, warning_height); TkpDefineNativeBitmaps(); diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 562de77..c915db0 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkDecls.h,v 1.41 2009/01/02 23:20:32 nijtmans Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.42 2009/02/27 23:23:36 nijtmans Exp $ */ #ifndef _TKDECLS @@ -318,10 +318,10 @@ EXTERN Tk_Window Tk_CreateWindowFromPath (Tcl_Interp * interp, Tk_Window tkwin, const char * pathName, const char * screenName); #endif -#ifndef Tk_DefineBitmap_TCL_DECLARED -#define Tk_DefineBitmap_TCL_DECLARED +#ifndef Tk_OldDefineBitmap_TCL_DECLARED +#define Tk_OldDefineBitmap_TCL_DECLARED /* 44 */ -EXTERN int Tk_DefineBitmap (Tcl_Interp * interp, +EXTERN int Tk_OldDefineBitmap (Tcl_Interp * interp, const char * name, const char * source, int width, int height); #endif @@ -569,10 +569,10 @@ EXTERN CONST84_RETURN char * Tk_GetBinding (Tcl_Interp * interp, EXTERN Pixmap Tk_GetBitmap (Tcl_Interp * interp, Tk_Window tkwin, const char * str); #endif -#ifndef Tk_GetBitmapFromData_TCL_DECLARED -#define Tk_GetBitmapFromData_TCL_DECLARED +#ifndef Tk_OldGetBitmapFromData_TCL_DECLARED +#define Tk_OldGetBitmapFromData_TCL_DECLARED /* 86 */ -EXTERN Pixmap Tk_GetBitmapFromData (Tcl_Interp * interp, +EXTERN Pixmap Tk_OldGetBitmapFromData (Tcl_Interp * interp, Tk_Window tkwin, const char * source, int width, int height); #endif @@ -1694,6 +1694,20 @@ EXTERN void Tk_CreateOldImageType (const Tk_ImageType * typePtr); EXTERN void Tk_CreateOldPhotoImageFormat ( const Tk_PhotoImageFormat * formatPtr); #endif +#ifndef Tk_DefineBitmap_TCL_DECLARED +#define Tk_DefineBitmap_TCL_DECLARED +/* 274 */ +EXTERN int Tk_DefineBitmap (Tcl_Interp * interp, + const char * name, const void * source, + int width, int height); +#endif +#ifndef Tk_GetBitmapFromData_TCL_DECLARED +#define Tk_GetBitmapFromData_TCL_DECLARED +/* 275 */ +EXTERN Pixmap Tk_GetBitmapFromData (Tcl_Interp * interp, + Tk_Window tkwin, const void * source, + int width, int height); +#endif typedef struct TkStubHooks { const struct TkPlatStubs *tkPlatStubs; @@ -1750,7 +1764,7 @@ typedef struct TkStubs { void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc * proc, ClientData clientData, Atom format); /* 41 */ Tk_Window (*tk_CreateWindow) (Tcl_Interp * interp, Tk_Window parent, const char * name, const char * screenName); /* 42 */ Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp * interp, Tk_Window tkwin, const char * pathName, const char * screenName); /* 43 */ - int (*tk_DefineBitmap) (Tcl_Interp * interp, const char * name, const char * source, int width, int height); /* 44 */ + int (*tk_OldDefineBitmap) (Tcl_Interp * interp, const char * name, const char * source, int width, int height); /* 44 */ void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */ void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */ int (*tk_DeleteBinding) (Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, const char * eventStr); /* 47 */ @@ -1792,7 +1806,7 @@ typedef struct TkStubs { CONST84_RETURN char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */ CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, const char * eventStr); /* 84 */ Pixmap (*tk_GetBitmap) (Tcl_Interp * interp, Tk_Window tkwin, const char * str); /* 85 */ - Pixmap (*tk_GetBitmapFromData) (Tcl_Interp * interp, Tk_Window tkwin, const char * source, int width, int height); /* 86 */ + Pixmap (*tk_OldGetBitmapFromData) (Tcl_Interp * interp, Tk_Window tkwin, const char * source, int width, int height); /* 86 */ int (*tk_GetCapStyle) (Tcl_Interp * interp, const char * str, int * capPtr); /* 87 */ XColor * (*tk_GetColor) (Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid name); /* 88 */ XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor * colorPtr); /* 89 */ @@ -1980,6 +1994,8 @@ typedef struct TkStubs { Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (const Tk_ImageType * typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat * formatPtr); /* 273 */ + int (*tk_DefineBitmap) (Tcl_Interp * interp, const char * name, const void * source, int width, int height); /* 274 */ + Pixmap (*tk_GetBitmapFromData) (Tcl_Interp * interp, Tk_Window tkwin, const void * source, int width, int height); /* 275 */ } TkStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) @@ -2168,9 +2184,9 @@ extern const TkStubs *tkStubsPtr; #define Tk_CreateWindowFromPath \ (tkStubsPtr->tk_CreateWindowFromPath) /* 43 */ #endif -#ifndef Tk_DefineBitmap -#define Tk_DefineBitmap \ - (tkStubsPtr->tk_DefineBitmap) /* 44 */ +#ifndef Tk_OldDefineBitmap +#define Tk_OldDefineBitmap \ + (tkStubsPtr->tk_OldDefineBitmap) /* 44 */ #endif #ifndef Tk_DefineCursor #define Tk_DefineCursor \ @@ -2336,9 +2352,9 @@ extern const TkStubs *tkStubsPtr; #define Tk_GetBitmap \ (tkStubsPtr->tk_GetBitmap) /* 85 */ #endif -#ifndef Tk_GetBitmapFromData -#define Tk_GetBitmapFromData \ - (tkStubsPtr->tk_GetBitmapFromData) /* 86 */ +#ifndef Tk_OldGetBitmapFromData +#define Tk_OldGetBitmapFromData \ + (tkStubsPtr->tk_OldGetBitmapFromData) /* 86 */ #endif #ifndef Tk_GetCapStyle #define Tk_GetCapStyle \ @@ -3082,6 +3098,14 @@ extern const TkStubs *tkStubsPtr; #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ #endif +#ifndef Tk_DefineBitmap +#define Tk_DefineBitmap \ + (tkStubsPtr->tk_DefineBitmap) /* 274 */ +#endif +#ifndef Tk_GetBitmapFromData +#define Tk_GetBitmapFromData \ + (tkStubsPtr->tk_GetBitmapFromData) /* 275 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ diff --git a/generic/tkInt.decls b/generic/tkInt.decls index c1b501d..349c01e 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tkInt.decls,v 1.52 2009/01/09 07:03:31 nijtmans Exp $ +# RCS: @(#) $Id: tkInt.decls,v 1.53 2009/02/27 23:23:35 nijtmans Exp $ library tk @@ -427,7 +427,7 @@ declare 119 {aqua win} { TkRegion src, TkRegion dr_return) } declare 121 aqua { - Pixmap TkpCreateNativeBitmap(Display *display, const char *source) + Pixmap TkpCreateNativeBitmap(Display *display, const void *source) } declare 122 aqua { void TkpDefineNativeBitmaps(void) @@ -741,7 +741,7 @@ declare 0 aqua { # removed duplicates from tkInt table #declare 1 aqua { -# Pixmap TkpCreateNativeBitmap(Display *display, const char *source) +# Pixmap TkpCreateNativeBitmap(Display *display, const void *source) #} # #declare 2 aqua { diff --git a/generic/tkInt.h b/generic/tkInt.h index 41ba794..fd58d46 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: $Id: tkInt.h,v 1.99 2008/12/28 13:08:39 dkf Exp $ + * RCS: $Id: tkInt.h,v 1.100 2009/02/27 23:23:35 nijtmans Exp $ */ #ifndef _TKINT @@ -681,7 +681,7 @@ typedef struct TkMainInfo { */ typedef struct { - const char *source; /* Bits for bitmap. */ + const void *source; /* Bits for bitmap. */ int width, height; /* Dimensions of bitmap. */ int native; /* 0 means generic (X style) bitmap, 1 means * native style bitmap. */ diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index da16c96..5ea6684 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.42 2009/01/09 07:03:30 nijtmans Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.43 2009/02/27 23:23:35 nijtmans Exp $ */ #ifndef _TKINTDECLS @@ -794,7 +794,7 @@ EXTERN void TkUnionRectWithRegion (XRectangle * rect, #define TkpCreateNativeBitmap_TCL_DECLARED /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap (Display * display, - const char * source); + const void * source); #endif #endif /* AQUA */ #ifdef MAC_OSX_TK /* AQUA */ @@ -1237,7 +1237,7 @@ typedef struct TkIntStubs { #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void *reserved121; /* Dummy entry for stubs table backwards compatibility */ - Pixmap (*tkpCreateNativeBitmap) (Display * display, const char * source); /* 121 */ + Pixmap (*tkpCreateNativeBitmap) (Display * display, const void * source); /* 121 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void *reserved122; diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index d202a6f..c8d93fd 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.66 2008/12/04 21:33:25 nijtmans Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.67 2009/02/27 23:23:36 nijtmans Exp $ */ #include "tkInt.h" @@ -725,7 +725,7 @@ static const TkStubs tkStubs = { Tk_CreateSelHandler, /* 41 */ Tk_CreateWindow, /* 42 */ Tk_CreateWindowFromPath, /* 43 */ - Tk_DefineBitmap, /* 44 */ + Tk_OldDefineBitmap, /* 44 */ Tk_DefineCursor, /* 45 */ Tk_DeleteAllBindings, /* 46 */ Tk_DeleteBinding, /* 47 */ @@ -767,7 +767,7 @@ static const TkStubs tkStubs = { Tk_GetAtomName, /* 83 */ Tk_GetBinding, /* 84 */ Tk_GetBitmap, /* 85 */ - Tk_GetBitmapFromData, /* 86 */ + Tk_OldGetBitmapFromData, /* 86 */ Tk_GetCapStyle, /* 87 */ Tk_GetColor, /* 88 */ Tk_GetColorByValue, /* 89 */ @@ -955,6 +955,8 @@ static const TkStubs tkStubs = { Tk_Interp, /* 271 */ Tk_CreateOldImageType, /* 272 */ Tk_CreateOldPhotoImageFormat, /* 273 */ + Tk_DefineBitmap, /* 274 */ + Tk_GetBitmapFromData, /* 275 */ }; /* !END!: Do not edit above this line. */ diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 74dadbd..82771d4 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.8 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.9 2009/02/27 23:23:36 nijtmans Exp $ */ #include "tkMacOSXInt.h" @@ -107,7 +107,7 @@ TkpDefineNativeBitmaps(void) nativeIconPtr->id = builtInPtr->id; nativeIconPtr->type = builtInPtr->type; - predefPtr->source = (char *) nativeIconPtr; + predefPtr->source = nativeIconPtr; predefPtr->width = builtInPtr->size; predefPtr->height = builtInPtr->size; predefPtr->native = 1; @@ -137,7 +137,7 @@ TkpDefineNativeBitmaps(void) Pixmap TkpCreateNativeBitmap( Display *display, - const char *source) /* Info about the icon to build. */ + const void *source) /* Info about the icon to build. */ { Pixmap pix; Rect destRect; |