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/editors/space_text/text_ops.c')
-rw-r--r--source/blender/editors/space_text/text_ops.c92
1 files changed, 48 insertions, 44 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 4c9f47ed170..7751355a14d 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -176,6 +176,7 @@ void TEXT_OT_new(wmOperatorType *ot)
{
/* identifiers */
ot->name= "New";
+ ot->description= "Create a new text data block.";
ot->idname= "TEXT_OT_new";
/* api callbacks */
@@ -223,6 +224,7 @@ void TEXT_OT_open(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Open";
+ ot->description= "Open a new text data block.";
ot->idname= "TEXT_OT_open";
/* api callbacks */
@@ -260,6 +262,7 @@ void TEXT_OT_reload(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reload";
+ ot->description= "Reload active text data block from its file.";
ot->idname= "TEXT_OT_reload";
/* api callbacks */
@@ -270,48 +273,9 @@ void TEXT_OT_reload(wmOperatorType *ot)
/******************* delete operator *********************/
-static void text_unlink(Main *bmain, Text *text)
-{
- bScreen *scr;
- ScrArea *area;
- SpaceLink *sl;
-
- /* XXX this ifdef is in fact dangerous, if python is
- * disabled it will leave invalid pointers in files! */
-
-#ifndef DISABLE_PYTHON
- // XXX BPY_free_pyconstraint_links(text);
- // XXX free_text_controllers(text);
- // XXX free_dome_warp_text(text);
-
- /* equivalently for pynodes: */
- if(0) // XXX nodeDynamicUnlinkText ((ID*)text))
- ; // XXX notifier: allqueue(REDRAWNODE, 0);
-#endif
-
- for(scr= bmain->screen.first; scr; scr= scr->id.next) {
- for(area= scr->areabase.first; area; area= area->next) {
- for(sl= area->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_TEXT) {
- SpaceText *st= (SpaceText*) sl;
-
- if(st->text==text) {
- st->text= NULL;
- st->top= 0;
-
- if(st==area->spacedata.first)
- ED_area_tag_redraw(area);
- }
- }
- }
- }
- }
-
- free_libblock(&bmain->text, text);
-}
-
static int unlink_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
SpaceText *st= CTX_wm_space_text(C);
Text *text= CTX_data_edit_text(C);
@@ -327,7 +291,8 @@ static int unlink_exec(bContext *C, wmOperator *op)
}
}
- text_unlink(CTX_data_main(C), text);
+ unlink_text(bmain, text);
+ free_libblock(&bmain->text, text);
WM_event_add_notifier(C, NC_TEXT|NA_REMOVED, text);
return OPERATOR_FINISHED;
@@ -337,6 +302,7 @@ void TEXT_OT_unlink(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unlink";
+ ot->description= "Unlink active text data block.";
ot->idname= "TEXT_OT_unlink";
/* api callbacks */
@@ -367,6 +333,7 @@ void TEXT_OT_make_internal(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Internal";
+ ot->description= "Make active text file internal.";
ot->idname= "TEXT_OT_make_internal";
/* api callbacks */
@@ -435,6 +402,7 @@ void TEXT_OT_save(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save";
+ ot->description= "Save active text data block.";
ot->idname= "TEXT_OT_save";
/* api callbacks */
@@ -490,6 +458,7 @@ void TEXT_OT_save_as(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save As";
+ ot->description= "Save active text file with options.";
ot->idname= "TEXT_OT_save_as";
/* api callbacks */
@@ -527,6 +496,7 @@ void TEXT_OT_run_script(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Run Script";
+ ot->description= "Run active script.";
ot->idname= "TEXT_OT_run_script";
/* api callbacks */
@@ -541,7 +511,6 @@ static int refresh_pyconstraints_exec(bContext *C, wmOperator *op)
{
#ifndef DISABLE_PYTHON
Text *text= CTX_data_edit_text(C);
- Scene *scene= CTX_data_scene(C);
Object *ob;
bConstraint *con;
short update;
@@ -571,7 +540,7 @@ static int refresh_pyconstraints_exec(bContext *C, wmOperator *op)
}
if(update) {
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
}
#endif
@@ -583,6 +552,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Refresh PyConstraints";
+ ot->description= "Refresh all pyconstraints.";
ot->idname= "TEXT_OT_refresh_pyconstraints";
/* api callbacks */
@@ -704,6 +674,7 @@ void TEXT_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste";
+ ot->description= "Paste text from clipboard.";
ot->idname= "TEXT_OT_paste";
/* api callbacks */
@@ -744,6 +715,7 @@ void TEXT_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy";
+ ot->description= "Copy selected text to clipboard.";
ot->idname= "TEXT_OT_copy";
/* api callbacks */
@@ -774,6 +746,7 @@ void TEXT_OT_cut(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Cut";
+ ot->description= "Cut selected text to clipboard.";
ot->idname= "TEXT_OT_cut";
/* api callbacks */
@@ -809,6 +782,7 @@ void TEXT_OT_indent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Indent";
+ ot->description= "Indent selected text.";
ot->idname= "TEXT_OT_indent";
/* api callbacks */
@@ -844,6 +818,7 @@ void TEXT_OT_unindent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unindent";
+ ot->description= "Unindent selected text.";
ot->idname= "TEXT_OT_unindent";
/* api callbacks */
@@ -884,6 +859,7 @@ void TEXT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Line Break";
+ ot->description= "Insert line break at cursor position.";
ot->idname= "TEXT_OT_line_break";
/* api callbacks */
@@ -916,6 +892,7 @@ void TEXT_OT_comment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Comment";
+ ot->description= "Convert selected text to comment.";
ot->idname= "TEXT_OT_comment";
/* api callbacks */
@@ -949,6 +926,7 @@ void TEXT_OT_uncomment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Uncomment";
+ ot->description= "Convert selected comment to text.";
ot->idname= "TEXT_OT_uncomment";
/* api callbacks */
@@ -1090,6 +1068,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Convert Whitespace";
+ ot->description= "Convert whitespaces by type.";
ot->idname= "TEXT_OT_convert_whitespace";
/* api callbacks */
@@ -1120,6 +1099,7 @@ void TEXT_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select All";
+ ot->description= "Select all text.";
ot->idname= "TEXT_OT_select_all";
/* api callbacks */
@@ -1147,6 +1127,7 @@ void TEXT_OT_select_line(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Line";
+ ot->description= "Select text by line.";
ot->idname= "TEXT_OT_select_line";
/* api clinebacks */
@@ -1184,6 +1165,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Previous Marker";
+ ot->description= "Move to previous marker.";
ot->idname= "TEXT_OT_previous_marker";
/* api callbacks */
@@ -1221,6 +1203,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Next Marker";
+ ot->description= "Move to next marker";
ot->idname= "TEXT_OT_next_marker";
/* api callbacks */
@@ -1248,6 +1231,7 @@ void TEXT_OT_markers_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear All Markers";
+ ot->description= "Clear all markers.";
ot->idname= "TEXT_OT_markers_clear";
/* api callbacks */
@@ -1455,7 +1439,7 @@ static int move_cursor(bContext *C, int type, int select)
ARegion *ar= CTX_wm_region(C);
/* ensure we have the right region, it's optional */
- if(ar->regiontype != RGN_TYPE_WINDOW)
+ if(ar && ar->regiontype != RGN_TYPE_WINDOW)
ar= NULL;
switch(type) {
@@ -1531,6 +1515,7 @@ void TEXT_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
+ ot->description= "Move cursor to position type.";
ot->idname= "TEXT_OT_move";
/* api callbacks */
@@ -1557,6 +1542,7 @@ void TEXT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Select";
+ ot->description= "Make selection from current cursor position to new cursor position type.";
ot->idname= "TEXT_OT_move_select";
/* api callbacks */
@@ -1596,6 +1582,7 @@ void TEXT_OT_jump(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Jump";
+ ot->description= "Jump cursor to line.";
ot->idname= "TEXT_OT_jump";
/* api callbacks */
@@ -1648,6 +1635,7 @@ void TEXT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
+ ot->description= "Delete text by cursor position.";
ot->idname= "TEXT_OT_delete";
/* api callbacks */
@@ -1828,6 +1816,10 @@ void TEXT_OT_scroll(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll";
+ /*don't really see the difference between this and
+ scroll_bar. Both do basically the same thing (aside
+ from keymaps).*/
+ ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll";
/* api callbacks */
@@ -1876,6 +1868,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scrollbar";
+ /*don't really see the difference between this and
+ scroll. Both do basically the same thing (aside
+ from keymaps).*/
+ ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll_bar";
/* api callbacks */
@@ -2151,6 +2147,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Cursor";
+ ot->description= "Set cursor selection.";
ot->idname= "TEXT_OT_cursor_set";
/* api callbacks */
@@ -2274,6 +2271,7 @@ void TEXT_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
+ ot->description= "Insert text at cursor position.";
ot->idname= "TEXT_OT_insert";
/* api callbacks */
@@ -2378,6 +2376,7 @@ void TEXT_OT_find(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find";
+ ot->description= "Find specified text.";
ot->idname= "TEXT_OT_find";
/* api callbacks */
@@ -2396,6 +2395,7 @@ void TEXT_OT_replace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace";
+ ot->description= "Replace text with specified text.";
ot->idname= "TEXT_OT_replace";
/* api callbacks */
@@ -2414,6 +2414,7 @@ void TEXT_OT_mark_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mark All";
+ ot->description= "Mark all specified text.";
ot->idname= "TEXT_OT_mark_all";
/* api callbacks */
@@ -2443,6 +2444,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find Set Selected";
+ ot->description= "Find specified text and set as selected.";
ot->idname= "TEXT_OT_find_set_selected";
/* api callbacks */
@@ -2469,6 +2471,7 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace Set Selected";
+ ot->description= "Replace text with specified text and set as selected.";
ot->idname= "TEXT_OT_replace_set_selected";
/* api callbacks */
@@ -2631,6 +2634,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
{
/* identifiers */
ot->name= "To 3D Object";
+ ot->description= "Create 3d text object from active text data block.";
ot->idname= "TEXT_OT_to_3d_object";
/* api callbacks */