/usr/share/doc/xviewg/examples/cursor/stop_cursor.c is in xview-examples 3.2p1.4-28.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | /*
* color_cursor.c -- create a predefined cursor and assign it to a canvas.
*/
#include <stdio.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/cursor.h>
void
do_it(item, event)
{
Rect *r;
Panel panel = xv_get(item, PANEL_PARENT_PANEL);
r = (Rect *)xv_get(xv_get(panel, XV_ROOT), WIN_MOUSE_XY);
fprintf(stderr, "Root window: ");
rect_print(r);
fputc('\n', stderr);
r = (Rect *)xv_get(xv_get(panel, CANVAS_NTH_PAINT_WINDOW, 0), WIN_MOUSE_XY);
fprintf(stderr, "panel window: ");
rect_print(r);
fputc('\n', stderr);
}
main(argc, argv)
int argc;
char *argv[];
{
Frame frame;
Canvas canvas;
Xv_Cursor cursor;
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv);
/*
* create a cursor based on the image just created
*/
cursor = xv_create(XV_NULL, CURSOR,
CURSOR_SRC_CHAR, OLC_STOP_PTR,
NULL);
/*
* Create a base frame and a canvas
*/
frame = xv_create(XV_NULL, FRAME, NULL);
canvas = xv_create(frame, PANEL,
XV_WIDTH, 100,
XV_HEIGHT, 100,
NULL);
/*
* set the cursor to the paint window for the canvas
* Do not set it for the canvas itself.
*/
xv_set(xv_get(canvas, CANVAS_NTH_PAINT_WINDOW, 0),
WIN_CURSOR, cursor,
NULL);
xv_create(canvas, PANEL_BUTTON,
PANEL_LABEL_STRING, "Do It",
PANEL_NOTIFY_PROC, do_it,
NULL);
window_fit(frame);
window_main_loop(frame);
}
|