資源簡介
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?“l(fā)icense.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;
????/
評(píng)論
共有 條評(píng)論