Blender  V3.3
Classes
text_ops.c File Reference
#include <errno.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_text_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_math_base.h"
#include "BLT_translation.h"
#include "PIL_time.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_text.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_screen.h"
#include "ED_text.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "text_format.h"
#include "text_intern.h"

Go to the source code of this file.

Classes

struct  TextScroll
 
struct  SetSelection
 

Functions

Util
static void test_line_start (char c, bool *r_last_state)
 
static char text_closing_character_pair_get (const char character)
 
static char * buf_tabs_to_spaces (const char *in_buf, const int tab_size, int *r_out_buf_len)
 
BLI_INLINE int text_pixel_x_to_column (SpaceText *st, const int x)
 
Operator Poll
static bool text_new_poll (bContext *UNUSED(C))
 
static bool text_data_poll (bContext *C)
 
static bool text_edit_poll (bContext *C)
 
bool text_space_edit_poll (bContext *C)
 
static bool text_region_edit_poll (bContext *C)
 
Updates
void text_update_line_edited (TextLine *line)
 
void text_update_edited (Text *text)
 
New Operator
static int text_new_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_new (wmOperatorType *ot)
 
Open Operator
static void text_open_init (bContext *C, wmOperator *op)
 
static void text_open_cancel (bContext *UNUSED(C), wmOperator *op)
 
static int text_open_exec (bContext *C, wmOperator *op)
 
static int text_open_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void TEXT_OT_open (wmOperatorType *ot)
 
Reload Operator
static int text_reload_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_reload (wmOperatorType *ot)
 
Make Internal Operator
static int text_make_internal_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_make_internal (wmOperatorType *ot)
 
Save Operator
static void txt_write_file (Main *bmain, Text *text, ReportList *reports)
 
static int text_save_exec (bContext *C, wmOperator *op)
 
static int text_save_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void TEXT_OT_save (wmOperatorType *ot)
 
Save As Operator
static int text_save_as_exec (bContext *C, wmOperator *op)
 
static int text_save_as_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void TEXT_OT_save_as (wmOperatorType *ot)
 
Run Script Operator
static int text_run_script (bContext *C, ReportList *reports)
 
static int text_run_script_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_run_script (wmOperatorType *ot)
 
Refresh Pyconstraints Operator
static int text_refresh_pyconstraints_exec (bContext *UNUSED(C), wmOperator *UNUSED(op))
 
void TEXT_OT_refresh_pyconstraints (wmOperatorType *ot)
 
Paste Operator
static int text_paste_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_paste (wmOperatorType *ot)
 
Duplicate Operator
static int text_duplicate_line_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_duplicate_line (wmOperatorType *ot)
 
Copy Operator
static void txt_copy_clipboard (Text *text)
 
static int text_copy_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_copy (wmOperatorType *ot)
 
Cut Operator
static int text_cut_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_cut (wmOperatorType *ot)
 
Indent or Autocomplete Operator
static int text_indent_or_autocomplete_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_indent_or_autocomplete (wmOperatorType *ot)
 
Indent Operator
static int text_indent_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_indent (wmOperatorType *ot)
 
Unindent Operator
static int text_unindent_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_unindent (wmOperatorType *ot)
 
Line Break Operator
static int text_line_break_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_line_break (wmOperatorType *ot)
 
Toggle-Comment Operator
static int text_comment_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_comment_toggle (wmOperatorType *ot)
 
Select All Operator
static int text_select_all_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_select_all (wmOperatorType *ot)
 
Select Line Operator
static int text_select_line_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_select_line (wmOperatorType *ot)
 
Select Word Operator
static int text_select_word_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_select_word (wmOperatorType *ot)
 
Move Lines Operators
static int move_lines_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_move_lines (wmOperatorType *ot)
 
Move Select Operator
static int text_move_select_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_move_select (wmOperatorType *ot)
 
Jump Operator
static int text_jump_exec (bContext *C, wmOperator *op)
 
