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