diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-09-16 21:43:09 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-09-16 21:43:09 +0400 |
commit | deebf4f8f0d79169a0e6c2a391670419b6492bfe (patch) | |
tree | 2a0aaf4042aa78e9d1d835f4544e07c6123e67a9 /source/blender/editors/space_text | |
parent | 6b0679a3999d8e5abc60730f523879eadbedcd8f (diff) |
merge with 2.5/trunk at r23271
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 45 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_header.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 189 |
4 files changed, 104 insertions, 143 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 4394fbfe1f5..1f919fc9cd7 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -143,6 +143,10 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_TEXT) + ED_area_tag_redraw(sa); + break; } } @@ -206,50 +210,57 @@ static void text_keymap(struct wmWindowManager *wm) { ListBase *keymap= WM_keymap_listbase(wm, "Text", SPACE_TEXT, 0); + #ifdef __APPLE__ + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0); + #endif + WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_reload", RKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT|KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_run_script", PKEY, KM_PRESS, KM_ALT, 0); - - WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0); if(U.uiflag & USER_MMB_PASTE) // XXX not dynamic RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_paste", MIDDLEMOUSE, KM_PRESS, 0, 0)->ptr, "selection", 1); WM_keymap_add_item(keymap, "TEXT_OT_jump", JKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_to_3d_object", MKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_indent", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_unindent", TABKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "TEXT_OT_uncomment", DKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", HOMEKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_BEGIN); - RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", LINE_BEGIN); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END); - RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); + RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", LINE_BEGIN); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", EKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", LINE_END); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", EKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "type", LINE_END); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END); @@ -264,8 +275,6 @@ static void text_keymap(struct wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", HOMEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", LINE_BEGIN); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", LINE_END); - RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); - RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", PREV_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", PREV_WORD); diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 089436cfcf9..d0a02f558e1 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -186,15 +186,6 @@ ARegion *text_has_properties_region(ScrArea *sa) return arnew; } -void text_toggle_properties_region(bContext *C, ScrArea *sa, ARegion *ar) -{ - ar->flag ^= RGN_FLAG_HIDDEN; - ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ - - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); - ED_area_tag_redraw(sa); -} - static int properties_poll(bContext *C) { return (CTX_wm_space_text(C) != NULL); @@ -206,7 +197,7 @@ static int properties_exec(bContext *C, wmOperator *op) ARegion *ar= text_has_properties_region(sa); if(ar) - text_toggle_properties_region(C, sa, ar); + ED_region_toggle_hidden(C, ar); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index cb425274fc0..4847f2f0741 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -83,8 +83,6 @@ typedef struct FlattenString { int flatten_string(struct SpaceText *st, FlattenString *fs, char *in); void flatten_string_free(FlattenString *fs); -void unlink_text(struct Text *text); - int wrap_width(struct SpaceText *st, struct ARegion *ar); void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 7e514ea723a..3568f50dfe1 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -176,9 +176,9 @@ void TEXT_OT_new(wmOperatorType *ot) { /* identifiers */ ot->name= "New"; - ot->description= "Create a new text data block."; ot->idname= "TEXT_OT_new"; - + ot->description= "Create a new text data block."; + /* api callbacks */ ot->exec= new_exec; ot->poll= text_new_poll; @@ -192,7 +192,7 @@ static int open_exec(bContext *C, wmOperator *op) Text *text; char str[FILE_MAX]; - RNA_string_get(op->ptr, "filename", str); + RNA_string_get(op->ptr, "path", str); text= add_text(str, G.sce); @@ -211,10 +211,10 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) Text *text= CTX_data_edit_text(C); char *path= (text && text->name)? text->name: G.sce; - if(RNA_property_is_set(op->ptr, "filename")) + if(RNA_property_is_set(op->ptr, "path")) return open_exec(C, op); - RNA_string_set(op->ptr, "filename", path); + RNA_string_set(op->ptr, "path", path); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -224,8 +224,8 @@ void TEXT_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open"; - ot->description= "Open a new text data block."; ot->idname= "TEXT_OT_open"; + ot->description= "Open a new text data block."; /* api callbacks */ ot->exec= open_exec; @@ -233,7 +233,7 @@ void TEXT_OT_open(wmOperatorType *ot) ot->poll= text_new_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL); } /******************* reload operator *********************/ @@ -262,9 +262,9 @@ 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"; - + ot->description= "Reload active text data block from its file."; + /* api callbacks */ ot->exec= reload_exec; ot->invoke= WM_operator_confirm; @@ -273,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); @@ -330,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; @@ -340,9 +302,9 @@ void TEXT_OT_unlink(wmOperatorType *ot) { /* identifiers */ ot->name= "Unlink"; - ot->description= "Unlink active text data block."; ot->idname= "TEXT_OT_unlink"; - + ot->description= "Unlink active text data block."; + /* api callbacks */ ot->exec= unlink_exec; ot->invoke= WM_operator_confirm; @@ -371,8 +333,8 @@ 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"; + ot->description= "Make active text file internal."; /* api callbacks */ ot->exec= make_internal_exec; @@ -440,8 +402,8 @@ void TEXT_OT_save(wmOperatorType *ot) { /* identifiers */ ot->name= "Save"; - ot->description= "Save active text data block."; ot->idname= "TEXT_OT_save"; + ot->description= "Save active text data block."; /* api callbacks */ ot->exec= save_exec; @@ -458,7 +420,7 @@ static int save_as_exec(bContext *C, wmOperator *op) if(!text) return OPERATOR_CANCELLED; - RNA_string_get(op->ptr, "filename", str); + RNA_string_get(op->ptr, "path", str); if(text->name) MEM_freeN(text->name); text->name= BLI_strdup(str); @@ -476,7 +438,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) Text *text= CTX_data_edit_text(C); char *str; - if(RNA_property_is_set(op->ptr, "filename")) + if(RNA_property_is_set(op->ptr, "path")) return save_as_exec(C, op); if(text->name) @@ -486,7 +448,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) else str= G.sce; - RNA_string_set(op->ptr, "filename", str); + RNA_string_set(op->ptr, "path", str); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -496,16 +458,16 @@ 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"; - + ot->description= "Save active text file with options."; + /* api callbacks */ ot->exec= save_as_exec; ot->invoke= save_as_invoke; ot->poll= text_edit_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL); } /******************* run script operator *********************/ @@ -534,9 +496,9 @@ void TEXT_OT_run_script(wmOperatorType *ot) { /* identifiers */ ot->name= "Run Script"; - ot->description= "Run active script."; ot->idname= "TEXT_OT_run_script"; - + ot->description= "Run active script."; + /* api callbacks */ ot->exec= run_script_exec; ot->poll= text_edit_poll; @@ -549,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; @@ -579,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 @@ -591,9 +552,9 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot) { /* identifiers */ ot->name= "Refresh PyConstraints"; - ot->description= "Refresh all pyconstraints."; ot->idname= "TEXT_OT_refresh_pyconstraints"; - + ot->description= "Refresh all pyconstraints."; + /* api callbacks */ ot->exec= refresh_pyconstraints_exec; ot->poll= text_edit_poll; @@ -713,9 +674,9 @@ void TEXT_OT_paste(wmOperatorType *ot) { /* identifiers */ ot->name= "Paste"; - ot->description= "Paste text from clipboard."; ot->idname= "TEXT_OT_paste"; - + ot->description= "Paste text from clipboard."; + /* api callbacks */ ot->exec= paste_exec; ot->poll= text_edit_poll; @@ -754,8 +715,8 @@ void TEXT_OT_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy"; - ot->description= "Copy selected text to clipboard."; ot->idname= "TEXT_OT_copy"; + ot->description= "Copy selected text to clipboard."; /* api callbacks */ ot->exec= copy_exec; @@ -785,9 +746,9 @@ void TEXT_OT_cut(wmOperatorType *ot) { /* identifiers */ ot->name= "Cut"; - ot->description= "Cut selected text to clipboard."; ot->idname= "TEXT_OT_cut"; - + ot->description= "Cut selected text to clipboard."; + /* api callbacks */ ot->exec= cut_exec; ot->poll= text_edit_poll; @@ -821,9 +782,9 @@ void TEXT_OT_indent(wmOperatorType *ot) { /* identifiers */ ot->name= "Indent"; - ot->description= "Indent selected text."; ot->idname= "TEXT_OT_indent"; - + ot->description= "Indent selected text."; + /* api callbacks */ ot->exec= indent_exec; ot->poll= text_edit_poll; @@ -857,9 +818,9 @@ void TEXT_OT_unindent(wmOperatorType *ot) { /* identifiers */ ot->name= "Unindent"; - ot->description= "Unindent selected text."; ot->idname= "TEXT_OT_unindent"; - + ot->description= "Unindent selected text."; + /* api callbacks */ ot->exec= unindent_exec; ot->poll= text_edit_poll; @@ -898,9 +859,9 @@ 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"; - + ot->description= "Insert line break at cursor position."; + /* api callbacks */ ot->exec= line_break_exec; ot->poll= text_edit_poll; @@ -931,9 +892,9 @@ void TEXT_OT_comment(wmOperatorType *ot) { /* identifiers */ ot->name= "Comment"; - ot->description= "Convert selected text to comment."; ot->idname= "TEXT_OT_comment"; - + ot->description= "Convert selected text to comment."; + /* api callbacks */ ot->exec= comment_exec; ot->poll= text_edit_poll; @@ -965,9 +926,9 @@ void TEXT_OT_uncomment(wmOperatorType *ot) { /* identifiers */ ot->name= "Uncomment"; - ot->description= "Convert selected comment to text."; ot->idname= "TEXT_OT_uncomment"; - + ot->description= "Convert selected comment to text."; + /* api callbacks */ ot->exec= uncomment_exec; ot->poll= text_edit_poll; @@ -1107,9 +1068,9 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) { /* identifiers */ ot->name= "Convert Whitespace"; - ot->description= "Convert whitespaces by type."; ot->idname= "TEXT_OT_convert_whitespace"; - + ot->description= "Convert whitespaces by type."; + /* api callbacks */ ot->exec= convert_whitespace_exec; ot->poll= text_edit_poll; @@ -1138,9 +1099,9 @@ void TEXT_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->description= "Select all text."; ot->idname= "TEXT_OT_select_all"; - + ot->description= "Select all text."; + /* api callbacks */ ot->exec= select_all_exec; ot->poll= text_edit_poll; @@ -1166,9 +1127,9 @@ void TEXT_OT_select_line(wmOperatorType *ot) { /* identifiers */ ot->name= "Select Line"; - ot->description= "Select text by line."; ot->idname= "TEXT_OT_select_line"; - + ot->description= "Select text by line."; + /* api clinebacks */ ot->exec= select_line_exec; ot->poll= text_edit_poll; @@ -1204,9 +1165,9 @@ void TEXT_OT_previous_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Previous Marker"; - ot->description= "Move to previous marker."; ot->idname= "TEXT_OT_previous_marker"; - + ot->description= "Move to previous marker."; + /* api callbacks */ ot->exec= previous_marker_exec; ot->poll= text_edit_poll; @@ -1242,9 +1203,9 @@ void TEXT_OT_next_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Next Marker"; - ot->description= "Move to next marker"; ot->idname= "TEXT_OT_next_marker"; - + ot->description= "Move to next marker"; + /* api callbacks */ ot->exec= next_marker_exec; ot->poll= text_edit_poll; @@ -1270,9 +1231,9 @@ void TEXT_OT_markers_clear(wmOperatorType *ot) { /* identifiers */ ot->name= "Clear All Markers"; - ot->description= "Clear all markers."; ot->idname= "TEXT_OT_markers_clear"; - + ot->description= "Clear all markers."; + /* api callbacks */ ot->exec= clear_all_markers_exec; ot->poll= text_edit_poll; @@ -1478,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) { @@ -1554,8 +1515,8 @@ void TEXT_OT_move(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Cursor"; - ot->description= "Move cursor to position type."; ot->idname= "TEXT_OT_move"; + ot->description= "Move cursor to position type."; /* api callbacks */ ot->exec= move_exec; @@ -1581,8 +1542,8 @@ 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"; + ot->description= "Make selection from current cursor position to new cursor position type."; /* api callbacks */ ot->exec= move_select_exec; @@ -1621,9 +1582,9 @@ void TEXT_OT_jump(wmOperatorType *ot) { /* identifiers */ ot->name= "Jump"; - ot->description= "Jump cursor to line."; ot->idname= "TEXT_OT_jump"; - + ot->description= "Jump cursor to line."; + /* api callbacks */ ot->exec= jump_exec; ot->poll= text_edit_poll; @@ -1674,8 +1635,8 @@ void TEXT_OT_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; - ot->description= "Delete text by cursor position."; ot->idname= "TEXT_OT_delete"; + ot->description= "Delete text by cursor position."; /* api callbacks */ ot->exec= delete_exec; @@ -1704,6 +1665,7 @@ void TEXT_OT_overwrite_toggle(wmOperatorType *ot) /* identifiers */ ot->name= "Toggle Overwrite"; ot->idname= "TEXT_OT_overwrite_toggle"; + ot->description= "Toggle overwrite while typing."; /* api callbacks */ ot->exec= toggle_overwrite_exec; @@ -1858,8 +1820,8 @@ void TEXT_OT_scroll(wmOperatorType *ot) /*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"; + ot->description= "Scroll text screen."; /* api callbacks */ ot->exec= scroll_exec; @@ -1910,8 +1872,8 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) /*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"; + ot->description= "Scroll text screen."; /* api callbacks */ ot->invoke= scroll_bar_invoke; @@ -2186,8 +2148,8 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) { /* identifiers */ ot->name= "Set Cursor"; - ot->description= "Set cursor selection."; ot->idname= "TEXT_OT_cursor_set"; + ot->description= "Set cursor selection."; /* api callbacks */ ot->invoke= set_cursor_invoke; @@ -2243,6 +2205,7 @@ void TEXT_OT_line_number(wmOperatorType *ot) /* identifiers */ ot->name= "Line Number"; ot->idname= "TEXT_OT_line_number"; + ot->description= "The current line number."; /* api callbacks */ ot->invoke= line_number_invoke; @@ -2310,8 +2273,8 @@ void TEXT_OT_insert(wmOperatorType *ot) { /* identifiers */ ot->name= "Insert"; - ot->description= "Insert text at cursor position."; ot->idname= "TEXT_OT_insert"; + ot->description= "Insert text at cursor position."; /* api callbacks */ ot->exec= insert_exec; @@ -2415,9 +2378,9 @@ void TEXT_OT_find(wmOperatorType *ot) { /* identifiers */ ot->name= "Find"; - ot->description= "Find specified text."; ot->idname= "TEXT_OT_find"; - + ot->description= "Find specified text."; + /* api callbacks */ ot->exec= find_exec; ot->poll= text_space_edit_poll; @@ -2434,8 +2397,8 @@ void TEXT_OT_replace(wmOperatorType *ot) { /* identifiers */ ot->name= "Replace"; - ot->description= "Replace text with specified text."; ot->idname= "TEXT_OT_replace"; + ot->description= "Replace text with the specified text."; /* api callbacks */ ot->exec= replace_exec; @@ -2453,9 +2416,9 @@ void TEXT_OT_mark_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Mark All"; - ot->description= "Mark all specified text."; ot->idname= "TEXT_OT_mark_all"; - + ot->description= "Mark all specified text."; + /* api callbacks */ ot->exec= mark_all_exec; ot->poll= text_space_edit_poll; @@ -2483,9 +2446,9 @@ 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"; - + ot->description= "Find specified text and set as selected."; + /* api callbacks */ ot->exec= find_set_selected_exec; ot->poll= text_space_edit_poll; @@ -2510,9 +2473,9 @@ 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"; - + ot->description= "Replace text with specified text and set as selected."; + /* api callbacks */ ot->exec= replace_set_selected_exec; ot->poll= text_space_edit_poll; @@ -2673,8 +2636,8 @@ 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"; + ot->description= "Create 3d text object from active text data block."; /* api callbacks */ ot->exec= to_3d_object_exec; |