static void EventuallyPopupPieMenu _ANSI_ARGS_((PieMenu *menuPtr));
static void DeferPopupPieMenu _ANSI_ARGS_((PieMenu *menuPtr));
static void ShapePieMenu _ANSI_ARGS_((PieMenu *menuPtr));
+static void LayoutPieMenu(PieMenu *menu);
+static void UpdatePieMenuEntries(PieMenu *menuPtr);
+static int CalcPieMenuItem(PieMenu *menu, int x, int y);
\f
/*
*--------------------------------------------------------------
*/
-int
-Tk_PieMenuCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Main window associated with
+int
+Tk_PieMenuCmd (
+ ClientData clientData, /* Main window associated with
* interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ char **argv /* Argument strings. */
+)
{
Tk_Window tkwin = (Tk_Window) clientData;
Tk_Window new;
PointerMotionMask,
PieMenuEventProc, (ClientData) menuPtr);
Tcl_CreateCommand(interp, Tk_PathName(menuPtr->tkwin), PieMenuWidgetCmd,
- (ClientData) menuPtr, (void (*)()) NULL);
+ (ClientData) menuPtr, (void (*)(int *)) NULL);
if (ConfigurePieMenu(interp, menuPtr, argc-2, argv+2, 0) != TCL_OK) {
goto error;
}
*--------------------------------------------------------------
*/
-static int
-PieMenuWidgetCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Information about menu widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+static int
+PieMenuWidgetCmd (
+ ClientData clientData, /* Information about menu widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ char **argv /* Argument strings. */
+)
{
register PieMenu *menuPtr = (PieMenu *) clientData;
register PieMenuEntry *mePtr;
DeferPopupPieMenu(menuPtr);
} else if ((c == 's') && (strncmp(argv[1], "show", length) == 0)
&& (length >= 2)) {
- int index;
-
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " show\"", (char *) NULL);
NowPopupPieMenu(menuPtr);
} else if ((c == 'p') && (strncmp(argv[1], "pending", length) == 0)
&& (length >= 2)) {
- int index;
-
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " pending\"", (char *) NULL);
(menuPtr->flags & POPUP_PENDING) ? 1 : 0);
} else if ((c == 'd') && (strncmp(argv[1], "defer", length) == 0)
&& (length >= 2)) {
- int index;
-
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " defer\"", (char *) NULL);
}
Tk_Release((ClientData) mePtr);
} else if ((c == 'p') && (strncmp(argv[1], "post", length) == 0)) {
- int x, y, ix, iy, tmp, err;
+ int x, y;
+#if 0
+ int ix, iy, tmp, err;
+#endif
Tk_Uid group;
if ((argc != 4) && (argc != 5)) {
*----------------------------------------------------------------------
*/
-static void
-DestroyPieMenu(clientData)
- ClientData clientData; /* Info about menu widget. */
+static void
+DestroyPieMenu (
+ ClientData clientData /* Info about menu widget. */
+)
{
register PieMenu *menuPtr = (PieMenu *) clientData;
int i;
*----------------------------------------------------------------------
*/
-static void
-DestroyPieMenuEntry(clientData)
- ClientData clientData; /* Pointer to entry to be freed. */
+static void
+DestroyPieMenuEntry (
+ ClientData clientData /* Pointer to entry to be freed. */
+)
{
register PieMenuEntry *mePtr = (PieMenuEntry *) clientData;
PieMenu *menuPtr = mePtr->piemenuPtr;
*----------------------------------------------------------------------
*/
-static int
-ConfigurePieMenu(interp, menuPtr, argc, argv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- register PieMenu *menuPtr; /* Information about widget; may or may
+static int
+ConfigurePieMenu (
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register PieMenu *menuPtr, /* Information about widget; may or may
* not already have values for some fields. */
- int argc; /* Number of valid entries in argv. */
- char **argv; /* Arguments. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ int argc, /* Number of valid entries in argv. */
+ char **argv, /* Arguments. */
+ int flags /* Flags to pass to Tk_ConfigureWidget. */
+)
{
XGCValues gcValues;
GC newGC;
*----------------------------------------------------------------------
*/
-static int
-ConfigurePieMenuEntry(interp, menuPtr, mePtr, index, argc, argv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- PieMenu *menuPtr; /* Information about whole menu. */
- register PieMenuEntry *mePtr; /* Information about menu entry; may
+static int
+ConfigurePieMenuEntry (
+ Tcl_Interp *interp, /* Used for error reporting. */
+ PieMenu *menuPtr, /* Information about whole menu. */
+ register PieMenuEntry *mePtr, /* Information about menu entry; may
* or may not already have values for
* some fields. */
- int index; /* Index of mePtr within menuPtr's
+ int index, /* Index of mePtr within menuPtr's
* entries. */
- int argc; /* Number of valid entries in argv. */
- char **argv; /* Arguments. */
- int flags; /* Additional flags to pass to
+ int argc, /* Number of valid entries in argv. */
+ char **argv, /* Arguments. */
+ int flags /* Additional flags to pass to
* Tk_ConfigureWidget. */
+)
{
XGCValues gcValues;
GC newGC, newActiveGC;
*--------------------------------------------------------------
*/
-static void
-ComputePieMenuGeometry(clientData)
- ClientData clientData; /* Structure describing menu. */
+static void
+ComputePieMenuGeometry (
+ ClientData clientData /* Structure describing menu. */
+)
{
PieMenu *menuPtr = (PieMenu *) clientData;
*----------------------------------------------------------------------
*/
-static void
-DisplayPieMenu(clientData)
- ClientData clientData; /* Information about widget. */
+static void
+DisplayPieMenu (
+ ClientData clientData /* Information about widget. */
+)
{
register PieMenu *menuPtr = (PieMenu *) clientData;
register Tk_Window tkwin = menuPtr->tkwin;
XFontStruct *fontPtr;
- int index;
menuPtr->flags &= ~REDRAW_PENDING;
if ((menuPtr->tkwin == NULL) || !Tk_IsMapped(menuPtr->tkwin)) {
*----------------------------------------------------------------------
*/
-static void
-UpdatePieMenu(clientData)
- ClientData clientData; /* Information about widget. */
+static void
+UpdatePieMenu (
+ ClientData clientData /* Information about widget. */
+)
{
register PieMenu *menuPtr = (PieMenu *) clientData;
}
-UpdatePieMenuEntries(menuPtr)
- PieMenu *menuPtr;
+static void
+UpdatePieMenuEntries(PieMenu *menuPtr)
{
register PieMenuEntry *mePtr;
register Tk_Window tkwin = menuPtr->tkwin;
*--------------------------------------------------------------
*/
-static int
-GetPieMenuIndex(interp, menuPtr, string, indexPtr)
- Tcl_Interp *interp; /* For error messages. */
- PieMenu *menuPtr; /* Menu for which the index is being
+static int
+GetPieMenuIndex (
+ Tcl_Interp *interp, /* For error messages. */
+ PieMenu *menuPtr, /* Menu for which the index is being
* specified. */
- char *string; /* Specification of an entry in menu. See
+ char *string, /* Specification of an entry in menu. See
* manual entry for valid .*/
- int *indexPtr; /* Where to store converted relief. */
+ int *indexPtr /* Where to store converted relief. */
+)
{
- int i, y;
+ int i;
if ((string[0] == 'a') && (strcmp(string, "active") == 0)) {
*indexPtr = menuPtr->active;
*--------------------------------------------------------------
*/
-static void
-PieMenuEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+static void
+PieMenuEventProc (
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr /* Information about event. */
+)
{
PieMenu *menuPtr = (PieMenu *) clientData;
switch (eventPtr->type) {
*----------------------------------------------------------------------
*/
-static void
-EventuallyRedrawPieMenu(menuPtr, index)
- register PieMenu *menuPtr; /* Information about menu to redraw. */
- int index; /* Which entry to redraw. If -1, then
+static void
+EventuallyRedrawPieMenu (
+ register PieMenu *menuPtr, /* Information about menu to redraw. */
+ int index /* Which entry to redraw. If -1, then
* all the entries in the menu are redrawn. */
+)
{
if (menuPtr->tkwin == NULL) {
return;
}
-static void
-PopupPieMenu(clientData)
- ClientData clientData; /* Information about widget. */
+static void
+PopupPieMenu (
+ ClientData clientData /* Information about widget. */
+)
{
register PieMenu *menuPtr = (PieMenu *) clientData;
}
-static void
-NowPopupPieMenu(menuPtr)
- register PieMenu *menuPtr;
+static void
+NowPopupPieMenu (register PieMenu *menuPtr)
{
PopupPieMenu((ClientData)menuPtr);
}
-static void
-NeverPopupPieMenu(menuPtr)
- register PieMenu *menuPtr;
+static void
+NeverPopupPieMenu (register PieMenu *menuPtr)
{
if (menuPtr->flags & POPUP_PENDING) {
Tk_DeleteTimerHandler(menuPtr->popup_timer_token);
}
-static void
-EventuallyPopupPieMenu(menuPtr)
- register PieMenu *menuPtr;
+static void
+EventuallyPopupPieMenu (register PieMenu *menuPtr)
{
NeverPopupPieMenu(menuPtr);
}
-static void
-DeferPopupPieMenu(menuPtr)
- register PieMenu *menuPtr;
+static void
+DeferPopupPieMenu (register PieMenu *menuPtr)
{
if (menuPtr->flags & POPUP_PENDING) {
EventuallyPopupPieMenu(menuPtr);
*--------------------------------------------------------------
*/
-static int
-UnpostSubPieMenu(interp, menuPtr)
- Tcl_Interp *interp; /* Used for invoking sub-commands and
+static int
+UnpostSubPieMenu (
+ Tcl_Interp *interp, /* Used for invoking sub-commands and
* reporting errors. */
- register PieMenu *menuPtr; /* Information about menu as a whole. */
+ register PieMenu *menuPtr /* Information about menu as a whole. */
+)
{
- char string[30];
- int result, x, y, win_x, win_y;
- unsigned int key_buttons;
- Window root, child;
+ int result;
if (menuPtr->postedPie == NULL) {
return TCL_OK;
*----------------------------------------------------------------------
*/
-static int
-ActivatePieMenuEntry(menuPtr, index, preview)
- register PieMenu *menuPtr; /* Menu in which to activate. */
- int index; /* Index of entry to activate, or
+static int
+ActivatePieMenuEntry (
+ register PieMenu *menuPtr, /* Menu in which to activate. */
+ int index, /* Index of entry to activate, or
* -1 to deactivate all entries. */
- int preview; /* 1 to execute previewer */
+ int preview /* 1 to execute previewer */
+)
{
register PieMenuEntry *mePtr;
int result = TCL_OK;
}
-int
-CalcPieMenuItem(menu, x, y)
- PieMenu *menu;
- int x, y;
+static int
+CalcPieMenuItem(PieMenu *menu, int x, int y)
{
register PieMenuEntry *it, *last_it;
- int i, j, order, quadrant;
+ int i, order = 0, quadrant;
int numerator, denominator;
int first, last_i, last_order;
}
-LayoutPieMenu(menu)
- PieMenu *menu;
+static void
+LayoutPieMenu(PieMenu *menu)
{
int i;
int total_slice, radius;
}
-static void
-ShapePieMenu(menuPtr)
-PieMenu *menuPtr;
+static void
+ShapePieMenu (PieMenu *menuPtr)
{
Display *dpy;
Window win, shape;