-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphics_mouse_events.c
More file actions
68 lines (57 loc) · 1.88 KB
/
Copy pathgraphics_mouse_events.c
File metadata and controls
68 lines (57 loc) · 1.88 KB
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
65
66
67
68
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* graphics_mouse_events.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: iboukhss <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/12 18:30:16 by iboukhss #+# #+# */
/* Updated: 2025/05/12 18:34:07 by iboukhss ### ########.fr */
/* */
/* ************************************************************************** */
#include "graphics.h"
void add_button_press_hook(t_window *win)
{
struct s_hook h;
h.x_event = ButtonPress;
h.x_mask = ButtonPressMask;
h.func = win->button_press_hook;
h.param = win->param;
register_hook(win, h);
}
void add_button_release_hook(t_window *win)
{
struct s_hook h;
h.x_event = ButtonRelease;
h.x_mask = ButtonReleaseMask;
h.func = win->button_release_hook;
h.param = win->param;
register_hook(win, h);
}
void add_motion_notify_hook(t_window *win)
{
struct s_hook h;
h.x_event = MotionNotify;
h.x_mask = PointerMotionMask;
h.func = win->motion_notify_hook;
h.param = win->param;
register_hook(win, h);
}
void add_expose_hook(t_window *win)
{
struct s_hook h;
h.x_event = Expose;
h.x_mask = ExposureMask;
h.func = win->expose_hook;
h.param = win->param;
register_hook(win, h);
}
void add_destroy_notify_hook(t_window *win)
{
struct s_hook h;
h.x_event = DestroyNotify;
h.x_mask = StructureNotifyMask;
h.func = win->destroy_notify_hook;
h.param = win->param;
register_hook(win, h);
}