diff options
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_format.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_format.h | 21 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 9 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 3 |
6 files changed, 29 insertions, 26 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index f8dc61f18f2..f449ce50ae3 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -417,7 +417,6 @@ static void text_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, I /********************* registration ********************/ -/* only called once, from space/spacetypes.c */ void ED_spacetype_text(void) { SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype text"); diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 589a8859eeb..8fb55ed9b46 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -200,7 +200,6 @@ int wrap_width(const SpaceText *st, ARegion *region) return max > 8 ? max : 8; } -/* Sets (offl, offc) for transforming (line, curs) to its wrapped position */ void wrap_offset( const SpaceText *st, ARegion *region, TextLine *linein, int cursin, int *offl, int *offc) { @@ -305,7 +304,6 @@ void wrap_offset( } } -/* cursin - mem, offc - view */ void wrap_offset_in_line( const SpaceText *st, ARegion *region, TextLine *linein, int cursin, int *offl, int *offc) { @@ -1754,8 +1752,6 @@ bool ED_text_activate_in_screen(bContext *C, Text *text) return false; } -/* Moves the view to the cursor location, - * also used to make sure the view isn't outside the file */ void ED_text_scroll_to_cursor(SpaceText *st, ARegion *region, const bool center) { Text *text; @@ -1823,7 +1819,6 @@ void ED_text_scroll_to_cursor(SpaceText *st, ARegion *region, const bool center) st->runtime.scroll_ofs_px[1] = 0; } -/* takes an area instead of a region, use for listeners */ void text_scroll_to_cursor__area(SpaceText *st, ScrArea *area, const bool center) { ARegion *region; @@ -1847,9 +1842,6 @@ void text_update_cursor_moved(bContext *C) text_scroll_to_cursor__area(st, area, true); } -/** - * Takes a cursor (row, character) and returns x,y pixel coords. - */ bool ED_text_region_location_from_cursor(SpaceText *st, ARegion *region, const int cursor_co[2], diff --git a/source/blender/editors/space_text/text_format.c b/source/blender/editors/space_text/text_format.c index 66765206fa6..cf0a7c089b5 100644 --- a/source/blender/editors/space_text/text_format.c +++ b/source/blender/editors/space_text/text_format.c @@ -111,7 +111,6 @@ void flatten_string_free(FlattenString *fs) } } -/* takes a string within fs->buf and returns its length */ int flatten_string_strlen(FlattenString *fs, const char *str) { const int len = (fs->pos - (int)(str - fs->buf)) - 1; @@ -119,8 +118,6 @@ int flatten_string_strlen(FlattenString *fs, const char *str) return len; } -/* Ensures the format string for the given line is long enough, reallocating - * as needed. Allocation is done here, alone, to ensure consistency. */ int text_check_format_len(TextLine *line, uint len) { if (line->format) { @@ -142,12 +139,6 @@ int text_check_format_len(TextLine *line, uint len) return 1; } -/** - * Fill the string with formatting constant, - * advancing \a str_p and \a fmt_p - * - * \param len: length in bytes of \a fmt_p to fill. - */ void text_format_fill(const char **str_p, char **fmt_p, const char type, const int len) { const char *str = *str_p; @@ -170,10 +161,6 @@ void text_format_fill(const char **str_p, char **fmt_p, const char type, const i *str_p = str; *fmt_p = fmt; } -/** - * ascii version of #text_format_fill, - * use when we no the text being stepped over is ascii (as is the case for most keywords) - */ void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len) { const char *str = *str_p; diff --git a/source/blender/editors/space_text/text_format.h b/source/blender/editors/space_text/text_format.h index fe7b3328030..01c40b4ed22 100644 --- a/source/blender/editors/space_text/text_format.h +++ b/source/blender/editors/space_text/text_format.h @@ -33,7 +33,9 @@ typedef struct FlattenString { int pos, len; } FlattenString; -/* format continuation flags (stored just after the NULL terminator) */ +/** + * Format continuation flags (stored just after the NULL terminator). + */ enum { FMT_CONT_NOP = 0, /* no continuation */ FMT_CONT_QUOTESINGLE = (1 << 0), /* single quotes */ @@ -48,10 +50,27 @@ enum { int flatten_string(const struct SpaceText *st, FlattenString *fs, const char *in); void flatten_string_free(FlattenString *fs); +/** + * Takes a string within `fs->buf` and returns its length. + */ int flatten_string_strlen(FlattenString *fs, const char *str); +/** + * Ensures the format string for the given line is long enough, reallocating + * as needed. Allocation is done here, alone, to ensure consistency. + */ int text_check_format_len(TextLine *line, unsigned int len); +/** + * Fill the string with formatting constant, + * advancing \a str_p and \a fmt_p + * + * \param len: length in bytes of \a fmt_p to fill. + */ void text_format_fill(const char **str_p, char **fmt_p, const char type, const int len); +/** + * ASCII version of #text_format_fill, + * use when we no the text being stepped over is ascii (as is the case for most keywords) + */ void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len); /* *** Generalize Formatting *** */ diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 241e0133a8a..3cae4188932 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -39,6 +39,9 @@ void draw_text_main(struct SpaceText *st, struct ARegion *region); void text_update_line_edited(struct TextLine *line); void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); +/** + * Takes an area instead of a region, use for listeners. + */ void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *area, const bool center); void text_update_cursor_moved(struct bContext *C); @@ -73,12 +76,18 @@ void text_update_cursor_moved(struct bContext *C); #define TOOL_DOCUMENT 0x02 int wrap_width(const struct SpaceText *st, struct ARegion *region); +/** + * Sets (offl, offc) for transforming (line, curs) to its wrapped position. + */ void wrap_offset(const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc); +/** + * cursin - mem, offc - view. + */ void wrap_offset_in_line(const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index 80af7d8c9f6..3e40593d40e 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -252,8 +252,6 @@ static void text_undosys_foreach_ID_ref(UndoStep *us_p, foreach_ID_ref_fn(user_data, ((UndoRefID *)&us->text_ref)); } -/* Export for ED_undo_sys. */ - void ED_text_undosys_type(UndoType *ut) { ut->name = "Text"; @@ -276,7 +274,6 @@ void ED_text_undosys_type(UndoType *ut) /** \name Utilities * \{ */ -/* Use operator system to finish the undo step. */ UndoStep *ED_text_undo_push_init(bContext *C) { UndoStack *ustack = ED_undo_stack_get(); |