tk8.6.8-src.tar.gz
tk8.6.8-src.tar.gz
tk8.6.8-src.tar.gz
tk8.6.8-src.tar.gz
tk8.6.8-src.tar.gz
tk8.6.8-src.tar.gz
代码片段和文件信息
/*
* tk3d.c --
*
* This module provides procedures to draw borders in the
* three-dimensional Motif style.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems Inc.
*
* See the file “license.terms“ for information on usage and redistribution of
* this file and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include “tkInt.h“
#include “tk3d.h“
/*
* The following table defines the string values for reliefs which are used
* by Tk_GetReliefFromObj.
*/
static const char *const reliefStrings[] = {
“flat“ “groove“ “raised“ “ridge“ “solid“ “sunken“ NULL
};
/*
* Forward declarations for functions defined in this file:
*/
static void BorderInit(TkDisplay *dispPtr);
static void DupBorderObjProc(Tcl_Obj *srcObjPtr
Tcl_Obj *dupObjPtr);
static void FreeBorderObj(Tcl_Obj *objPtr);
static void FreeBorderObjProc(Tcl_Obj *objPtr);
static int Intersect(XPoint *a1Ptr XPoint *a2Ptr
XPoint *b1Ptr XPoint *b2Ptr XPoint *iPtr);
static void InitBorderObj(Tcl_Obj *objPtr);
static void ShiftLine(XPoint *p1Ptr XPoint *p2Ptr
int distance XPoint *p3Ptr);
/*
* The following structure defines the implementation of the “border“ Tcl
* object used for drawing. The border object remembers the hash table entry
* associated with a border. The actual allocation and deallocation of the
* border should be done by the configuration package when the border option
* is set.
*/
const Tcl_ObjType tkBorderObjType = {
“border“ /* name */
FreeBorderObjProc /* freeIntRepProc */
DupBorderObjProc /* dupIntRepProc */
NULL /* updateStringProc */
NULL /* setFromAnyProc */
};
/*
*----------------------------------------------------------------------
*
* Tk_Alloc3DBorderFromObj --
*
* Given a Tcl_Obj * map the value to a corresponding Tk_3DBorder
* structure based on the tkwin given.
*
* Results:
* The return value is a token for a data structure describing a 3-D
* border. This token may be passed to functions such as
* Tk_Draw3DRectangle and Tk_Free3DBorder. If an error prevented the
* border from being created then NULL is returned and an error message
* will be left in the interp‘s result.
*
* Side effects:
* The border is added to an internal database with a reference count.
* For each call to this function there should eventually be a call to
* FreeBorderObj so that the database is cleaned up when borders aren‘t
* in use anymore.
*
*----------------------------------------------------------------------
*/
Tk_3DBorder
Tk_Alloc3DBorderFromObj(
Tcl_Interp *interp /* Interp for error results. */
Tk_Window tkwin /* Need the screen the border is used on.*/
Tcl_Obj *objPtr) /* object giving name of color for window
* background. */
{
TkBorder *borderPtr;
if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr);
}
borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
/
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)