dnd_done()
This function is called by the application that is receiving the drop. It is called after
the drop operation is completed. The function informs the toolkit that the drag and
drop operation has been completed.
dnd_done(sel_object)
Selection_requestor sel_object;
sel_object is the Selection_requestor object that was previously passed
into dnd_decode_drop().
dnd_is_forwarded()
Allows applications to detect when a drop event has been forwarded from some other
drop-site. Generally this happens when the user drops on the window manager’s decor
window or on an icon with the attribute DROP_SITE_DEFAULT set. The corresponding
preview/drop event will have the flags field set with the DND_FORWARDED flag. This is
tested for by using dnd_is_forwarded(event).
In general, if the application handles previewing, it should check to see if the preview
event was forwarded and not invert/highlight the drop site.
dnd_is_forwarded(event)
dnd_is_local()
Returns whether the ACTION_DRAG_COPY or ACTION_DROP_MOVE event was generated
locally within the client.
dnd_is_local(event)
dnd_send_drop()
This initiates a drag. After the drag and drop object is created, an application calls
dnd_send_drop(). This changes the cursor to the drag cursor, sends preview
events to valid drop-sites and sends the trigger event (if a valid drop-site is dropped
on). Trigger events are either ACTION_DRAG_COPY or ACTION_DRAG_MOVE.
A drag operation can be aborted by hitting the STOP key, or its equivalent.
dnd_send_drop() reverts the drag cursor back to its normal state and returns
DND_ABORTED when it detects the STOP key event. Application code needs to handle
the DND_ABORTED after dnd_send_drop() returns. See <xview/dragdrop.h> for
other valid return values.
int
dnd_send_drop(object)
Dnd object;
object is a Dnd object that describes the source data (an instance of DRAGDROP).
event_action()
Returns the semantic action from the event structure. For example, when the user se-
lects the SELECT button, it returns ACTION_SELECT. If there is no action associated
with an event, event_action() returns the value returned by event_id() for
the event. The macro is passed a pointer to an Event structure.
180 XView Reference Manual
event_alt_is_down()
Returns TRUE or FALSE, depending on the state of the Alt key. The macro is passed a
pointer to an Event structure.
event_button_is_down()
Returns TRUE or FALSE, depending on the state of mouse buttons. Used in
conjunction with: event_is_button(), event_left_is_down(), event_
middle_is_down(), event_right_is_down(). The macro is passed a point-
er to an Event structure.
event_ctrl_is_down()
Returns TRUE or FALSE, depending on the state of the Control key. Indicates the state
of the Control key. The macro is passed a pointer to an Event structure.
event_id()
Returns the actual event ID, such as MS_LEFT to indicate the left mouse button. The
macro is passed a pointer to an Event structure. Use of the macro event_
action(), which returns the semantic action, is recommended instead of
event_id().
event_is_ascii( )
Returns TRUE or FALSE, depending whether or not the event is an ASCII key. The mac-
ro is passed a pointer to an Event structure.
event_is_button()
Returns TRUE or FALSE, depending whether or not the event is a button event. This
procedure is used with: event_button_is_down(), event_left_is_
down(), event_middle_is_down(), and event_right_is_down(). The
macro is passed a pointer to an Event structure.
event_is_down()
Returns TRUE or FALSE, depending on the state of a mouse button or keyboard key.
The macro is passed a pointer to an Event structure. Also see the macro
event_is_up().
event_is_iso()
Returns TRUE or FALSE, depending whether a key event is within the ISO character set.
The macro is passed a pointer to an Event structure.
event_is_key_bottom()
Returns TRUE or FALSE, depending whether a key event is within the left function
keys. The macro is passed a pointer to an Event structure.
event_is_key_left()
Returns TRUE or FALSE, depending whether a key event is within the left function
keys. This is for function keys on keyboards that are sectioned into four sets of fifteen
function keys. The macro is passed a pointer to an Event structure.
Procedures and Macros
Procedures and Macros 181
event_is_key_right( )
Returns TRUE or FALSE, depending whether a key event is within the right function
keys. This is for function keys on keyboards that are sectioned into four sets of fifteen
function keys. The macro is passed a pointer to an Event structure.
event_is_key_top( )
Returns TRUE or FALSE, depending whether a key event is within the top function keys.
This is for function keys on keyboards that are sectioned into four sets of fifteen func-
tion keys. The macro is passed a pointer to an Event structure.
event_is_meta()
Returns TRUE or FALSE, and determines whether event is a Meta key. The macro is
passed a pointer to an Event structure.
event_is_string()
Returns TRUE or FALSE, determines if a string is associated with the event. The macro
is passed a pointer to an Event structure.
event_is_up()
Returns TRUE or FALSE, depending on the state of the mouse button or keyboard in a
particular event. The macro is passed a pointer to an Event structure. Also see the
macro event_is_down().
event_left_is_down( )
Returns TRUE or FALSE, and determines the state of the left mouse button. Used to de-
termine the state of particular buttons for a three button mouse. This procedure is used
in conjunction with: event_button_is_down(), event_is_button(),
event_middle_is_down(), and event_right_is_down(). The macro is
passed a pointer to an Event structure.
event_meta_is_down()
Indicates the state of the Meta key. The macro is passed a pointer to an Event struc-
ture.
event_middle_is_down()
Returns TRUE or FALSE, and determines the state of the middle mouse button. This
procedure is used with: event_button_is_down(), event_is_button(),
event_left_is_down(), and event_right_is_down(). The macro is pas-
sed a pointer to an Event structure.
event_right_is_down()
Returns TRUE or FALSE, and determines the state of the right mouse button. This pro-
cedure is used with: event_button_is_down(), event_is_button(),
event_left_is_down(), and event_middle_is_down(). The macro is pas-
sed a pointer to an Event structure.
event_shift_is_down()
Indicates the state of the Shift key. The macro is passed a pointer to an Event struc-
ture.
182 XView Reference Manual
event_string()
Used to determine the string value associated with the event ID. For normal ASCII
event codes, event_string() returns a string value of the key. However, keys,
ASCII or not, may be rebound to a string using XRebindKeysym(). The macro is
passed a pointer to an Event structure.
event_time( )
Returns the time field from the event structure. Used to determine the time value asso-
ciated with the event. The macro is passed a pointer to an Event structure.
event_window()
Gets the window in which a particular event took place. The macro is passed a pointer
to an Event structure.
event_xevent( )
Returns a pointer to the X event structure associated with an XView event structure.
The macro is passed a pointer to an Event structure.
event_xevent_type()
Returns the type field of the X event structure. The macro is passed a pointer to an
Event structure.
frame_get_rect()
Gets the rect of the frame. x,y is the upper-left corner of the window coordinate
space. Width and height attempt to include the window manager decoration.
void
frame_get_rect(frame, rect)
Frame frame;
Rect *rect;
frame_set_rect()
Sets the rect of the frame. x,y is the upper-left corner of the window coordinate
space. Width and height attempt to include the window manager decoration.
void
frame_set_rect(frame, rect)
Frame frame;
Rect *rect;
MENUITEM_SPACE
Used to create a blank menu item.
menu_item = xv_create(NULL, MENUITEM_SPACE, NULL);
Procedures and Macros
Procedures and Macros 183
menu_return_item()
Predefined notify procedure which, if given as the value for MENU_NOTIFY_PROC,
causes the menu_done_proc(), if any, to return the handle of the selected item.
Menu_item
menu_return_item(menu, menu_item)
Menu menu;
Menu_item menu_item;
menu_return_value()
Predefined notify procedure which, if given as the value for MENU_NOTIFY_PROC,
causes the menu_done_proc(), if any, to return the value of the selected item.
Xv_opaque
menu_return_value(menu, menu_item)
Menu menu;
Menu_item menu_item;
menu_show()
Displays the specified menu.
void
menu_show(menu, window, event, NULL)
Menu menu;
Xv_Window window;
Event *event;
window is the handle of the window over which the menu is displayed. event is the
event which causes the menu to come up. The final NULL is required for private usage.
notice_prompt( )
This is an XView Version 2 compatibility procedure. If you are creating a new notice
for XView Version 3, use the NOTICE package. Refer to Chapter 12, Notices, in the
XView Programming Manual for details. To obtain more information on
notice_prompt(), see Appendix B, The notice_prompt Function, in the XView
Programming Manual.
The function displays the notice and does not return until the user pushes a button or
until its trigger or the default action has been seen. It returns a value of
NOTICE_FAILED if notice_prompt() fails for any reason; otherwise, it is equiva-
lent to the ordinal value of the button which caused the return (i.e., button actually
selected or default button if default action triggered return). The client_window
should be the window for which the notice has been generated. This is important for
fonts and positioning information. For explicit positioning of the notice, clients should
specify
NOTICE_FOCUS_XY. The event, if not NULL, will be completely filled in at the
time the notice_prompt() returns.
The possible status values that may be returned from this function are:
• The int value passed with every
NOTICE_BUTTON attribute.
• NOTICE_YES if a button created with NOTICE_BUTTON_YES is pushed.
• NOTICE_NO if a button created with NOTICE_BUTTON_NO is pushed.
184 XView Reference Manual
Get Volume 7B: XView Reference Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.