blob: abdbe4c97d30febda2e32d28f2974b767e876fe0 (
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
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
#include "WindowData.h"
struct _WindowData {
void *data;
WindowDataHandler handler;
};
WindowData *windowdata_new(void *data, WindowDataHandler handler)
{
WindowData *wb = MEM_mallocN(sizeof(*wb), "windowdata_new");
wb->data = data;
wb->handler = handler;
return wb;
}
void windowdata_handle(WindowData *wb, GHOST_EventHandle evt)
{
wb->handler(wb->data, evt);
}
void windowdata_free(WindowData *wb)
{
MEM_freeN(wb);
}
|