Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | * generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of type hackery to allow numbers to be interpreted as coordinates (most notably on a canvas) without reinterpreting via a string. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
87ccf454d13f46e786e46722869996bc |
User & Date: | dkf 2011-11-01 22:48:47 |
Context
2011-11-01
| ||
22:57 | Minor: Capitalization/formatting in changelog. check-in: 3e78af60 user: dkf tags: trunk | |
22:48 |
* generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of type hackery to allow numbers to be interpreted as coordinates (most notably on a canvas) without reinterpreting via a string.check-in: 87ccf454 user: dkf tags: trunk | |
22:46 |
* generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of type hackery to allow numbers to be interpreted as coordinates (most notably on a canvas) without reinterpreting via a string.check-in: 6a735cbb user: dkf tags: core-8-5-branch | |
2011-10-31
| ||
14:08 | TIP 382 test suite update and Motif dialog implementation. check-in: 027bebf1 user: dgp tags: trunk | |
Changes
Changes to ChangeLog.
1 2 3 4 5 6 7 | 2011-10-27 Kevin B. Kenny <[email protected]> * generic/tkInt.h: [Bug 3410609]: Change the event mechanism * unix/tkUnixEvent.c: for <KeyPress> events to use the keysym * unix/tkUnixKey.c: returned by XLookupString in preference to the one that appears in the raw X event at any level. This change allows binding to ISO_Level3_Shift-ed characters, composed characters, | > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | 2011-11-01 Donal K. Fellows <[email protected]> * generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of type hackery to allow numbers to be interpreted as coordinates (most notably on a canvas) without reinterpreting via a string. 2011-10-27 Kevin B. Kenny <[email protected]> * generic/tkInt.h: [Bug 3410609]: Change the event mechanism * unix/tkUnixEvent.c: for <KeyPress> events to use the keysym * unix/tkUnixKey.c: returned by XLookupString in preference to the one that appears in the raw X event at any level. This change allows binding to ISO_Level3_Shift-ed characters, composed characters, |
︙ | ︙ |
Changes to generic/tkObj.c.
︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #define SET_COMPLEXPIXEL(objPtr, repPtr) \ (objPtr)->internalRep.twoPtrValue.ptr1 = 0; \ (objPtr)->internalRep.twoPtrValue.ptr2 = repPtr #define GET_COMPLEXPIXEL(objPtr) \ ((PixelRep *) (objPtr)->internalRep.twoPtrValue.ptr2) /* * The following structure is the internal representation for mm objects. */ typedef struct MMRep { double value; | > > > > > > > > > > > > > | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #define SET_COMPLEXPIXEL(objPtr, repPtr) \ (objPtr)->internalRep.twoPtrValue.ptr1 = 0; \ (objPtr)->internalRep.twoPtrValue.ptr2 = repPtr #define GET_COMPLEXPIXEL(objPtr) \ ((PixelRep *) (objPtr)->internalRep.twoPtrValue.ptr2) /* * One of these structures is created per thread to store thread-specific * data. In this case, it is used to contain references to selected * Tcl_ObjTypes that we can use as screen distances without conversion. The * "dataKey" below is used to locate the ThreadSpecificData for the current * thread. */ typedef struct ThreadSpecificData { Tcl_ObjType *doubleTypePtr; Tcl_ObjType *intTypePtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following structure is the internal representation for mm objects. */ typedef struct MMRep { double value; |
︙ | ︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | { int result,fresh; double d; PixelRep *pixelPtr; static const double bias[] = { 1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/ }; retry: if (objPtr->typePtr != &pixelObjType) { result = SetPixelFromAny(interp, objPtr); if (result != TCL_OK) { return result; } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | { int result,fresh; double d; PixelRep *pixelPtr; static const double bias[] = { 1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/ }; /* * Special hacks where the type of the object is known to be something * that is just numeric and cannot require distance conversion. This pokes * holes in Tcl's abstractions, but they are just for optimization, not * semantics. */ if (objPtr->typePtr != &pixelObjType) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->doubleTypePtr == NULL) { tsdPtr->doubleTypePtr = Tcl_GetObjType("double"); tsdPtr->intTypePtr = Tcl_GetObjType("int"); } if (objPtr->typePtr == tsdPtr->doubleTypePtr) { (void) Tcl_GetDoubleFromObj(interp, objPtr, &d); if (dblPtr != NULL) { *dblPtr = d; } *intPtr = (int) d; return TCL_OK; } else if (objPtr->typePtr == tsdPtr->intTypePtr) { (void) Tcl_GetIntFromObj(interp, objPtr, intPtr); if (dblPtr) { *dblPtr = (double) (*intPtr); } return TCL_OK; } } retry: if (objPtr->typePtr != &pixelObjType) { result = SetPixelFromAny(interp, objPtr); if (result != TCL_OK) { return result; } |
︙ | ︙ | |||
267 268 269 270 271 272 273 | double d; int result,val; result=GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d); if (result != TCL_OK) { return result; } | | | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | double d; int result,val; result=GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d); if (result != TCL_OK) { return result; } if (objPtr->typePtr == &pixelObjType && !SIMPLE_PIXELREP(objPtr)) { PixelRep *pixelPtr; pixelPtr = GET_COMPLEXPIXEL(objPtr); if (pixelPtr->units >= 0) { /* internally "shimmer" to pixel units */ pixelPtr->units=-1; pixelPtr->value=d; } |
︙ | ︙ |