34 #define TXT_NUMCOL_PAD 1.0f
36 #define TXT_NUMCOL_WIDTH(st) \
37 ((st)->runtime.cwidth_px * ((st)->runtime.line_number_display_digits + (2 * TXT_NUMCOL_PAD)))
40 #define TXT_BODY_LPAD 1.0f
42 #define TXT_BODY_LEFT(st) \
43 ((st)->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * (st)->runtime.cwidth_px)
45 #define TXT_SCROLL_WIDTH U.widget_unit
46 #define TXT_SCROLL_SPACE ((int)(0.1f * U.widget_unit))
49 #define TXT_LINE_VPAD 0.3f
51 #define TXT_LINE_SPACING(st) ((int)(TXT_LINE_VPAD * st->runtime.lheight_px))
53 #define TXT_LINE_HEIGHT(st) ((int)((1.0f + TXT_LINE_VPAD) * st->runtime.lheight_px))
55 #define SUGG_LIST_SIZE 7
56 #define SUGG_LIST_WIDTH 20
60 #define TOOL_SUGG_LIST 0x01
61 #define TOOL_DOCUMENT 0x02
NSNotificationCenter * center
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void text_pop_suggest_list(void)
void TEXT_OT_delete(struct wmOperatorType *ot)
const char * text_context_dir[]
void TEXT_OT_indent_or_autocomplete(struct wmOperatorType *ot)
int text_get_span_wrap(const struct SpaceText *st, struct ARegion *region, struct TextLine *from, struct TextLine *to)
void TEXT_OT_selection_set(struct wmOperatorType *ot)
void TEXT_OT_save(struct wmOperatorType *ot)
void text_free_caches(struct SpaceText *st)
void text_update_line_edited(struct TextLine *line)
void TEXT_OT_replace(struct wmOperatorType *ot)
void TEXT_OT_select_line(struct wmOperatorType *ot)
void TEXT_OT_paste(struct wmOperatorType *ot)
void TEXT_OT_find_set_selected(struct wmOperatorType *ot)
void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *area, bool center)
void TEXT_OT_new(struct wmOperatorType *ot)
int text_get_total_lines(struct SpaceText *st, struct ARegion *region)
void TEXT_OT_line_break(struct wmOperatorType *ot)
void TEXT_OT_cut(struct wmOperatorType *ot)
void TEXT_OT_overwrite_toggle(struct wmOperatorType *ot)
void TEXT_OT_move_select(struct wmOperatorType *ot)
void text_update_cursor_moved(struct bContext *C)
void wrap_offset_in_line(const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc)
void TEXT_OT_select_word(struct wmOperatorType *ot)
void TEXT_OT_scroll_bar(struct wmOperatorType *ot)
void TEXT_OT_line_number(struct wmOperatorType *ot)
void TEXT_OT_unlink(struct wmOperatorType *ot)
void TEXT_OT_move_lines(struct wmOperatorType *ot)
bool text_do_suggest_select(struct SpaceText *st, struct ARegion *region, const int mval[2])
void text_update_edited(struct Text *text)
void TEXT_OT_copy(struct wmOperatorType *ot)
void TEXT_OT_make_internal(struct wmOperatorType *ot)
void TEXT_OT_run_script(struct wmOperatorType *ot)
void wrap_offset(const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc)
void TEXT_OT_jump(struct wmOperatorType *ot)
void TEXT_OT_insert(struct wmOperatorType *ot)
void TEXT_OT_unindent(struct wmOperatorType *ot)
void TEXT_OT_autocomplete(struct wmOperatorType *ot)
void TEXT_OT_resolve_conflict(struct wmOperatorType *ot)
void TEXT_OT_convert_whitespace(struct wmOperatorType *ot)
void TEXT_OT_indent(struct wmOperatorType *ot)
int wrap_width(const struct SpaceText *st, struct ARegion *region)
void TEXT_OT_save_as(struct wmOperatorType *ot)
bool text_space_edit_poll(struct bContext *C)
void TEXT_OT_refresh_pyconstraints(struct wmOperatorType *ot)
void TEXT_OT_cursor_set(struct wmOperatorType *ot)
void TEXT_OT_replace_set_selected(struct wmOperatorType *ot)
void TEXT_OT_start_find(struct wmOperatorType *ot)
void draw_text_main(struct SpaceText *st, struct ARegion *region)
void TEXT_OT_select_all(struct wmOperatorType *ot)
void TEXT_OT_open(struct wmOperatorType *ot)
void TEXT_OT_find(struct wmOperatorType *ot)
void TEXT_OT_scroll(struct wmOperatorType *ot)
void TEXT_OT_comment_toggle(struct wmOperatorType *ot)
int text_get_visible_lines(const struct SpaceText *st, struct ARegion *region, const char *str)
void TEXT_OT_move(struct wmOperatorType *ot)
void text_drawcache_tag_update(struct SpaceText *st, int full)
void TEXT_OT_reload(struct wmOperatorType *ot)
int text_get_char_pos(const struct SpaceText *st, const char *line, int cur)
void TEXT_OT_duplicate_line(struct wmOperatorType *ot)
void text_update_character_width(struct SpaceText *st)
void TEXT_OT_to_3d_object(struct wmOperatorType *ot)