static int text_jump_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void TEXT_OT_jump (wmOperatorType *ot)
 
Toggle Overwrite Operator
static int text_toggle_overwrite_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_overwrite_toggle (wmOperatorType *ot)
 
Scroll Bar Operator
static bool text_region_scroll_poll (bContext *C)
 
static int text_scroll_bar_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void TEXT_OT_scroll_bar (wmOperatorType *ot)
 
Set Cursor Operator
static int text_cursor_set_exec (bContext *C, wmOperator *op)
 
static int text_cursor_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void TEXT_OT_cursor_set (wmOperatorType *ot)
 
Line Number Operator
static int text_line_number_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void TEXT_OT_line_number (wmOperatorType *ot)
 
Insert Operator
static int text_insert_exec (bContext *C, wmOperator *op)
 
static int text_insert_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void TEXT_OT_insert (wmOperatorType *ot)
 
Replace Operator
static int text_replace_all (bContext *C)
 
static int text_replace_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_replace (wmOperatorType *ot)
 
Find Set Selected
static int text_find_set_selected_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_find_set_selected (wmOperatorType *ot)
 
Replace Set Selected
static int text_replace_set_selected_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_replace_set_selected (wmOperatorType *ot)
 
To 3D Object Operator
static int text_to_3d_object_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_to_3d_object (wmOperatorType *ot)
 

Find Operator

#define TEXT_FIND   0
 
#define TEXT_REPLACE   1
 
static int text_find_and_replace (bContext *C, wmOperator *op, short mode)
 
static int text_find_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_find (wmOperatorType *ot)
 

Convert Whitespace Operator

enum  { TO_SPACES , TO_TABS }
 
static const EnumPropertyItem whitespace_type_items []
 
static int text_convert_whitespace_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_convert_whitespace (wmOperatorType *ot)
 

Scroll Operator

enum  eScrollZone { SCROLLHANDLE_INVALID_OUTSIDE = -1 , SCROLLHANDLE_BAR , SCROLLHANDLE_MIN_OUTSIDE , SCROLLHANDLE_MAX_OUTSIDE }
 
typedef struct TextScroll TextScroll
 
static void txt_screen_clamp (SpaceText *st, ARegion *region)
 
static void txt_screen_skip (SpaceText *st, ARegion *region, int lines)
 
static void text_scroll_state_init (TextScroll *tsc, SpaceText *st, ARegion *region)
 
static bool text_scroll_poll (bContext *C)
 
static int text_scroll_exec (bContext *C, wmOperator *op)
 
static void text_scroll_apply (bContext *C, wmOperator *op, const wmEvent *event)
 
static void scroll_exit (bContext *C, wmOperator *op)
 
static int text_scroll_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void text_scroll_cancel (bContext *C, wmOperator *op)
 
static int text_scroll_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void TEXT_OT_scroll (wmOperatorType *ot)
 

Resolve Conflict Operator

enum  { RESOLVE_IGNORE , RESOLVE_RELOAD , RESOLVE_SAVE , RESOLVE_MAKE_INTERNAL }
 
static const EnumPropertyItem resolution_items []
 
static bool text_resolve_conflict_poll (bContext *C)
 
static int text_resolve_conflict_exec (bContext *C, wmOperator *op)
 
static int text_resolve_conflict_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void TEXT_OT_resolve_conflict (wmOperatorType *ot)
 

Set Selection Operator

typedef struct SetSelection SetSelection
 
static int flatten_width (SpaceText *st, const char *str)
 
static int flatten_column_to_offset (SpaceText *st, const char *str, int index)
 
static TextLineget_line_pos_wrapped (SpaceText *st, ARegion *region, int *y)
 
static void text_cursor_set_to_pos_wrapped (SpaceText *st, ARegion *region, int x, int y, const bool sel)
 
static void text_cursor_set_to_pos (SpaceText *st, ARegion *region, int x, int y, const bool sel)
 
static void text_cursor_timer_ensure (bContext *C, SetSelection *ssel)
 
