summaryrefslogtreecommitdiffstats
path: root/doc/SplitList.3
Commit message (Expand)AuthorAgeFilesLines
* The final parts of my doc improvement projectdkf2011-07-181-2/+2
* Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
* | | Formatting cleanup.dkf2008-12-181-2/+4
* | | Improve clarity of formatting.dkf2008-10-171-2/+2
* | | Lots of very minor formatting fixes.dkf2008-10-151-1/+4
* | | Prepare Tcl's docs for life as 8.6 (remove out of date change bars, fixdkf2008-06-291-5/+1
|/ /
* | merge stable branch onto HEADdgp2007-12-131-1/+1
* | First stage of doing GOOBE improvements to documentation now that the html ge...dkf2007-10-281-3/+5
* | * changes: Updated for 8.5b2 release.core_8_5_b2dgp2007-10-261-4/+2
* | Lots of improvements to look and feel of manual pagesdkf2007-10-241-2/+4
* | Convert CONST to const, VOID to void so we document how we want the API used.dkf2004-10-071-5/+5
* | Update the .AS macro definition and take advantage of it's new-found power.dkf2004-10-071-2/+2
* | * doc/SplitList.3: Implementation of TIP 148. Fixes [Bug 489537].dgp2003-09-041-1/+13
|/
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-4/+4
* * Updated APIs indgp2001-09-241-3/+3
* doc/AddErrInfo.3, doc/ChnlStack.3, doc/Exit.3, doc/GetIndex.3, doc/Notifier.3,jenglish2000-07-241-2/+2
* * doc/AppInit.3:hobbs2000-04-141-19/+3
* Replaced SCCS strings, fixed binary filescore_8_0_3stanton1998-09-141-1/+1
* Initial revisionrjohnson1998-03-261-0/+191
opt">.stipple = valuePtr->stipple; } else { valueKey.values.stipple = None; } if (valueMask & GCTileStipXOrigin) { valueKey.values.ts_x_origin = valuePtr->ts_x_origin; } else { valueKey.values.ts_x_origin = 0; } if (valueMask & GCTileStipYOrigin) { valueKey.values.ts_y_origin = valuePtr->ts_y_origin; } else { valueKey.values.ts_y_origin = 0; } if (valueMask & GCFont) { valueKey.values.font = valuePtr->font; } else { valueKey.values.font = None; } if (valueMask & GCSubwindowMode) { valueKey.values.subwindow_mode = valuePtr->subwindow_mode; } else { valueKey.values.subwindow_mode = ClipByChildren; } if (valueMask & GCGraphicsExposures) { valueKey.values.graphics_exposures = valuePtr->graphics_exposures; } else { valueKey.values.graphics_exposures = True; } if (valueMask & GCClipXOrigin) { valueKey.values.clip_x_origin = valuePtr->clip_x_origin; } else { valueKey.values.clip_x_origin = 0; } if (valueMask & GCClipYOrigin) { valueKey.values.clip_y_origin = valuePtr->clip_y_origin; } else { valueKey.values.clip_y_origin = 0; } if (valueMask & GCClipMask) { valueKey.values.clip_mask = valuePtr->clip_mask; } else { valueKey.values.clip_mask = None; } if (valueMask & GCDashOffset) { valueKey.values.dash_offset = valuePtr->dash_offset; } else { valueKey.values.dash_offset = 0; } if (valueMask & GCDashList) { valueKey.values.dashes = valuePtr->dashes; } else { valueKey.values.dashes = 4; } valueKey.display = Tk_Display(tkwin); valueKey.screenNum = Tk_ScreenNumber(tkwin); valueKey.depth = Tk_Depth(tkwin); valueHashPtr = Tcl_CreateHashEntry(&dispPtr->gcValueTable, (char *) &valueKey, &isNew); if (!isNew) { gcPtr = (TkGC *) Tcl_GetHashValue(valueHashPtr); gcPtr->refCount++; return gcPtr->gc; } /* * No GC is currently available for this set of values. Allocate a new GC * and add a new structure to the database. */ gcPtr = (TkGC *) ckalloc(sizeof(TkGC)); /* * Find or make a drawable to use to specify the screen and depth of the * GC. We may have to make a small pixmap, to avoid doing * Tk_MakeWindowExist on the window. */ freeDrawable = None; if (Tk_WindowId(tkwin) != None) { d = Tk_WindowId(tkwin); } else if (valueKey.depth == DefaultDepth(valueKey.display, valueKey.screenNum)) { d = RootWindow(valueKey.display, valueKey.screenNum); } else { d = Tk_GetPixmap(valueKey.display, RootWindow(valueKey.display, valueKey.screenNum), 1, 1, valueKey.depth); freeDrawable = d; } gcPtr->gc = XCreateGC(valueKey.display, d, valueMask, &valueKey.values); gcPtr->display = valueKey.display; gcPtr->refCount = 1; gcPtr->valueHashPtr = valueHashPtr; idHashPtr = Tcl_CreateHashEntry(&dispPtr->gcIdTable, (char *) gcPtr->gc, &isNew); if (!isNew) { Tcl_Panic("GC already registered in Tk_GetGC"); } Tcl_SetHashValue(valueHashPtr, gcPtr); Tcl_SetHashValue(idHashPtr, gcPtr); if (freeDrawable != None) { Tk_FreePixmap(valueKey.display, freeDrawable); } return gcPtr->gc; } /* *---------------------------------------------------------------------- * * Tk_FreeGC -- * * This function is called to release a graphics context allocated by * Tk_GetGC. * * Results: * None. * * Side effects: * The reference count associated with gc is decremented, and gc is * officially deallocated if no-one is using it anymore. * *---------------------------------------------------------------------- */ void Tk_FreeGC( Display *display, /* Display for which gc was allocated. */ GC gc) /* Graphics context to be released. */ { Tcl_HashEntry *idHashPtr; register TkGC *gcPtr; TkDisplay *dispPtr = TkGetDisplay(display); if (!dispPtr->gcInit) { Tcl_Panic("Tk_FreeGC called before Tk_GetGC"); } if (dispPtr->gcInit < 0) { /* * The GCCleanup has been called, and remaining GCs have been freed. * This may still get called by other things shutting down, but the * GCs should no longer be in use. */ return; } idHashPtr = Tcl_FindHashEntry(&dispPtr->gcIdTable, (char *) gc); if (idHashPtr == NULL) { Tcl_Panic("Tk_FreeGC received unknown gc argument"); } gcPtr = (TkGC *) Tcl_GetHashValue(idHashPtr); gcPtr->refCount--; if (gcPtr->refCount == 0) { Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc)); XFreeGC(gcPtr->display, gcPtr->gc); Tcl_DeleteHashEntry(gcPtr->valueHashPtr); Tcl_DeleteHashEntry(idHashPtr); ckfree((char *) gcPtr); } } /* *---------------------------------------------------------------------- * * TkGCCleanup -- * * Frees the structures used for GC management. We need to have it called * near the end, when other cleanup that calls Tk_FreeGC is all done. * * Results: * None. * * Side effects: * GC resources are freed. * *---------------------------------------------------------------------- */ void TkGCCleanup( TkDisplay *dispPtr) /* display to clean up resources in */ { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; TkGC *gcPtr; for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) { gcPtr = (TkGC *) Tcl_GetHashValue(entryPtr); /* * This call is not needed, as it is only used on Unix to restore the * Id to the stack pool, and we don't want to use them anymore. * Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc)); */ XFreeGC(gcPtr->display, gcPtr->gc); Tcl_DeleteHashEntry(gcPtr->valueHashPtr); Tcl_DeleteHashEntry(entryPtr); ckfree((char *) gcPtr); } Tcl_DeleteHashTable(&dispPtr->gcValueTable); Tcl_DeleteHashTable(&dispPtr->gcIdTable); dispPtr->gcInit = -1; } /* *---------------------------------------------------------------------- * * GCInit -- * * Initialize the structures used for GC management. * * Results: * None. * * Side effects: * Read the code. * *---------------------------------------------------------------------- */ static void GCInit( TkDisplay *dispPtr) { if (dispPtr->gcInit < 0) { Tcl_Panic("called GCInit after GCCleanup"); } dispPtr->gcInit = 1; Tcl_InitHashTable(&dispPtr->gcValueTable, sizeof(ValueKey)/sizeof(int)); Tcl_InitHashTable(&dispPtr->gcIdTable, TCL_ONE_WORD_KEYS); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */