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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 00:51:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 00:51:09 +0400
commit7df35db1b1364dcd81dd8247ad3707d40a78fd59 (patch)
treefb967409fddbb02ee70fbdfa1e404fae115a312e /source/blender/editors/space_file
parent5342f7930fb26855b92f337ace45f2ee51153957 (diff)
2.5
Notifiers --------- Various fixes for wrong use of notifiers, and some new notifiers to make things a bit more clear and consistent, with two notable changes: * Geometry changes are now done with NC_GEOM, rather than NC_OBJECT|ND_GEOM_, so an object does need to be available. * Space data now use NC_SPACE|ND_SPACE_*, instead of data notifiers or even NC_WINDOW in some cases. Note that NC_SPACE should only be used for notifying about changes in space data, we don't want to go back to allqueue(REDRAW..). Depsgraph --------- The dependency graph now has a different flush call: DAG_object_flush_update(scene, ob, flag) is replaced by: DAG_id_flush_update(id, flag) It still works basically the same, one difference is that it now also accepts object data (e.g. Mesh), again to avoid requiring an Object to be available. Other ID types will simply do nothing at the moment. Docs ---- I made some guidelines for how/when to do which kinds of updates and notifiers. I can't specify totally exact how to make these decisions, but these are basically the guidelines I use. So, new and updated docs are here: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_ops.c30
-rw-r--r--source/blender/editors/space_file/space_file.c16
2 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index a06c1663d8e..e1a6e346ce2 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -190,9 +190,9 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect);
if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val )) {
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
} else {
- WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
}
return OPERATOR_FINISHED;
}
@@ -239,12 +239,12 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
file_deselect_all(sfile);
if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val ))
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
else
- WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
WM_event_add_mousemove(C); /* for directory changes */
- WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
return OPERATOR_FINISHED;
}
@@ -322,7 +322,7 @@ static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
BLI_cleanup_dir(G.sce, params->dir);
file_change_dir(sfile);
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
}
return OPERATOR_FINISHED;
@@ -587,7 +587,7 @@ int file_parent_exec(bContext *C, wmOperator *unused)
BLI_parent_dir(sfile->params->dir);
BLI_cleanup_dir(G.sce, sfile->params->dir);
file_change_dir(sfile);
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
}
}
@@ -614,7 +614,7 @@ int file_refresh_exec(bContext *C, wmOperator *unused)
file_change_dir(sfile);
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
@@ -645,7 +645,7 @@ int file_previous_exec(bContext *C, wmOperator *unused)
file_change_dir(sfile);
}
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
}
@@ -676,7 +676,7 @@ int file_next_exec(bContext *C, wmOperator *unused)
file_change_dir(sfile);
}
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
}
@@ -705,7 +705,7 @@ int file_directory_new_exec(bContext *C, wmOperator *unused)
BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX);
}
}
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
}
@@ -754,7 +754,7 @@ int file_directory_exec(bContext *C, wmOperator *unused)
BLI_cleanup_dir(G.sce, sfile->params->dir);
BLI_add_slash(sfile->params->dir);
file_change_dir(sfile);
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
}
@@ -769,7 +769,7 @@ int file_filename_exec(bContext *C, wmOperator *unused)
if (file_select_match(sfile, sfile->params->file))
{
sfile->params->file[0] = '\0';
- WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
}
}
@@ -796,7 +796,7 @@ int file_hidedot_exec(bContext *C, wmOperator *unused)
sfile->params->flag ^= FILE_HIDE_DOT;
filelist_free(sfile->files);
sfile->params->active_file = -1;
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
}
return OPERATOR_FINISHED;
@@ -958,7 +958,7 @@ int file_delete_exec(bContext *C, wmOperator *op)
file = filelist_file(sfile->files, sfile->params->active_file);
BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname);
BLI_delete(str, 0, 0);
- WM_event_add_notifier(C, NC_FILE | ND_FILELIST, NULL);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 793f7cf8815..722fa475727 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -212,14 +212,14 @@ static void file_listener(ScrArea *sa, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
- case NC_FILE:
+ case NC_SPACE:
switch (wmn->data) {
- case ND_FILELIST:
+ case ND_SPACE_FILE_LIST:
if (sfile->files) filelist_free(sfile->files);
ED_area_tag_refresh(sa);
ED_area_tag_redraw(sa);
break;
- case ND_PARAMS:
+ case ND_SPACE_FILE_PARAMS:
ED_area_tag_refresh(sa);
ED_area_tag_redraw(sa);
break;
@@ -249,12 +249,12 @@ static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch(wmn->category) {
- case NC_FILE:
+ case NC_SPACE:
switch (wmn->data) {
- case ND_FILELIST:
+ case ND_SPACE_FILE_LIST:
ED_region_tag_redraw(ar);
break;
- case ND_PARAMS:
+ case ND_SPACE_FILE_PARAMS:
ED_region_tag_redraw(ar);
break;
}
@@ -470,9 +470,9 @@ static void file_ui_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch(wmn->category) {
- case NC_FILE:
+ case NC_SPACE:
switch (wmn->data) {
- case ND_FILELIST:
+ case ND_SPACE_FILE_LIST:
ED_region_tag_redraw(ar);
break;
}