static void text_cursor_timer_remove (bContext *C, SetSelection *ssel)
 
static void text_cursor_set_apply (bContext *C, wmOperator *op, const wmEvent *event)
 
static void text_cursor_set_exit (bContext *C, wmOperator *op)
 
static int text_selection_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int text_selection_set_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void text_selection_set_cancel (bContext *C, wmOperator *op)
 
void TEXT_OT_selection_set (wmOperatorType *ot)
 

Move Operator

static const EnumPropertyItem move_type_items []
 
static int text_get_cursor_rel (SpaceText *st, ARegion *region, TextLine *linein, int rell, int relc)
 
static int cursor_skip_find_line (SpaceText *st, ARegion *region, int lines, TextLine **linep, int *charp, int *rell, int *relc)
 
static void txt_wrap_move_bol (SpaceText *st, ARegion *region, const bool sel)
 
static void txt_wrap_move_eol (SpaceText *st, ARegion *region, const bool sel)
 
static void txt_wrap_move_up (SpaceText *st, ARegion *region, const bool sel)
 
static void txt_wrap_move_down (SpaceText *st, ARegion *region, const bool sel)
 
static void cursor_skip (SpaceText *st, ARegion *region, Text *text, int lines, const bool sel)
 
static int text_move_cursor (bContext *C, int type, bool select)
 
static int text_move_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_move (wmOperatorType *ot)
 

Delete Operator

static const EnumPropertyItem delete_type_items []
 
static bool text_unlink_poll (bContext *C)
 
static int text_unlink_exec (bContext *C, wmOperator *UNUSED(op))
 
void TEXT_OT_unlink (wmOperatorType *ot)
 
static int text_delete_exec (bContext *C, wmOperator *op)
 
void TEXT_OT_delete (wmOperatorType *ot)
 

Macro Definition Documentation

◆ TEXT_FIND

#define TEXT_FIND   0

Definition at line 3558 of file text_ops.c.

◆ TEXT_REPLACE

#define TEXT_REPLACE   1

Definition at line 3559 of file text_ops.c.

Typedef Documentation

◆ SetSelection

typedef struct SetSelection SetSelection

◆ TextScroll

typedef struct TextScroll TextScroll

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TO_SPACES 
TO_TABS 

Definition at line 1339 of file text_ops.c.

◆ anonymous enum

anonymous enum
Enumerator
RESOLVE_IGNORE 
RESOLVE_RELOAD 
RESOLVE_SAVE 
RESOLVE_MAKE_INTERNAL 

Definition at line 3801 of file text_ops.c.

◆ eScrollZone

Enumerator
SCROLLHANDLE_INVALID_OUTSIDE 
SCROLLHANDLE_BAR 
SCROLLHANDLE_MIN_OUTSIDE 
SCROLLHANDLE_MAX_OUTSIDE 

Definition at line 2546 of file text_ops.c.

Function Documentation

◆ buf_tabs_to_spaces()

static char* buf_tabs_to_spaces ( const char *  in_buf,
const int  tab_size,
int *  r_out_buf_len 
)
static

This function converts the indentation tabs from a buffer to spaces.

Parameters
in_bufA pointer to a cstring.
tab_sizeThe size, in spaces, of the tab character.
r_out_buf_lenThe #strlen of the returned buffer.

Definition at line 102 of file text_ops.c.

References MEM_mallocN, and test_line_start().

Referenced by text_paste_exec().

◆ cursor_skip()

static void cursor_skip ( SpaceText st,
ARegion region,
Text text,
int  lines,
const bool  sel 
)
static

◆ cursor_skip_find_line()

static int cursor_skip_find_line ( SpaceText st,
ARegion region,
int  lines,
TextLine **  linep,
int *  charp,
int *  rell,
int *  relc 
)
static

◆ flatten_column_to_offset()

static int flatten_column_to_offset ( SpaceText st,
const char *  str,
int  index 
)
static

