summaryrefslogtreecommitdiffstats
path: root/generic/tkMenuDraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkMenuDraw.c')
-rw-r--r--generic/tkMenuDraw.c67
1 files changed, 35 insertions, 32 deletions
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index 1ac4558..62ab105 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -4,7 +4,7 @@
* This module implements the platform-independent drawing and geometry
* calculations of menu widgets.
*
- * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 1996-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.
@@ -19,8 +19,8 @@
static void AdjustMenuCoords(TkMenu *menuPtr, TkMenuEntry *mePtr,
int *xPtr, int *yPtr);
-static void ComputeMenuGeometry(ClientData clientData);
-static void DisplayMenu(ClientData clientData);
+static void ComputeMenuGeometry(void *clientData);
+static void DisplayMenu(void *clientData);
/*
*----------------------------------------------------------------------
@@ -298,7 +298,7 @@ TkMenuConfigureDrawOptions(
int
TkMenuConfigureEntryDrawOptions(
TkMenuEntry *mePtr,
- int index)
+ Tcl_Size index)
{
XGCValues gcValues;
GC newGC, newActiveGC, newDisabledGC, newIndicatorGC;
@@ -315,7 +315,7 @@ TkMenuConfigureEntryDrawOptions(
}
} else {
if (index == menuPtr->active) {
- TkActivateMenuEntry(menuPtr, -1);
+ TkActivateMenuEntry(menuPtr, TCL_INDEX_NONE);
}
}
@@ -487,7 +487,7 @@ TkEventuallyRedrawMenu(
TkMenuEntry *mePtr)/* Entry to redraw. NULL means redraw all the
* entries in the menu. */
{
- int i;
+ Tcl_Size i;
if (menuPtr->tkwin == NULL) {
return;
@@ -528,9 +528,9 @@ TkEventuallyRedrawMenu(
static void
ComputeMenuGeometry(
- ClientData clientData) /* Structure describing menu. */
+ void *clientData) /* Structure describing menu. */
{
- TkMenu *menuPtr = clientData;
+ TkMenu *menuPtr = (TkMenu *)clientData;
if (menuPtr->tkwin == NULL) {
return;
@@ -579,14 +579,15 @@ ComputeMenuGeometry(
void
TkMenuSelectImageProc(
- ClientData clientData, /* Pointer to widget record. */
- int x, int y, /* Upper left pixel (within image) that must
- * be redisplayed. */
- int width, int height, /* Dimensions of area to redisplay (may be
- * <=0). */
- int imgWidth, int imgHeight)/* New dimensions of image. */
+ void *clientData, /* Pointer to widget record. */
+ TCL_UNUSED(int), /* Upper left pixel (within image) that must */
+ TCL_UNUSED(int), /* be redisplayed. */
+ TCL_UNUSED(int), /* Dimensions of area to redisplay (may be */
+ TCL_UNUSED(int), /* <= 0). */
+ TCL_UNUSED(int),
+ TCL_UNUSED(int))/* New dimensions of image. */
{
- TkMenuEntry *mePtr = clientData;
+ TkMenuEntry *mePtr = (TkMenuEntry *)clientData;
if ((mePtr->entryFlags & ENTRY_SELECTED)
&& !(mePtr->menuPtr->menuFlags & REDRAW_PENDING)) {
@@ -613,12 +614,13 @@ TkMenuSelectImageProc(
static void
DisplayMenu(
- ClientData clientData) /* Information about widget. */
+ void *clientData) /* Information about widget. */
{
- TkMenu *menuPtr = clientData;
+ TkMenu *menuPtr = (TkMenu *)clientData;
TkMenuEntry *mePtr;
Tk_Window tkwin = menuPtr->tkwin;
- int index, strictMotif;
+ Tcl_Size index;
+ int strictMotif;
Tk_Font tkfont;
Tk_FontMetrics menuMetrics;
int width;
@@ -756,10 +758,10 @@ DisplayMenu(
void
TkMenuEventProc(
- ClientData clientData, /* Information about window. */
+ void *clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkMenu *menuPtr = clientData;
+ TkMenu *menuPtr = (TkMenu *)clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
TkEventuallyRedrawMenu(menuPtr, NULL);
@@ -768,7 +770,7 @@ TkMenuEventProc(
TkEventuallyRedrawMenu(menuPtr, NULL);
} else if (eventPtr->type == ActivateNotify) {
if (menuPtr->menuType == TEAROFF_MENU) {
- TkpSetMainMenubar(menuPtr->interp, menuPtr->tkwin, NULL);
+ Tk_SetMainMenubar(menuPtr->interp, menuPtr->tkwin, NULL);
}
} else if (eventPtr->type == DestroyNotify) {
if (menuPtr->tkwin != NULL) {
@@ -817,14 +819,15 @@ TkMenuEventProc(
void
TkMenuImageProc(
- ClientData clientData, /* Pointer to widget record. */
- int x, int y, /* Upper left pixel (within image) that must
- * be redisplayed. */
- int width, int height, /* Dimensions of area to redisplay (may be
- * <=0). */
- int imgWidth, int imgHeight)/* New dimensions of image. */
+ void *clientData,/* Pointer to widget record. */
+ TCL_UNUSED(int), /* Upper left pixel (within image) that must */
+ TCL_UNUSED(int), /* * be redisplayed. */
+ TCL_UNUSED(int), /* Dimensions of area to redisplay (may be */
+ TCL_UNUSED(int), /* <=0). */
+ TCL_UNUSED(int), /* New dimensions of image. */
+ TCL_UNUSED(int))
{
- TkMenu *menuPtr = ((TkMenuEntry *) clientData)->menuPtr;
+ TkMenu *menuPtr = (TkMenu *)((TkMenuEntry *) clientData)->menuPtr;
if ((menuPtr->tkwin != NULL) && !(menuPtr->menuFlags & RESIZE_PENDING)) {
menuPtr->menuFlags |= RESIZE_PENDING;
@@ -911,7 +914,7 @@ TkPostSubmenu(
*/
subary[0] = menuPtr->postedCascade->namePtr;
- subary[1] = Tcl_NewStringObj("unpost", -1);
+ subary[1] = Tcl_NewStringObj("unpost", TCL_INDEX_NONE);
Tcl_IncrRefCount(subary[1]);
TkEventuallyRedrawMenu(menuPtr, NULL);
result = Tcl_EvalObjv(interp, 2, subary, 0);
@@ -940,9 +943,9 @@ TkPostSubmenu(
menuPtr->postedCascade = mePtr;
subary[0] = mePtr->namePtr;
- subary[1] = Tcl_NewStringObj("post", -1);
- subary[2] = Tcl_NewIntObj(x);
- subary[3] = Tcl_NewIntObj(y);
+ subary[1] = Tcl_NewStringObj("post", TCL_INDEX_NONE);
+ subary[2] = Tcl_NewWideIntObj(x);
+ subary[3] = Tcl_NewWideIntObj(y);
Tcl_IncrRefCount(subary[1]);
Tcl_IncrRefCount(subary[2]);
Tcl_IncrRefCount(subary[3]);