Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
Example 19-2. A drop-site item example (continued)
window_fit(frame);
xv_main_loop(frame);
exit(0);
}
void
EventProc(window, event)
Xv_Window window;
Event *event;
{
switch (event_action(event)) {
/* When drop previewing is available, if
* the drop site has selected for previewing
* events (DROP_SITE_EVENT_MASK) then it will
* receive ACTION_DRAG_PREVIEW events from
* the source as requested.
*/
case ACTION_DRAG_PREVIEW:
switch(event_id(event)) {
case LOC_WINENTER:
inverted = True;
break;
case LOC_WINEXIT:
inverted = False;
break;
case LOC_DRAG:
break;
}
PaintCanvas(NULL, window, XV_DISPLAY_FROM_WINDOW(window),
xv_get(window, XV_XID), NULL);
break;
case ACTION_DRAG_COPY:
case ACTION_DRAG_MOVE: {
Xv_drop_site ds;
Xv_Server server = XV_SERVER_FROM_WINDOW(event_window(event));
/* If the user dropped over an acceptable
* drop site, the owner of the drop site will
* be sent an ACTION_DROP_{COPY, MOVE} event.
*/
/* To acknowledge the drop and to associate the
* rank of the source’s selection to our
* requestor selection object, we call
* dnd_decode_drop().
*/
if ((ds = dnd_decode_drop(sel, event)) != XV_ERROR) {
if (xv_get(ds, DROP_SITE_ID) == BULLSEYE_SITE)
UpdatePanel(server, sel);
/* If this is a move operation, we must ask
* the source to delete the selection object.
* We should only do this if the transfer of
* data was successful.
*/
Drag and Drop
Drag and Drop 453
Example 19-2. A drop-site item example (continued)
if (event_ac
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873