◆ flatten_width()

static int flatten_width ( SpaceText st,
const char *  str 
)
static

◆ get_line_pos_wrapped()

static TextLine* get_line_pos_wrapped ( SpaceText st,
ARegion region,
int *  y 
)
static

Definition at line 2972 of file text_ops.c.

References TextLine::line, next, NULL, usdtokens::st(), text_get_visible_lines(), top, and y.

Referenced by text_cursor_set_to_pos_wrapped().

◆ move_lines_exec()

static int move_lines_exec ( bContext C,
wmOperator op 
)
static

◆ scroll_exit()

static void scroll_exit ( bContext C,
wmOperator op 
)
static

◆ test_line_start()

static void test_line_start ( char  c,
bool r_last_state 
)
static

Tests if the given character represents a start of a new line or the indentation part of a line.

Parameters
cThe current character.
r_last_stateA pointer to a flag representing the last state. The flag may be modified.

Definition at line 62 of file text_ops.c.

References Freestyle::c, and ELEM.

Referenced by buf_tabs_to_spaces().

◆ text_closing_character_pair_get()

static char text_closing_character_pair_get ( const char  character)
static

This function receives a character and returns its closing pair if it exists.

Parameters
characterCharacter to find the closing pair.
Returns
The closing pair of the character if it exists.

Definition at line 77 of file text_ops.c.

Referenced by text_delete_exec(), and text_insert_invoke().

◆ text_comment_exec()

static int text_comment_exec ( bContext C,
wmOperator op 
)
static

◆ text_convert_whitespace_exec()

static int text_convert_whitespace_exec ( bContext C,
wmOperator op 
)
static

◆ text_copy_exec()

static int text_copy_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Definition at line 1025 of file text_ops.c.

References C, CTX_data_edit_text(), OPERATOR_FINISHED, and txt_copy_clipboard().

Referenced by TEXT_OT_copy().

◆ text_cursor_set_apply()

static void text_cursor_set_apply ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_cursor_set_exec()

static int text_cursor_set_exec ( bContext C,
wmOperator op 
)
static

◆ text_cursor_set_exit()

static void text_cursor_set_exit ( bContext C,
wmOperator op 
)
static

◆ text_cursor_set_invoke()

static int text_cursor_set_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_cursor_set_to_pos()

static void text_cursor_set_to_pos ( SpaceText st,
ARegion region,
int  x,
int  y,
const bool  sel 
)
static

◆ text_cursor_set_to_pos_wrapped()

static void text_cursor_set_to_pos_wrapped ( SpaceText st,
ARegion region,
int  x,
int  y,
const bool  sel 
)
static

◆ text_cursor_timer_ensure()

static void text_cursor_timer_ensure ( bContext C,
SetSelection ssel 
)
static

◆ text_cursor_timer_remove()

static void text_cursor_timer_remove ( bContext C,
SetSelection ssel 
)
static

◆ text_cut_exec()

static int text_cut_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_data_poll()

static bool text_data_poll ( bContext C)
static

Definition at line 173 of file text_ops.c.

References C, and CTX_data_edit_text().

Referenced by TEXT_OT_run_script(), and TEXT_OT_to_3d_object().

◆ text_delete_exec()

static int text_delete_exec ( bContext C,
wmOperator op 
)
static

◆ text_duplicate_line_exec()

static int text_duplicate_line_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_edit_poll()

static bool text_edit_poll ( bContext C)
static

◆ text_find_and_replace()

static int text_find_and_replace ( bContext C,
wmOperator op,
short  mode 
)
static

◆ text_find_exec()

static int text_find_exec ( bContext C,
wmOperator op 
)
static

Definition at line 3632 of file text_ops.c.

References C, TEXT_FIND, and text_find_and_replace().

Referenced by TEXT_OT_find().

◆ text_find_set_selected_exec()

static int text_find_set_selected_exec ( bContext C,
wmOperator op 
)
static

