Blender V2.61 - r43446

text_intern.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version. 
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2009 Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * 
00022  * Contributor(s): Blender Foundation
00023  *
00024  * ***** END GPL LICENSE BLOCK *****
00025  */
00026 
00031 #ifndef ED_TEXT_INTERN_H
00032 #define ED_TEXT_INTERN_H
00033 
00034 /* internal exports only */
00035 
00036 struct ARegion;
00037 struct ARegionType;
00038 struct bContext;
00039 struct ReportList;
00040 struct ScrArea;
00041 struct SpaceText;
00042 struct Text;
00043 struct TextLine;
00044 struct wmOperatorType;
00045 struct wmWindowManager;
00046 
00047 /* text_draw.c */
00048 void draw_text_main(struct SpaceText *st, struct ARegion *ar);
00049 
00050 void text_update_line_edited(struct TextLine *line);
00051 void text_update_edited(struct Text *text);
00052 void text_update_character_width(struct SpaceText *st);
00053 void text_scroll_to_cursor(struct SpaceText *st, struct ScrArea *sa);
00054 void text_update_cursor_moved(struct bContext *C);
00055 
00056     /* TXT_OFFSET used to be 35 when the scrollbar was on the left... */
00057 #define TXT_OFFSET 15
00058 #define TXT_SCROLL_WIDTH 20
00059 #define TXT_SCROLL_SPACE 2
00060 
00061 #define TEXTXLOC        (st->cwidth * st->linenrs_tot)
00062 
00063 #define SUGG_LIST_SIZE  7
00064 #define SUGG_LIST_WIDTH 20
00065 #define DOC_WIDTH       40
00066 #define DOC_HEIGHT      10
00067 
00068 #define TOOL_SUGG_LIST  0x01
00069 #define TOOL_DOCUMENT   0x02
00070 
00071 #define TMARK_GRP_CUSTOM    0x00010000  /* Lower 2 bytes used for Python groups */
00072 #define TMARK_GRP_FINDALL   0x00020000
00073 
00074 typedef struct FlattenString {
00075     char fixedbuf[256];
00076     int fixedaccum[256];
00077 
00078     char *buf;
00079     int *accum;
00080     int pos, len;
00081 } FlattenString;
00082 
00083 int flatten_string(struct SpaceText *st, FlattenString *fs, const char *in);
00084 void flatten_string_free(FlattenString *fs);
00085 
00086 int wrap_width(struct SpaceText *st, struct ARegion *ar);
00087 void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc);
00088 void wrap_offset_in_line(struct SpaceText *st, struct ARegion *ar, struct TextLine *linep, int cursin, int *offl, int *offc);
00089 int text_get_char_pos(struct SpaceText *st, const char *line, int cur);
00090 
00091 void text_drawcache_tag_update(struct SpaceText *st, int full);
00092 void text_free_caches(struct SpaceText *st);
00093 
00094 int text_file_modified(struct Text *text);
00095 
00096 int text_do_suggest_select(struct SpaceText *st, struct ARegion *ar);
00097 void text_pop_suggest_list(void);
00098 
00099 int text_get_visible_lines(struct SpaceText *st, struct ARegion *ar, const char *str);
00100 int text_get_span_wrap(struct SpaceText *st, struct ARegion *ar, struct TextLine *from, struct TextLine *to);
00101 int text_get_total_lines(struct SpaceText *st, struct ARegion *ar);
00102 
00103 /* text_ops.c */
00104 enum { LINE_BEGIN, LINE_END, FILE_TOP, FILE_BOTTOM, PREV_CHAR, NEXT_CHAR,
00105        PREV_WORD, NEXT_WORD, PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE };
00106 enum { DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_NEXT_WORD, DEL_PREV_WORD };
00107 
00108 void TEXT_OT_new(struct wmOperatorType *ot);
00109 void TEXT_OT_open(struct wmOperatorType *ot);
00110 void TEXT_OT_reload(struct wmOperatorType *ot);
00111 void TEXT_OT_unlink(struct wmOperatorType *ot);
00112 void TEXT_OT_save(struct wmOperatorType *ot);
00113 void TEXT_OT_save_as(struct wmOperatorType *ot);
00114 void TEXT_OT_make_internal(struct wmOperatorType *ot);
00115 void TEXT_OT_run_script(struct wmOperatorType *ot);
00116 void TEXT_OT_refresh_pyconstraints(struct wmOperatorType *ot);
00117 
00118 void TEXT_OT_paste(struct wmOperatorType *ot);
00119 void TEXT_OT_copy(struct wmOperatorType *ot);
00120 void TEXT_OT_cut(struct wmOperatorType *ot);
00121 
00122 void TEXT_OT_convert_whitespace(struct wmOperatorType *ot);
00123 void TEXT_OT_uncomment(struct wmOperatorType *ot);
00124 void TEXT_OT_comment(struct wmOperatorType *ot);
00125 void TEXT_OT_unindent(struct wmOperatorType *ot);
00126 void TEXT_OT_indent(struct wmOperatorType *ot);
00127 
00128 void TEXT_OT_line_break(struct wmOperatorType *ot);
00129 void TEXT_OT_insert(struct wmOperatorType *ot);
00130 
00131 void TEXT_OT_markers_clear(struct wmOperatorType *ot);
00132 void TEXT_OT_next_marker(struct wmOperatorType *ot);
00133 void TEXT_OT_previous_marker(struct wmOperatorType *ot);
00134 
00135 void TEXT_OT_select_line(struct wmOperatorType *ot);
00136 void TEXT_OT_select_all(struct wmOperatorType *ot);
00137 void TEXT_OT_select_word(struct wmOperatorType *ot);
00138 
00139 void TEXT_OT_jump(struct wmOperatorType *ot);
00140 void TEXT_OT_move(struct wmOperatorType *ot);
00141 void TEXT_OT_move_select(struct wmOperatorType *ot);
00142 void TEXT_OT_delete(struct wmOperatorType *ot);
00143 void TEXT_OT_overwrite_toggle(struct wmOperatorType *ot);
00144 
00145 void TEXT_OT_scroll(struct wmOperatorType *ot);
00146 void TEXT_OT_scroll_bar(struct wmOperatorType *ot);
00147 void TEXT_OT_selection_set(struct wmOperatorType *ot);
00148 void TEXT_OT_cursor_set(struct wmOperatorType *ot);
00149 void TEXT_OT_line_number(struct wmOperatorType *ot);
00150 
00151 void TEXT_OT_properties(struct wmOperatorType *ot);
00152 
00153 void TEXT_OT_find(struct wmOperatorType *ot);
00154 void TEXT_OT_find_set_selected(struct wmOperatorType *ot);
00155 void TEXT_OT_replace(struct wmOperatorType *ot);
00156 void TEXT_OT_replace_set_selected(struct wmOperatorType *ot);
00157 void TEXT_OT_mark_all(struct wmOperatorType *ot);
00158 
00159 void TEXT_OT_to_3d_object(struct wmOperatorType *ot);
00160 
00161 void TEXT_OT_resolve_conflict(struct wmOperatorType *ot);
00162 
00163 /* space_text.c */
00164 extern const char *text_context_dir[]; /* doc access */
00165 
00166 #endif /* ED_TEXT_INTERN_H */
00167