Files
test2/intern/ghost/test/multitest/WindowData.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
644 B
C
Raw Normal View History

/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
*
* SPDX-License-Identifier: GPL-2.0-or-later */
2002-10-12 11:37:38 +00:00
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
#include "WindowData.h"
struct _WindowData {
2012-05-24 13:18:53 +00:00
void *data;
WindowDataHandler handler;
2002-10-12 11:37:38 +00:00
};
2012-05-24 13:18:53 +00:00
WindowData *windowdata_new(void *data, WindowDataHandler handler)
{
WindowData *wb = MEM_mallocN(sizeof(*wb), "windowdata_new");
wb->data = data;
wb->handler = handler;
2018-06-04 18:47:57 +02:00
2002-10-12 11:37:38 +00:00
return wb;
}
2012-05-24 13:18:53 +00:00
void windowdata_handle(WindowData *wb, GHOST_EventHandle evt)
{
2002-10-12 11:37:38 +00:00
wb->handler(wb->data, evt);
}
2012-05-24 13:18:53 +00:00
void windowdata_free(WindowData *wb)
{
2002-10-12 11:37:38 +00:00
MEM_freeN(wb);
}