◆ text_get_cursor_rel()

static int text_get_cursor_rel ( SpaceText st,
ARegion region,
TextLine linein,
int  rell,
int  relc 
)
static

◆ text_indent_exec()

static int text_indent_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_indent_or_autocomplete_exec()

static int text_indent_or_autocomplete_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_insert_exec()

static int text_insert_exec ( bContext C,
wmOperator op 
)
static

◆ text_insert_invoke()

static int text_insert_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_jump_exec()

static int text_jump_exec ( bContext C,
wmOperator op 
)
static

◆ text_jump_invoke()

static int text_jump_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

Definition at line 2336 of file text_ops.c.

References C, and WM_operator_props_dialog_popup().

Referenced by TEXT_OT_jump().

◆ text_line_break_exec()

static int text_line_break_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_line_number_invoke()

static int text_line_number_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ text_make_internal_exec()

static int text_make_internal_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_move_cursor()

static int text_move_cursor ( bContext C,
int  type,
bool  select 
)
static

◆ text_move_exec()

static int text_move_exec ( bContext C,
wmOperator op 
)
static

Definition at line 2253 of file text_ops.c.

References C, wmOperator::ptr, RNA_enum_get(), text_move_cursor(), and type.

Referenced by TEXT_OT_move().

◆ text_move_select_exec()

static int text_move_select_exec ( bContext C,
wmOperator op 
)
static

Definition at line 2281 of file text_ops.c.

References C, wmOperator::ptr, RNA_enum_get(), text_move_cursor(), and type.

Referenced by TEXT_OT_move_select().

◆ text_new_exec()

static int text_new_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_new_poll()

static bool text_new_poll ( bContext UNUSEDC)
static

Definition at line 168 of file text_ops.c.

Referenced by TEXT_OT_new(), and TEXT_OT_open().

◆ text_open_cancel()

static void text_open_cancel ( bContext UNUSEDC,
wmOperator op 
)
static

Definition at line 329 of file text_ops.c.

References wmOperator::customdata, and MEM_freeN.

Referenced by TEXT_OT_open().

◆ text_open_exec()

static int text_open_exec ( bContext C,
wmOperator op 
)
static

◆ text_open_init()

static void text_open_init ( bContext C,
wmOperator op 
)
static

◆ text_open_invoke()

static int text_open_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ TEXT_OT_comment_toggle()

void TEXT_OT_comment_toggle ( wmOperatorType ot)

◆ TEXT_OT_convert_whitespace()

void TEXT_OT_convert_whitespace ( wmOperatorType ot)

◆ TEXT_OT_copy()

void TEXT_OT_copy ( wmOperatorType ot)

◆ TEXT_OT_cursor_set()

void TEXT_OT_cursor_set ( wmOperatorType ot)

◆ TEXT_OT_cut()

void TEXT_OT_cut ( wmOperatorType ot)

◆ TEXT_OT_delete()

void TEXT_OT_delete ( wmOperatorType ot)

◆ TEXT_OT_duplicate_line()

void TEXT_OT_duplicate_line ( wmOperatorType ot)

◆ TEXT_OT_find()

void TEXT_OT_find ( wmOperatorType ot)

◆ TEXT_OT_find_set_selected()

void TEXT_OT_find_set_selected ( wmOperatorType ot)

◆ TEXT_OT_indent()

void TEXT_OT_indent ( wmOperatorType ot)

◆ TEXT_OT_indent_or_autocomplete()

void TEXT_OT_indent_or_autocomplete ( wmOperatorType ot)

◆ TEXT_OT_insert()

void TEXT_OT_insert ( wmOperatorType ot)

◆ TEXT_OT_jump()

void TEXT_OT_jump ( wmOperatorType ot)

◆ TEXT_OT_line_break()

void TEXT_OT_line_break ( wmOperatorType ot)

◆ TEXT_OT_line_number()

void TEXT_OT_line_number ( wmOperatorType ot)

◆ TEXT_OT_make_internal()

