Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r--source/blender/windowmanager/intern/wm.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 9fd9defc0ce..638dd4ca807 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -69,7 +69,7 @@
/* ****************************************************** */
-#define MAX_OP_REGISTERED 32
+#define MAX_OP_REGISTERED 32
void WM_operator_free(wmOperator *op)
{
@@ -83,7 +83,7 @@ void WM_operator_free(wmOperator *op)
#endif
if (op->ptr) {
- op->properties= op->ptr->data;
+ op->properties = op->ptr->data;
MEM_freeN(op->ptr);
}
@@ -99,7 +99,7 @@ void WM_operator_free(wmOperator *op)
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);
}
@@ -118,22 +118,22 @@ static void wm_reports_free(wmWindowManager *wm)
/* called on event handling by event_system.c */
void wm_operator_register(bContext *C, wmOperator *op)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
int tot;
BLI_addtail(&wm->operators, op);
- tot= BLI_countlist(&wm->operators);
+ tot = BLI_countlist(&wm->operators);
- while (tot>MAX_OP_REGISTERED) {
- wmOperator *opt= wm->operators.first;
+ while (tot > MAX_OP_REGISTERED) {
+ wmOperator *opt = wm->operators.first;
BLI_remlink(&wm->operators, opt);
WM_operator_free(opt);
tot--;
}
/* so the console is redrawn */
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- WM_event_add_notifier(C, NC_WM|ND_HISTORY, NULL);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_HISTORY, NULL);
}
@@ -141,24 +141,24 @@ 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);
}
- WM_main_add_notifier(NC_WM|ND_HISTORY, NULL);
+ WM_main_add_notifier(NC_WM | ND_HISTORY, NULL);
}
/* ****************************************** */
-static GHash *menutypes_hash= NULL;
+static GHash *menutypes_hash = NULL;
MenuType *WM_menutype_find(const char *idname, int quiet)
{
- MenuType* mt;
+ MenuType *mt;
if (idname[0]) {
- mt= BLI_ghash_lookup(menutypes_hash, idname);
+ mt = BLI_ghash_lookup(menutypes_hash, idname);
if (mt)
return mt;
}
@@ -169,13 +169,13 @@ MenuType *WM_menutype_find(const char *idname, int quiet)
return NULL;
}
-int WM_menutype_add(MenuType* mt)
+int WM_menutype_add(MenuType *mt)
{
BLI_ghash_insert(menutypes_hash, (void *)mt->idname, mt);
return 1;
}
-void WM_menutype_freelink(MenuType* mt)
+void WM_menutype_freelink(MenuType *mt)
{
BLI_ghash_remove(menutypes_hash, mt->idname, NULL, (GHashValFreeFP)MEM_freeN);
}
@@ -183,15 +183,15 @@ void WM_menutype_freelink(MenuType* mt)
/* called on initialize WM_init() */
void WM_menutype_init(void)
{
- menutypes_hash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh");
+ menutypes_hash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh");
}
void WM_menutype_free(void)
{
- GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash);
+ GHashIterator *iter = BLI_ghashIterator_new(menutypes_hash);
- for ( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- MenuType *mt= BLI_ghashIterator_getValue(iter);
+ for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ MenuType *mt = BLI_ghashIterator_getValue(iter);
if (mt->ext.free) {
mt->ext.free(mt->ext.data);
}
@@ -199,22 +199,22 @@ void WM_menutype_free(void)
BLI_ghashIterator_free(iter);
BLI_ghash_free(menutypes_hash, NULL, (GHashValFreeFP)MEM_freeN);
- menutypes_hash= NULL;
+ menutypes_hash = NULL;
}
/* ****************************************** */
void WM_keymap_init(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
/* create standard key configs */
if (!wm->defaultconf)
- wm->defaultconf= WM_keyconfig_new(wm, "Blender");
+ wm->defaultconf = WM_keyconfig_new(wm, "Blender");
if (!wm->addonconf)
- wm->addonconf= WM_keyconfig_new(wm, "Blender Addon");
+ wm->addonconf = WM_keyconfig_new(wm, "Blender Addon");
if (!wm->userconf)
- wm->userconf= WM_keyconfig_new(wm, "Blender User");
+ wm->userconf = WM_keyconfig_new(wm, "Blender User");
/* initialize only after python init is done, for keymaps that
* use python operators */
@@ -237,15 +237,15 @@ void WM_keymap_init(bContext *C)
void WM_check(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
/* wm context */
- if (wm==NULL) {
- wm= CTX_data_main(C)->wm.first;
+ 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 */
@@ -268,18 +268,18 @@ void WM_check(bContext *C)
void wm_clear_default_size(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
/* wm context */
- if (wm==NULL) {
- wm= CTX_data_main(C)->wm.first;
+ 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;
@@ -291,18 +291,18 @@ void wm_clear_default_size(bContext *C)
/* on startup, it adds all data, for matching */
void wm_add_default(bContext *C)
{
- wmWindowManager *wm= alloc_libblock(&CTX_data_main(C)->wm, ID_WM, "WinMan");
+ wmWindowManager *wm = alloc_libblock(&CTX_data_main(C)->wm, ID_WM, "WinMan");
wmWindow *win;
- bScreen *screen= CTX_wm_screen(C); /* XXX from file read hrmf */
+ bScreen *screen = CTX_wm_screen(C); /* XXX from file read hrmf */
CTX_wm_manager_set(C, wm);
- win= wm_window_new(C);
- win->screen= screen;
- screen->winid= win->winid;
- BLI_strncpy(win->screenname, screen->id.name+2, sizeof(win->screenname));
+ win = wm_window_new(C);
+ win->screen = screen;
+ screen->winid = win->winid;
+ BLI_strncpy(win->screenname, screen->id.name + 2, sizeof(win->screenname));
- wm->winactive= win;
- wm->file_saved= 1;
+ wm->winactive = win;
+ wm->file_saved = 1;
wm_window_make_drawable(C, win);
}
@@ -317,19 +317,19 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
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 */
+ 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);