dynamicsettings(3w) — OLIT Widget Set
NAMES
LookupOlColors, LookupOlInputEvent, OlCallDynamicCallbacks, OlDetermineMouseAction, OlDragAndDrop, OlGrabDragPointer, OlRegisterDynamicCallback, OlReplayBtnEvent, OlUngrabDragPointer, OlUnregisterDynamicCallback
SYNOPSIS and DESCRIPTION
NOTE: The OlGetApplicationResources and LookupOlColors routines previously included with the dynamic settings functions are no longer supported.
LookupOlInputEvent
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern OlInputEvent LookupOlInputEvent(
Widget w,
XEvent ∗event,
KeySym ∗keysym,
char ∗∗buffer,
int ∗length);
LookupOlInputEvent.txt
OlCallDynamicCallbacks
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern void OlCallDynamicCallbacks( void )
The OlCallDynamicCallbacks procedure is used to trigger the calling of the functions registered on the dynamic callback list. This procedure is called automatically whenever the RESOURCE_MANAGER property of the RootWindow is updated. It may also be called to force a synchronization of the dynamic settings.
OlDetermineMouseAction
Synopsis:
#include <Xol/OpenLook.h>
#include <Xol/Dynamic.h>
. . .
extern ButtonAction OlDetermineMouseAction(
Widget w,
XEvent ∗event);
The OlDetermineMouseAction function is used to determine the kind of mouse gesture that is being attempted: MOUSE_CLICK, MOUSE_MULTI_CLICK, or MOUSE_MOVE. This function is normally called immediately upon receipt of a mouse button press event. It uses the current settings for mouseDampingFactor and multiClickTimeout to determine the kind of gesture being made.
NOTE: This function performs an active pointer grab. This grab is released for the CLICK type actions but not for MOUSE_MOVE. It is the responsibility of the caller to ungrab the pointer if the action is MOUSE_MOVE.
Example:
static void ButtonConsumeCB (w, client_data, call_data)
widget w;
XtPointer client_data;
XtPointer call_data;
{
Window drop_window;
Position x;
Position y;
OlVirtualEvent ve;
ve = (OlVirtualEvent) call_data
switch (ve -> virtual_name)
{
case OL_SELECT:~
switch(OlDetermineMouseAction(widget, event))
{
{
case MOUSE_MOVE:~
OlGrabDragPointer(widget, OlGetMoveCursor(XtScreen(widget),
None);
OlDragAndDrop(widget, &drop_window, &x, &y);
DropOn(widget, drop_window, x, y, ....);
OlUngrabDragPointer(widget);
break;
case MOUSE_CLICK:~
ClickSelect(widget, ....);
break;
case MOUSE_MULTI_CLICK:~
MultiClickSelect(widget, ....);
break;
default:~
Panic(widget, ....);
break;
}
break;
default:~
OlReplayBtnEvent(widget, NULL, event);
break;
}
}
OlDragAndDrop
Synopsis:
#include <OpenLook.h>
. . .
extern void OlDragAndDrop(
Widget w,
Window ∗window,
Position ∗xPosition,
Position ∗yPosition);
The OlDragAndDrop function is used to monitor a direct manipulation operation; returning, when the operation is completed, the drop_window and the x and y coordinates corresponding to the location of the drop. These return values will reflect the highest (in the stacking order) window located under the pointer at the time of the button release.
Example:
The following code provides a sample of the use of the facilities:
static void ButtonConsumeCB (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
Window drop_window;
Position x;
Position y;
OlVirtualEvent ve;
ve = (OlVirtualEvent) call_data
switch (ve->virtual_name) {
case OL_SELECT:~
OlGrabDragPointer(widget,
OlGetMoveCursor(XtScreen(widget),
None);
OlDragAndDrop(widget, &drop_window, &x, &y);
DropOn(widget, drop_window, x, y, ....);
OlUngrabDragPointer(widget);
break;
}
. . .
}
OlGrabDragPointer
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern void OlGrabDragPointer(
Widget w,
Cursor cursor,
Window window);
The OlGrabDragPointer procedure is used to effect an active grab of the mouse pointer. This function is normally called after a mouse drag operation is experienced and prior to calling the OlDragAndDrop procedure which is used to monitor a drag operation.
OlRegisterDynamicCallback
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern void OlRegisterDynamicCallback(
OlDynamicCallbackProc CB,
XtPointer data);
The OlRegisterDynamicCallback procedure is used to add a function to the list of registered callbacks to be called whenever the procedure invoked.OlCallDynamicCallbacksis The OlCallDynamicCallbacks procedure is invoked whenever the RESOURCE_MANAGER property of the Root Window is updated. The OlCallDynamicCallbacks procedure may also be called directly by either the application or other routines in the widget libraries. The callbacks registered are guaranteed to be called in FIFO order of registration and will be called as:
(∗CB)(data);
OlReplayBtnEvent
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern void OlReplayBtnEvent(
Widget w,
caddr_t client_data,
XEvent ∗event);
The OlReplayBtnEvent procedure is used to replay a button press event to the next window (towards the root) that is interested in button events. This provides a means of propagating events up a window tree.
OlUngrabDragPointer
Synopsis:
#include <Xol/OpenLook.h>
#include <Xol/Dynamic.h>
. . .
extern void OlUngrabDragPointer(
Widget w);
The OlUngrabDragPointer procedure is used to relinquish the active pointer grab which was initiated by the OlGrabDragPointer procedure. This function simply ungrabs the pointer.
OlUnregisterDynamicCallback
Synopsis:
#include <Xol/OpenLook.h>
. . .
extern int OlUnregisterDynamicCallback(
void ∗CB
XtPointer data);
The OlUnregisterDynamicCallback procedure is used to remove a function from the list of registered callbacks to be called whenever the procedure OlCallDynamicCallbacks is invoked.
Return
Zero (0) is returned if the dynamic callback cannot be removed; otherwise one (1) is returned.
Version 3.0 — Last change: 19 July 91