void TEXT_OT_make_internal ( wmOperatorType ot)

◆ TEXT_OT_move()

void TEXT_OT_move ( wmOperatorType ot)

◆ TEXT_OT_move_lines()

void TEXT_OT_move_lines ( wmOperatorType ot)

◆ TEXT_OT_move_select()

void TEXT_OT_move_select ( wmOperatorType ot)

◆ TEXT_OT_new()

void TEXT_OT_new ( wmOperatorType ot)

◆ TEXT_OT_open()

void TEXT_OT_open ( wmOperatorType ot)

◆ TEXT_OT_overwrite_toggle()

void TEXT_OT_overwrite_toggle ( wmOperatorType ot)

◆ TEXT_OT_paste()

void TEXT_OT_paste ( wmOperatorType ot)

◆ TEXT_OT_refresh_pyconstraints()

void TEXT_OT_refresh_pyconstraints ( wmOperatorType ot)

◆ TEXT_OT_reload()

void TEXT_OT_reload ( wmOperatorType ot)

◆ TEXT_OT_replace()

void TEXT_OT_replace ( wmOperatorType ot)

◆ TEXT_OT_replace_set_selected()

void TEXT_OT_replace_set_selected ( wmOperatorType ot)

◆ TEXT_OT_resolve_conflict()

void TEXT_OT_resolve_conflict ( wmOperatorType ot)

◆ TEXT_OT_run_script()

void TEXT_OT_run_script ( wmOperatorType ot)

◆ TEXT_OT_save()

void TEXT_OT_save ( wmOperatorType ot)

◆ TEXT_OT_save_as()

void TEXT_OT_save_as ( wmOperatorType ot)

◆ TEXT_OT_scroll()

void TEXT_OT_scroll ( wmOperatorType ot)

◆ TEXT_OT_scroll_bar()

void TEXT_OT_scroll_bar ( wmOperatorType ot)

◆ TEXT_OT_select_all()

void TEXT_OT_select_all ( wmOperatorType ot)

◆ TEXT_OT_select_line()

void TEXT_OT_select_line ( wmOperatorType ot)

◆ TEXT_OT_select_word()

void TEXT_OT_select_word ( wmOperatorType ot)

◆ TEXT_OT_selection_set()

void TEXT_OT_selection_set ( wmOperatorType ot)

◆ TEXT_OT_to_3d_object()

void TEXT_OT_to_3d_object ( wmOperatorType ot)

◆ TEXT_OT_unindent()

void TEXT_OT_unindent ( wmOperatorType ot)

◆ TEXT_OT_unlink()

void TEXT_OT_unlink ( wmOperatorType ot)

◆ text_paste_exec()

static int text_paste_exec ( bContext C,
wmOperator op 
)
static

◆ text_pixel_x_to_column()

BLI_INLINE int text_pixel_x_to_column ( SpaceText st,
const int  x 
)

Definition at line 156 of file text_ops.c.

References usdtokens::st(), and x.

Referenced by text_cursor_set_to_pos().

◆ text_refresh_pyconstraints_exec()

static int text_refresh_pyconstraints_exec ( bContext UNUSEDC,
wmOperator UNUSEDop 
)
static

◆ text_region_edit_poll()

static bool text_region_edit_poll ( bContext C)
static

◆ text_region_scroll_poll()

static bool text_region_scroll_poll ( bContext C)
static

◆ text_reload_exec()

static int text_reload_exec ( bContext C,
wmOperator op 
)
static

◆ text_replace_all()

static int text_replace_all ( bContext C)
static

◆ text_replace_exec()

static int text_replace_exec ( bContext C,
wmOperator op 
)
static

◆ text_replace_set_selected_exec()

static int text_replace_set_selected_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_resolve_conflict_exec()

static int text_resolve_conflict_exec ( bContext C,
wmOperator op 
)
static

◆ text_resolve_conflict_invoke()

static int text_resolve_conflict_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ text_resolve_conflict_poll()

