diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index ea0a7388059..9fd9defc0ce 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -75,31 +75,31 @@ void WM_operator_free(wmOperator *op) { #ifdef WITH_PYTHON - if(op->py_instance) { + if (op->py_instance) { /* do this first in case there are any __del__ functions or * similar that use properties */ BPY_DECREF(op->py_instance); } #endif - if(op->ptr) { + if (op->ptr) { op->properties= op->ptr->data; MEM_freeN(op->ptr); } - if(op->properties) { + if (op->properties) { IDP_FreeProperty(op->properties); MEM_freeN(op->properties); } - if(op->reports && (op->reports->flag & RPT_FREE)) { + if (op->reports && (op->reports->flag & RPT_FREE)) { BKE_reports_clear(op->reports); MEM_freeN(op->reports); } - if(op->macro.first) { + if (op->macro.first) { wmOperator *opm, *opmnext; - for(opm= op->macro.first; opm; opm= opmnext) { + for (opm= op->macro.first; opm; opm= opmnext) { opmnext = opm->next; WM_operator_free(opm); } @@ -124,7 +124,7 @@ void wm_operator_register(bContext *C, wmOperator *op) BLI_addtail(&wm->operators, op); tot= BLI_countlist(&wm->operators); - while(tot>MAX_OP_REGISTERED) { + while (tot>MAX_OP_REGISTERED) { wmOperator *opt= wm->operators.first; BLI_remlink(&wm->operators, opt); WM_operator_free(opt); @@ -141,7 +141,7 @@ void WM_operator_stack_clear(wmWindowManager *wm) { wmOperator *op; - while((op= wm->operators.first)) { + while ((op= wm->operators.first)) { BLI_remlink(&wm->operators, op); WM_operator_free(op); } @@ -159,11 +159,11 @@ MenuType *WM_menutype_find(const char *idname, int quiet) if (idname[0]) { mt= BLI_ghash_lookup(menutypes_hash, idname); - if(mt) + if (mt) return mt; } - if(!quiet) + if (!quiet) printf("search for unknown menutype %s\n", idname); return NULL; @@ -190,9 +190,9 @@ void WM_menutype_free(void) { GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash); - for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) { + for ( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) { MenuType *mt= BLI_ghashIterator_getValue(iter); - if(mt->ext.free) { + if (mt->ext.free) { mt->ext.free(mt->ext.data); } } @@ -209,19 +209,19 @@ void WM_keymap_init(bContext *C) wmWindowManager *wm= CTX_wm_manager(C); /* create standard key configs */ - if(!wm->defaultconf) + if (!wm->defaultconf) wm->defaultconf= WM_keyconfig_new(wm, "Blender"); - if(!wm->addonconf) + if (!wm->addonconf) wm->addonconf= WM_keyconfig_new(wm, "Blender Addon"); - if(!wm->userconf) + if (!wm->userconf) wm->userconf= WM_keyconfig_new(wm, "Blender User"); /* initialize only after python init is done, for keymaps that * use python operators */ - if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) { + if (CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) { /* create default key config, only initialize once, * it's persistent across sessions */ - if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) { + if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) { wm_window_keymap(wm->defaultconf); ED_spacetypes_keymap(wm->defaultconf); @@ -240,16 +240,16 @@ void WM_check(bContext *C) wmWindowManager *wm= CTX_wm_manager(C); /* wm context */ - if(wm==NULL) { + if (wm==NULL) { wm= CTX_data_main(C)->wm.first; CTX_wm_manager_set(C, wm); } - if(wm==NULL) return; - if(wm->windows.first==NULL) return; + if (wm==NULL) return; + if (wm->windows.first==NULL) return; if (!G.background) { /* case: fileread */ - if((wm->initialized & WM_INIT_WINDOW) == 0) { + if ((wm->initialized & WM_INIT_WINDOW) == 0) { WM_keymap_init(C); WM_autosave_init(wm); } @@ -260,7 +260,7 @@ void WM_check(bContext *C) /* case: fileread */ /* note: this runs in bg mode to set the screen context cb */ - if((wm->initialized & WM_INIT_WINDOW) == 0) { + if ((wm->initialized & WM_INIT_WINDOW) == 0) { ED_screens_initialize(wm); wm->initialized |= WM_INIT_WINDOW; } @@ -272,14 +272,14 @@ void wm_clear_default_size(bContext *C) wmWindow *win; /* wm context */ - if(wm==NULL) { + if (wm==NULL) { wm= CTX_data_main(C)->wm.first; CTX_wm_manager_set(C, wm); } - if(wm==NULL) return; - if(wm->windows.first==NULL) return; + if (wm==NULL) return; + if (wm->windows.first==NULL) return; - for(win= wm->windows.first; win; win= win->next) { + for (win= wm->windows.first; win; win= win->next) { win->sizex = 0; win->sizey = 0; win->posx = 0; @@ -314,22 +314,22 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm) wmOperator *op; wmKeyConfig *keyconf; - if(wm->autosavetimer) + if (wm->autosavetimer) wm_autosave_timer_ended(wm); - while((win= wm->windows.first)) { + while ((win= wm->windows.first)) { BLI_remlink(&wm->windows, win); win->screen= NULL; /* prevent draw clear to use screen */ wm_draw_window_clear(win); wm_window_free(C, wm, win); } - while((op= wm->operators.first)) { + while ((op= wm->operators.first)) { BLI_remlink(&wm->operators, op); WM_operator_free(op); } - while((keyconf=wm->keyconfigs.first)) { + while ((keyconf=wm->keyconfigs.first)) { BLI_remlink(&wm->keyconfigs, keyconf); WM_keyconfig_free(keyconf); } @@ -341,14 +341,14 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm) wm_reports_free(wm); - if(C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL); + if (C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL); } void wm_close_and_free_all(bContext *C, ListBase *wmlist) { wmWindowManager *wm; - while((wm=wmlist->first)) { + while ((wm=wmlist->first)) { wm_close_and_free(C, wm); BLI_remlink(wmlist, wm); MEM_freeN(wm); @@ -357,7 +357,7 @@ void wm_close_and_free_all(bContext *C, ListBase *wmlist) void WM_main(bContext *C) { - while(1) { + while (1) { /* get events from ghost, handle window events, add to window queues */ wm_window_process_events(C); |