|
Blender
V2.59
|
00001 00029 #include <stdlib.h> 00030 00031 #include "MEM_guardedalloc.h" 00032 00033 #include "GHOST_C-api.h" 00034 00035 #include "WindowData.h" 00036 00037 struct _WindowData { 00038 void *data; 00039 WindowDataHandler handler; 00040 }; 00041 00042 WindowData *windowdata_new(void *data, WindowDataHandler handler) { 00043 WindowData *wb= MEM_mallocN(sizeof(*wb), "windowdata_new"); 00044 wb->data= data; 00045 wb->handler= handler; 00046 00047 return wb; 00048 } 00049 00050 void windowdata_handle(WindowData *wb, GHOST_EventHandle evt) { 00051 wb->handler(wb->data, evt); 00052 } 00053 00054 void windowdata_free(WindowData *wb) { 00055 MEM_freeN(wb); 00056 }