static bool text_resolve_conflict_poll ( bContext C)
static

◆ text_run_script()

static int text_run_script ( bContext C,
ReportList reports 
)
static

◆ text_run_script_exec()

static int text_run_script_exec ( bContext C,
wmOperator op 
)
static

Definition at line 803 of file text_ops.c.

References BKE_report(), C, OPERATOR_CANCELLED, wmOperator::reports, RPT_ERROR, text_run_script(), and void.

Referenced by TEXT_OT_run_script().

◆ text_save_as_exec()

static int text_save_as_exec ( bContext C,
wmOperator op 
)
static

◆ text_save_as_invoke()

static int text_save_as_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ text_save_exec()

static int text_save_exec ( bContext C,
wmOperator op 
)
static

◆ text_save_invoke()

static int text_save_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_scroll_apply()

static void text_scroll_apply ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_scroll_bar_invoke()

static int text_scroll_bar_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_scroll_cancel()

static void text_scroll_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 2748 of file text_ops.c.

References C, and scroll_exit().

Referenced by TEXT_OT_scroll(), and TEXT_OT_scroll_bar().

◆ text_scroll_exec()

static int text_scroll_exec ( bContext C,
wmOperator op 
)
static

◆ text_scroll_invoke()

static int text_scroll_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_scroll_modal()

static int text_scroll_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_scroll_poll()

static bool text_scroll_poll ( bContext C)
static

Definition at line 2585 of file text_ops.c.

References C, CTX_data_edit_text(), and NULL.

Referenced by TEXT_OT_scroll().

◆ text_scroll_state_init()

static void text_scroll_state_init ( TextScroll tsc,
SpaceText st,
ARegion region 
)
static

◆ text_select_all_exec()

static int text_select_all_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_select_line_exec()

static int text_select_line_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_select_word_exec()

static int text_select_word_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_selection_set_cancel()

static void text_selection_set_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 3300 of file text_ops.c.

References C, and text_cursor_set_exit().

Referenced by TEXT_OT_selection_set().

◆ text_selection_set_invoke()

static int text_selection_set_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_selection_set_modal()

static int text_selection_set_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ text_space_edit_poll()

bool text_space_edit_poll ( bContext C)

◆ text_to_3d_object_exec()

static int text_to_3d_object_exec ( bContext C,
wmOperator op 
)
static

◆ text_toggle_overwrite_exec()

static int text_toggle_overwrite_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_unindent_exec()

static int text_unindent_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_unlink_exec()

static int text_unlink_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ text_unlink_poll()

static bool text_unlink_poll ( bContext C)
static

Definition at line 498 of file text_ops.c.

References C, CTX_data_edit_text(), and NULL.

Referenced by TEXT_OT_unlink().

◆ text_update_edited()

void text_update_edited ( Text text)

◆ text_update_line_edited()

void text_update_line_edited ( TextLine line)

◆ txt_copy_clipboard()

static void txt_copy_clipboard ( Text text)
static

Definition at line 1009 of file text_ops.c.

References MEM_freeN, NULL, txt_has_sel(), txt_sel_to_buf(), and WM_clipboard_text_set().

Referenced by text_copy_exec(), and text_cut_exec().

◆ txt_screen_clamp()

static void txt_screen_clamp ( SpaceText st,
ARegion region 
)
static

Definition at line 2523 of file text_ops.c.

References usdtokens::st(), and text_get_total_lines().

Referenced by text_reload_exec(), and txt_screen_skip().

◆ txt_screen_skip()

static void txt_screen_skip ( SpaceText st,
ARegion region,
int  lines 
)
static

Definition at line 2539 of file text_ops.c.

References usdtokens::st(), and txt_screen_clamp().

Referenced by text_scroll_exec(), and text_scroll_modal().

◆ txt_wrap_move_bol()

static void txt_wrap_move_bol ( SpaceText st,
ARegion region,
const bool  sel 
)
static

