Blender V5.3
text_ops.cc File Reference
#include <algorithm>
#include <cerrno>
#include <cstring>
#include <sstream>
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
#include "DNA_text_types.h"
#include "BLI_fileops.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_path_utils.hh"
#include "BLI_rect.hh"
#include "BLI_string.hh"
#include "BLI_string_cursor_utf8.hh"
#include "BLI_string_utf8.hh"
#include "BLI_time.hh"
#include "BLI_vector_set.hh"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_legacy_types.hh"
#include "BKE_node_runtime.hh"
#include "BKE_report.hh"
#include "BKE_text.h"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_curve.hh"
#include "ED_screen.hh"
#include "ED_text.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "RE_engine.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "text_format.hh"
#include "text_intern.hh"

Go to the source code of this file.

Classes

struct  blender::TextScroll
struct  blender::SetSelection

Namespaces

namespace  blender
 BMesh Iterators.

Functions

Utilities
static void blender::test_line_start (char c, bool *r_last_state)
static char blender::text_closing_character_pair_get (const char character)
static bool blender::text_span_is_blank (TextLine *line1, const int line1_char, TextLine *line2, const int line2_char)
static char * blender::buf_tabs_to_spaces (const char *in_buf, const int tab_size, int *r_out_buf_len)
BLI_INLINE int blender::space_text_pixel_x_to_column (const SpaceText *st, const int x)
static void blender::text_select_update_primary_clipboard (const Text *text)
Operator Poll
static bool blender::text_new_poll (bContext *)
static bool blender::text_data_poll (bContext *C)
static bool blender::text_edit_poll (bContext *C)
bool blender::text_space_edit_poll (bContext *C)
static bool blender::text_region_edit_poll (bContext *C)
Updates
void blender::text_update_line_edited (TextLine *line)
void blender::text_update_edited (Text *text)
New Operator
static wmOperatorStatus blender::text_new_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_new (wmOperatorType *ot)
Open Operator
static void blender::text_open_init (bContext *C, wmOperator *op)
static void blender::text_open_cancel (bContext *, wmOperator *op)
static wmOperatorStatus blender::text_open_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_open_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::TEXT_OT_open (wmOperatorType *ot)
Reload Operator
static wmOperatorStatus blender::text_reload_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_reload_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::TEXT_OT_reload (wmOperatorType *ot)
Make Internal Operator
static wmOperatorStatus blender::text_make_internal_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_make_internal (wmOperatorType *ot)
Save Operator
static void blender::txt_write_file (Main *bmain, Text *text, ReportList *reports)
static wmOperatorStatus blender::text_save_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_save_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::TEXT_OT_save (wmOperatorType *ot)
Save As Operator
static wmOperatorStatus blender::text_save_as_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_save_as_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::TEXT_OT_save_as (wmOperatorType *ot)
Run Script Operator
static wmOperatorStatus blender::text_run_script (bContext *C, ReportList *reports)
static wmOperatorStatus blender::text_run_script_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_run_script (wmOperatorType *ot)
Paste Operator
static wmOperatorStatus blender::text_paste_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_paste (wmOperatorType *ot)
Duplicate Operator
static wmOperatorStatus blender::text_duplicate_line_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_duplicate_line (wmOperatorType *ot)
Copy Operator
static void blender::txt_copy_clipboard (const Text *text)
static wmOperatorStatus blender::text_copy_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_copy (wmOperatorType *ot)
Cut Operator
static wmOperatorStatus blender::text_cut_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_cut (wmOperatorType *ot)
Indent or Autocomplete Operator
static wmOperatorStatus blender::text_indent_or_autocomplete_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_indent_or_autocomplete (wmOperatorType *ot)
Indent Operator
static wmOperatorStatus blender::text_indent_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_indent (wmOperatorType *ot)
Unindent Operator
static wmOperatorStatus blender::text_unindent_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_unindent (wmOperatorType *ot)
Line Break Operator
static wmOperatorStatus blender::text_line_break_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_line_break (wmOperatorType *ot)
Toggle-Comment Operator
static wmOperatorStatus blender::text_comment_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_comment_toggle (wmOperatorType *ot)
Select All Operator
static wmOperatorStatus blender::text_select_all_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_select_all (wmOperatorType *ot)
Select Line Operator
static wmOperatorStatus blender::text_select_line_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_select_line (wmOperatorType *ot)
Select Word Operator
static wmOperatorStatus blender::text_select_word_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_select_word (wmOperatorType *ot)
Move Lines Operators
static wmOperatorStatus blender::move_lines_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_move_lines (wmOperatorType *ot)
Move Select Operator
static wmOperatorStatus blender::text_move_select_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_move_select (wmOperatorType *ot)
Jump Operator
static wmOperatorStatus blender::text_jump_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_jump_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::TEXT_OT_jump (wmOperatorType *ot)
Toggle Overwrite Operator
static wmOperatorStatus blender::text_toggle_overwrite_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_overwrite_toggle (wmOperatorType *ot)
Scroll Bar Operator
static bool blender::text_region_scroll_poll (bContext *C)
static wmOperatorStatus blender::text_scroll_bar_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::TEXT_OT_scroll_bar (wmOperatorType *ot)
Set Selection Operator
static int blender::flatten_width (SpaceText *st, const char *str)
static int blender::flatten_column_to_offset (SpaceText *st, const char *str, int index)
static TextLine * blender::space_text_get_line_pos_wrapped (const SpaceText *st, const ARegion *region, int *y)
static void blender::space_text_cursor_set_to_pos_wrapped (const SpaceText *st, const ARegion *region, int x, int y, const bool sel)
static void blender::text_cursor_set_to_pos (SpaceText *st, const ARegion *region, int x, int y, const bool sel)
static void blender::text_cursor_timer_ensure (bContext *C, SetSelection *ssel)
static void blender::text_cursor_timer_remove (bContext *C, SetSelection *ssel)
static void blender::text_cursor_set_apply (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::text_cursor_set_exit (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_selection_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::text_selection_set_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::text_selection_set_cancel (bContext *C, wmOperator *op)
void blender::TEXT_OT_selection_set (wmOperatorType *ot)
Set Cursor Operator
static wmOperatorStatus blender::text_cursor_set_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_cursor_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::TEXT_OT_cursor_set (wmOperatorType *ot)
Line Number Operator
static wmOperatorStatus blender::text_line_number_invoke (bContext *C, wmOperator *, const wmEvent *event)
void blender::TEXT_OT_line_number (wmOperatorType *ot)
Insert Operator
static wmOperatorStatus blender::text_insert_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::text_insert_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::TEXT_OT_insert (wmOperatorType *ot)
Replace Operator
static wmOperatorStatus blender::text_replace_all (bContext *C)
static wmOperatorStatus blender::text_replace_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_replace (wmOperatorType *ot)
Find Set Selected
static wmOperatorStatus blender::text_find_set_selected_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_find_set_selected (wmOperatorType *ot)
Replace Set Selected
static wmOperatorStatus blender::text_replace_set_selected_exec (bContext *C, wmOperator *)
void blender::TEXT_OT_replace_set_selected (wmOperatorType *ot)
Jump to File at Point
static bool blender::text_jump_to_file_at_point_external (bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static bool blender::text_jump_to_file_at_point_internal (bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static wmOperatorStatus blender::text_jump_to_file_at_point_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_jump_to_file_at_point (wmOperatorType *ot)
To 3D Object Operator
static wmOperatorStatus blender::text_to_3d_object_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_to_3d_object (wmOperatorType *ot)
Shader Update
static bool blender::text_update_shader_poll (bContext *C)
static bool blender::text_update_shader_text_recursive (RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text, VectorSet< bNodeTree * > &done_trees)
static wmOperatorStatus blender::text_update_shader_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_update_shader (wmOperatorType *ot)

Convert Whitespace Operator

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

Scroll Operator

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

Find Operator

enum  { blender::TEXT_FIND = 0 , blender::TEXT_REPLACE = 1 }
static wmOperatorStatus blender::text_find_and_replace (bContext *C, wmOperator *op, short mode)
static wmOperatorStatus blender::text_find_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_find (wmOperatorType *ot)

Resolve Conflict Operator

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

Move Operator

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

Delete Operator

static const EnumPropertyItem blender::delete_type_items []
static bool blender::text_unlink_poll (bContext *C)
static wmOperatorStatus blender::text_unlink_exec (bContext *C, wmOperator *)
static wmOperatorStatus blender::text_unlink_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::TEXT_OT_unlink (wmOperatorType *ot)
static wmOperatorStatus blender::text_delete_exec (bContext *C, wmOperator *op)
void blender::TEXT_OT_delete (wmOperatorType *ot)