diff options
author | jenglish <jenglish@flightlab.com> | 2009-02-08 19:35:35 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2009-02-08 19:35:35 (GMT) |
commit | a7f3e6b8652f5d9ea2c4db8a47c14033cb559466 (patch) | |
tree | b77850fad5f37f79d05730f2d09bec514b78f07c /generic/ttk/ttkTrack.c | |
parent | 76e883da5646c90946512d237df48377778d63cc (diff) | |
download | tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.zip tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.gz tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.bz2 |
Renamed several internal data structures and functions:
ElementImpl -> ElementClass, LayoutNode -> Element.
Remove more unnecessary casts.
Add function Ttk_ClientRegion, common factor
of entry, scale, progress, and treeview widgets.
Diffstat (limited to 'generic/ttk/ttkTrack.c')
-rw-r--r-- | generic/ttk/ttkTrack.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/generic/ttk/ttkTrack.c b/generic/ttk/ttkTrack.c index d6e89fa..42144d8 100644 --- a/generic/ttk/ttkTrack.c +++ b/generic/ttk/ttkTrack.c @@ -1,4 +1,4 @@ -/* $Id: ttkTrack.c,v 1.4 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkTrack.c,v 1.5 2009/02/08 19:35:35 jenglish Exp $ * Copyright (c) 2004, Joe English * * TtkTrackElementState() -- helper routine for widgets @@ -30,8 +30,8 @@ typedef struct { WidgetCore *corePtr; /* Widget to track */ - Ttk_LayoutNode *activeElement; /* element under the mouse cursor */ - Ttk_LayoutNode *pressedElement; /* currently pressed element */ + Ttk_Element activeElement; /* element under the mouse cursor */ + Ttk_Element pressedElement; /* currently pressed element */ } ElementStateTracker; /* @@ -42,9 +42,9 @@ typedef struct * The active element has TTK_STATE_ACTIVE set _unless_ * another element is 'pressed' */ -static void ActivateElement(ElementStateTracker *es, Ttk_LayoutNode *node) +static void ActivateElement(ElementStateTracker *es, Ttk_Element element) { - if (es->activeElement == node) { + if (es->activeElement == element) { /* No change */ return; } @@ -54,14 +54,14 @@ static void ActivateElement(ElementStateTracker *es, Ttk_LayoutNode *node) /* Deactivate old element */ Ttk_ChangeElementState(es->activeElement, 0,TTK_STATE_ACTIVE); } - if (node) { + if (element) { /* Activate new element */ - Ttk_ChangeElementState(node, TTK_STATE_ACTIVE,0); + Ttk_ChangeElementState(element, TTK_STATE_ACTIVE,0); } TtkRedisplayWidget(es->corePtr); } - es->activeElement = node; + es->activeElement = element; } /* ReleaseElement -- @@ -87,18 +87,18 @@ static void ReleaseElement(ElementStateTracker *es) /* PressElement -- * Presses the specified element. */ -static void PressElement(ElementStateTracker *es, Ttk_LayoutNode *node) +static void PressElement(ElementStateTracker *es, Ttk_Element element) { if (es->pressedElement) { ReleaseElement(es); } - if (node) { + if (element) { Ttk_ChangeElementState( - node, TTK_STATE_PRESSED|TTK_STATE_ACTIVE, 0); + element, TTK_STATE_PRESSED|TTK_STATE_ACTIVE, 0); } - es->pressedElement = node; + es->pressedElement = element; TtkRedisplayWidget(es->corePtr); } @@ -119,14 +119,14 @@ static void ElementStateEventProc(ClientData clientData, XEvent *ev) { ElementStateTracker *es = (ElementStateTracker *)clientData; - Ttk_LayoutNode *node; + Ttk_Element element; switch (ev->type) { case MotionNotify : - node = Ttk_LayoutIdentify( + element = Ttk_IdentifyElement( es->corePtr->layout,ev->xmotion.x,ev->xmotion.y); - ActivateElement(es, node); + ActivateElement(es, element); break; case LeaveNotify: ActivateElement(es, 0); @@ -134,15 +134,15 @@ ElementStateEventProc(ClientData clientData, XEvent *ev) PressElement(es, 0); break; case EnterNotify: - node = Ttk_LayoutIdentify( + element = Ttk_IdentifyElement( es->corePtr->layout,ev->xcrossing.x,ev->xcrossing.y); - ActivateElement(es, node); + ActivateElement(es, element); break; case ButtonPress: - node = Ttk_LayoutIdentify( + element = Ttk_IdentifyElement( es->corePtr->layout, ev->xbutton.x, ev->xbutton.y); - if (node) - PressElement(es, node); + if (element) + PressElement(es, element); break; case ButtonRelease: ReleaseElement(es); |