diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-15 04:15:24 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-15 04:15:24 +0400 |
commit | 41729976753523ee08a0afaf6a26b6caf3dee1d6 (patch) | |
tree | ba264fba22084f44eb50b952f375715f501acff9 /source/blender/windowmanager | |
parent | a5f8298ea5d13d7707bc0cbf0722013276bab9d6 (diff) | |
parent | a425790065fedb2ae49f1b79770945d8528790d9 (diff) |
Merged changes in the trunk up to revision 50607.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_keymap.h | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 33 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 17 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 9 |
7 files changed, 46 insertions, 27 deletions
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index 78dbd253cd6..5c88babfb47 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -57,11 +57,11 @@ void WM_keymap_init (struct bContext *C); void WM_keymap_free (struct wmKeyMap *keymap); wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, const char *idname, int type, - int val, int modifier, int keymodifier); + int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type, - int val, int modifier, int keymodifier); + int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type, - int val, int modifier, int keymodifier); + int val, int modifier, int keymodifier); void WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi); char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 1f0a0d87cf4..4ec3d8ea755 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -115,7 +115,6 @@ struct ImBuf; #include "RNA_types.h" #include "DNA_listBase.h" -#include "BKE_utildefines.h" /* FILE_MAX */ /* exported types for WM */ #include "wm_cursors.h" diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 60c61dbe88c..17f17baba0e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1444,14 +1444,15 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand } else { - printf("%s: error - missing modal\n", __func__); + printf("%s: error '%s' missing modal\n", __func__, op->idname); } } else { wmOperatorType *ot = WM_operatortype_find(event->keymap_idname, 0); - if (ot) + if (ot) { retval = wm_operator_invoke(C, ot, event, properties, NULL, FALSE); + } } /* Finished and pass through flag as handled */ @@ -2707,7 +2708,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U switch (type) { /* mouse move */ - case GHOST_kEventCursorMove: { + case GHOST_kEventCursorMove: + { if (win->active) { GHOST_TEventCursorData *cd = customdata; wmEvent *lastevent = win->queue.last; @@ -2750,7 +2752,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } break; } - case GHOST_kEventTrackpad: { + case GHOST_kEventTrackpad: + { GHOST_TEventTrackpadData *pd = customdata; switch (pd->subtype) { case GHOST_kTrackpadEventMagnify: @@ -2782,7 +2785,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } /* mouse button */ case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { + case GHOST_kEventButtonUp: + { GHOST_TEventButtonData *bd = customdata; event.val = (type == GHOST_kEventButtonDown) ? KM_PRESS : KM_RELEASE; @@ -2830,7 +2834,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } /* keyboard */ case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { + case GHOST_kEventKeyUp: + { GHOST_TEventKeyData *kd = customdata; event.type = convert_key(kd->key); event.ascii = kd->ascii; @@ -2914,7 +2919,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventWheel: { + case GHOST_kEventWheel: + { GHOST_TEventWheelData *wheelData = customdata; if (wheelData->z > 0) @@ -2927,7 +2933,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventTimer: { + case GHOST_kEventTimer: + { event.type = TIMER; event.custom = EVT_DATA_TIMER; event.customdata = customdata; @@ -2936,7 +2943,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventNDOFMotion: { + case GHOST_kEventNDOFMotion: + { event.type = NDOF_MOTION; attach_ndof_data(&event, customdata); wm_event_add(win, &event); @@ -2946,7 +2954,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventNDOFButton: { + case GHOST_kEventNDOFButton: + { GHOST_TEventNDOFButtonData *e = customdata; event.type = NDOF_BUTTON_NONE + e->button; @@ -2972,12 +2981,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U case GHOST_kNumEventTypes: break; - case GHOST_kEventWindowDeactivate: { + case GHOST_kEventWindowDeactivate: + { event.type = WINDEACTIVATE; wm_event_add(win, &event); break; - } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f01ca9f566e..dca28c63557 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -492,6 +492,8 @@ int WM_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory char tstr[FILE_MAX]; int success = 0; + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_PRE); + G.relbase_valid = 0; if (!from_memory) { char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); @@ -569,6 +571,9 @@ int WM_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory } #endif + /* important to do before NULL'ing the context */ + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL); /* in background mode the scene will stay NULL */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 67cd202591d..0259146a9d3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1002,7 +1002,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, style); if (!WM_operator_check_ui_enabled(C, op->type->name)) - uiLayoutSetEnabled(layout, 0); + uiLayoutSetEnabled(layout, FALSE); if (op->type->flag & OPTYPE_MACRO) { for (op = op->macro.first; op; op = op->next) { diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 0074d6236db..e3867c0a32a 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -61,7 +61,6 @@ #include "BKE_blender.h" #include "BKE_global.h" -#include "BKE_utildefines.h" #include "BIF_gl.h" #include "BIF_glutil.h" @@ -327,7 +326,11 @@ static void build_pict_list(char *first, int totframes, int fstep, int fontid) int file; file = open(filepath, O_BINARY | O_RDONLY, 0); - if (file < 0) return; + if (file < 0) { + /* print errno? */ + return; + } + picture = (PlayAnimPict *)MEM_callocN(sizeof(PlayAnimPict), "picture"); if (picture == NULL) { printf("Not enough memory for pict struct '%s'\n", filepath); @@ -701,11 +704,11 @@ void playanim_window_open(const char *title, int posx, int posy, int sizex, int inital_state = start_maximized ? GHOST_kWindowStateMaximized : GHOST_kWindowStateNormal; g_WS.ghost_window = GHOST_CreateWindow(g_WS.ghost_system, - title, - posx, posy, sizex, sizey, - inital_state, - GHOST_kDrawingContextTypeOpenGL, - FALSE /* no stereo */, FALSE); + title, + posx, posy, sizex, sizey, + inital_state, + GHOST_kDrawingContextTypeOpenGL, + FALSE /* no stereo */, FALSE); //if (ghostwin) { //if (win) { diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b83b93454e6..59c8235faf0 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -724,11 +724,13 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr break; } - case GHOST_kEventWindowClose: { + case GHOST_kEventWindowClose: + { wm_window_close(C, wm, win); break; } - case GHOST_kEventWindowUpdate: { + case GHOST_kEventWindowUpdate: + { if (G.debug & G_DEBUG_EVENTS) { printf("%s: ghost redraw %d\n", __func__, win->winid); } @@ -739,7 +741,8 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr break; } case GHOST_kEventWindowSize: - case GHOST_kEventWindowMove: { + case GHOST_kEventWindowMove: + { GHOST_TWindowState state; state = GHOST_GetWindowState(win->ghostwin); win->windowstate = state; |