aboutsummaryrefslogtreecommitdiff
path: root/cursor.c
blob: 1a934a08f833d13fbfd7e991fc356e691d9e78a3 (plain)
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

/* this object should probably register a e_motionfn callback with the root
 * canvas so that it is guaranteed to get the mouse motion data regardless of
 * whether the current canvas is visible.  Check g_canvas.h for info.*/

// list of Tk cursors: http://www.die.net/doc/linux/man/mann/cursors.n.html

#include "m_pd.h"
#include "g_canvas.h"

typedef struct _cursor {
	t_object            x_obj;
	t_outlet            *x_data_outlet;
	t_outlet            *x_status_outlet;
} t_cursor;

t_widgetbehavior cursor_widgetbehavior;
static t_class *cursor_class;

static void cursor_motion(t_cursor *x, t_floatarg dx, t_floatarg dy)
{

}

static void cursor_bang(t_cursor *x)
{

}

static void cursor_float(t_cursor *x, t_floatarg f)
{

}

static void *cursor_new(t_symbol *s, int argc, t_atom *argv)
{
    t_cursor *x = (t_cursor *)pd_new(cursor_class);


    return (x);
}

static void cursor_free(t_cursor *x)
{

}

void cursor_setup(void)
{
    cursor_class = class_new(gensym("cursor"), (t_newmethod)cursor_new,
                              (t_method)cursor_free, sizeof(t_cursor), 0, A_GIMME, 0);
    class_addbang(cursor_class, cursor_bang);
    class_addfloat(cursor_class, cursor_float);

    cursor_widgetbehavior.w_getrectfn =    NULL;
    cursor_widgetbehavior.w_displacefn =   NULL;
    cursor_widgetbehavior.w_selectfn =     NULL;
    cursor_widgetbehavior.w_activatefn =   NULL;
    cursor_widgetbehavior.w_deletefn =     NULL;
    cursor_widgetbehavior.w_visfn =        NULL;
    cursor_widgetbehavior.w_clickfn =      NULL;
    class_setwidget(cursor_class, &cursor_widgetbehavior);
}