◆ txt_wrap_move_down()

static void txt_wrap_move_down ( SpaceText st,
ARegion region,
const bool  sel 
)
static

◆ txt_wrap_move_eol()

static void txt_wrap_move_eol ( SpaceText st,
ARegion region,
const bool  sel 
)
static

◆ txt_wrap_move_up()

static void txt_wrap_move_up ( SpaceText st,
ARegion region,
const bool  sel 
)
static

◆ txt_write_file()

static void txt_write_file ( Main bmain,
Text text,
ReportList reports 
)
static

Variable Documentation

◆ delete_type_items

const EnumPropertyItem delete_type_items[]
static
Initial value:
= {
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{0, NULL, 0, NULL, NULL},
}
@ DEL_PREV_WORD
Definition: curve_intern.h:24
@ DEL_PREV_CHAR
Definition: curve_intern.h:22
@ DEL_NEXT_WORD
Definition: curve_intern.h:23
@ DEL_NEXT_CHAR
Definition: curve_intern.h:21

Definition at line 2366 of file text_ops.c.

Referenced by TEXT_OT_delete().

◆ move_type_items

const EnumPropertyItem move_type_items[]
static
Initial value:
= {
{LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
{LINE_END, "LINE_END", 0, "Line End", ""},
{FILE_TOP, "FILE_TOP", 0, "File Top", ""},
{FILE_BOTTOM, "FILE_BOTTOM", 0, "File Bottom", ""},
{PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{PREV_LINE, "PREVIOUS_LINE", 0, "Previous Line", ""},
{NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""},
{PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""},
{NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""},
{0, NULL, 0, NULL, NULL},
}
#define NEXT_CHAR(fmt)
@ NEXT_LINE
Definition: curve_intern.h:38
@ LINE_BEGIN
Definition: curve_intern.h:31
@ PREV_WORD
Definition: curve_intern.h:35
@ PREV_LINE
Definition: curve_intern.h:37
@ PREV_CHAR
Definition: curve_intern.h:33
@ LINE_END
Definition: curve_intern.h:32
@ PREV_PAGE
Definition: curve_intern.h:39
@ NEXT_PAGE
Definition: curve_intern.h:40
@ NEXT_WORD
Definition: curve_intern.h:36
@ FILE_TOP
Definition: text_intern.h:102
@ FILE_BOTTOM
Definition: text_intern.h:103

Definition at line 1637 of file text_ops.c.

Referenced by TEXT_OT_move(), and TEXT_OT_move_select().

◆ resolution_items

const EnumPropertyItem resolution_items[]
static
Initial value:
= {
{RESOLVE_IGNORE, "IGNORE", 0, "Ignore", ""},
{RESOLVE_RELOAD, "RELOAD", 0, "Reload", ""},
{RESOLVE_SAVE, "SAVE", 0, "Save", ""},
{RESOLVE_MAKE_INTERNAL, "MAKE_INTERNAL", 0, "Make Internal", ""},
{0, NULL, 0, NULL, NULL},
}
@ RESOLVE_SAVE
Definition: text_ops.c:3801
@ RESOLVE_MAKE_INTERNAL
Definition: text_ops.c:3801
@ RESOLVE_RELOAD
Definition: text_ops.c:3801
@ RESOLVE_IGNORE
Definition: text_ops.c:3801

Definition at line 3802 of file text_ops.c.

Referenced by TEXT_OT_resolve_conflict().

◆ whitespace_type_items

const EnumPropertyItem whitespace_type_items[]
static
Initial value:
= {
{TO_SPACES, "SPACES", 0, "To Spaces", NULL},
{TO_TABS, "TABS", 0, "To Tabs", NULL},
{0, NULL, 0, NULL, NULL},
}
@ TO_SPACES
Definition: text_ops.c:1339
@ TO_TABS
Definition: text_ops.c:1339

Definition at line 1340 of file text_ops.c.

Referenced by TEXT_OT_convert_whitespace().