Blender V5.3
BKE_text.h File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
#define ATTR_RETURNS_NONNULL
#define ATTR_NORETURN
#define ATTR_MALLOC
#define ATTR_ALLOC_SIZE(...)
#define ATTR_SENTINEL(arg_pos)
#define ATTR_PRINTF_FORMAT(format_param, dots_param)
#define ATTR_FALLTHROUGH   ((void)0)
#define ATTR_ALIGN(x)
#define BLI_ALIGN_STRUCT
#define _MSC_STDINT_H_
#define _W64
#define INT8_MIN   ((int8_t)_I8_MIN)
#define INT8_MAX   _I8_MAX
#define INT16_MIN   ((int16_t)_I16_MIN)
#define INT16_MAX   _I16_MAX
#define INT32_MIN   ((int32_t)_I32_MIN)
#define INT32_MAX   _I32_MAX
#define INT64_MIN   ((int64_t)_I64_MIN)
#define INT64_MAX   _I64_MAX
#define UINT8_MAX   _UI8_MAX
#define UINT16_MAX   _UI16_MAX
#define UINT32_MAX   _UI32_MAX
#define UINT64_MAX   _UI64_MAX
#define INT_LEAST8_MIN   INT8_MIN
#define INT_LEAST8_MAX   INT8_MAX
#define INT_LEAST16_MIN   INT16_MIN
#define INT_LEAST16_MAX   INT16_MAX
#define INT_LEAST32_MIN   INT32_MIN
#define INT_LEAST32_MAX   INT32_MAX
#define INT_LEAST64_MIN   INT64_MIN
#define INT_LEAST64_MAX   INT64_MAX
#define UINT_LEAST8_MAX   UINT8_MAX
#define UINT_LEAST16_MAX   UINT16_MAX
#define UINT_LEAST32_MAX   UINT32_MAX
#define UINT_LEAST64_MAX   UINT64_MAX
#define INT_FAST8_MIN   INT8_MIN
#define INT_FAST8_MAX   INT8_MAX
#define INT_FAST16_MIN   INT16_MIN
#define INT_FAST16_MAX   INT16_MAX
#define INT_FAST32_MIN   INT32_MIN
#define INT_FAST32_MAX   INT32_MAX
#define INT_FAST64_MIN   INT64_MIN
#define INT_FAST64_MAX   INT64_MAX
#define UINT_FAST8_MAX   UINT8_MAX
#define UINT_FAST16_MAX   UINT16_MAX
#define UINT_FAST32_MAX   UINT32_MAX
#define UINT_FAST64_MAX   UINT64_MAX
#define INTPTR_MIN   INT32_MIN
#define INTPTR_MAX   INT32_MAX
#define UINTPTR_MAX   UINT32_MAX
#define INTMAX_MIN   INT64_MIN
#define INTMAX_MAX   INT64_MAX
#define UINTMAX_MAX   UINT64_MAX
#define PTRDIFF_MIN   _I32_MIN
#define PTRDIFF_MAX   _I32_MAX
#define SIG_ATOMIC_MIN   INT_MIN
#define SIG_ATOMIC_MAX   INT_MAX
#define SIZE_MAX   _UI32_MAX
#define WCHAR_MIN   0
#define WCHAR_MAX   _UI16_MAX
#define WINT_MIN   0
#define WINT_MAX   _UI16_MAX
#define INT8_C(val)
#define INT16_C(val)
#define INT32_C(val)
#define INT64_C(val)
#define UINT8_C(val)
#define UINT16_C(val)
#define UINT32_C(val)
#define UINT64_C(val)
#define INTMAX_C   INT64_C
#define UINTMAX_C   UINT64_C

Typedefs

typedef signed char blender::int8_t
typedef signed short blender::int16_t
typedef signed int blender::int32_t
typedef unsigned char blender::uint8_t
typedef unsigned short blender::uint16_t
typedef unsigned int blender::uint32_t
typedef __int64 blender::int64_t
typedef unsigned __int64 blender::uint64_t
typedef int8_t blender::int_least8_t
typedef int16_t blender::int_least16_t
typedef int32_t blender::int_least32_t
typedef int64_t blender::int_least64_t
typedef uint8_t blender::uint_least8_t
typedef uint16_t blender::uint_least16_t
typedef uint32_t blender::uint_least32_t
typedef uint64_t blender::uint_least64_t
typedef int8_t blender::int_fast8_t
typedef int16_t blender::int_fast16_t
typedef int32_t blender::int_fast32_t
typedef int64_t blender::int_fast64_t
typedef uint8_t blender::uint_fast8_t
typedef uint16_t blender::uint_fast16_t
typedef uint32_t blender::uint_fast32_t
typedef uint64_t blender::uint_fast64_t
typedef _W64 int blender::intptr_t
typedef _W64 unsigned int blender::uintptr_t
typedef int64_t blender::intmax_t
typedef uint64_t blender::uintmax_t
typedef unsigned int blender::uint
typedef unsigned short blender::ushort
typedef unsigned long blender::ulong
typedef unsigned char blender::uchar

Enumerations

enum  { blender::TXT_MOVE_LINE_UP = -1 , blender::TXT_MOVE_LINE_DOWN = 1 }

Functions

void int blender::BKE_text_file_modified_check (const struct Text *text)
bool blender::txt_has_sel (const struct Text *text)
int blender::txt_get_span (const struct TextLine *from, const struct TextLine *to)
char * blender::txt_sel_to_buf (const struct Text *text, size_t *r_buf_strlen)
bool blender::txt_cursor_is_line_start (const struct Text *text)
bool blender::txt_cursor_is_line_end (const struct Text *text)
int blender::txt_calc_tab_left (const struct TextLine *tl, int ch)
int blender::txt_calc_tab_right (const struct TextLine *tl, int ch)
Text Add, Free, Validation
void blender::BKE_text_free_lines (struct Text *text)
struct Text * blender::BKE_text_add (struct Main *bmain, const char *name)
int blender::txt_extended_ascii_as_utf8 (char **str)
bool blender::BKE_text_reload (struct Text *text)
struct Text * blender::BKE_text_load_ex (struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
struct Text struct Text * blender::BKE_text_load (struct Main *bmain, const char *filepath, const char *relbase) ATTR_NONNULL(1
struct Text struct Text void blender::BKE_text_clear (struct Text *text) ATTR_NONNULL(1)
void blender::BKE_text_write (struct Text *text, const char *str, int str_len) ATTR_NONNULL(1
void blender::BKE_text_file_modified_ignore (struct Text *text)
Cut and Paste Functions
char * blender::txt_to_buf (struct Text *text, size_t *r_buf_strlen) ATTR_NONNULL(1
void blender::txt_insert_buf (struct Text *text, const char *in_buffer, int in_buffer_len) ATTR_NONNULL(1
Editing Utility Functions
void blender::txt_clean_text (struct Text *text)
Text Selection Functions
void blender::txt_order_cursors (struct Text *text, bool reverse)
void blender::txt_pop_sel (struct Text *text)
void blender::txt_sel_all (struct Text *text)
void blender::txt_sel_clear (struct Text *text)
void blender::txt_sel_line (struct Text *text)
void blender::txt_sel_set (struct Text *text, int startl, int startc, int endl, int endc)
Find String in Text
bool blender::txt_find_string (struct Text *text, const char *findstr, int wrap, int match_case)
Cursor Movement Functions
Note
If the user moves the cursor the space containing that cursor should be popped See txt_pop_first, txt_pop_last Other space-types retain their own top location.
void blender::txt_move_up (struct Text *text, bool sel)
void blender::txt_move_down (struct Text *text, bool sel)
void blender::txt_move_left (struct Text *text, bool sel)
void blender::txt_move_right (struct Text *text, bool sel)
void blender::txt_jump_left (struct Text *text, bool sel, bool use_init_step)
void blender::txt_jump_right (struct Text *text, bool sel, bool use_init_step)
void blender::txt_move_bof (struct Text *text, bool sel)
void blender::txt_move_eof (struct Text *text, bool sel)
void blender::txt_move_bol (struct Text *text, bool sel)
void blender::txt_move_eol (struct Text *text, bool sel)
void blender::txt_move_toline (struct Text *text, unsigned int line, bool sel)
void blender::txt_move_to (struct Text *text, unsigned int line, unsigned int ch, bool sel)
Line Editing Functions
void blender::txt_delete_char (struct Text *text)
void blender::txt_delete_word (struct Text *text)
void blender::txt_delete_selected (struct Text *text)
void void blender::txt_split_curline (struct Text *text)
void blender::txt_backspace_char (struct Text *text)
void blender::txt_backspace_word (struct Text *text)
bool blender::txt_add_char (struct Text *text, unsigned int add)
bool blender::txt_add_raw_char (struct Text *text, unsigned int add)
bool blender::txt_replace_char (struct Text *text, unsigned int add)
bool blender::txt_unindent (struct Text *text)
void blender::txt_indent (struct Text *text)
void blender::txt_comment (struct Text *text, const char *prefix)
bool blender::txt_uncomment (struct Text *text, const char *prefix)
void blender::txt_move_lines (struct Text *text, int direction)
void blender::txt_duplicate_line (struct Text *text)
int blender::txt_setcurr_tab_spaces (struct Text *text, int space)
Character Queries
int blender::text_check_bracket (char ch)
bool blender::text_check_delim (char ch)
bool blender::text_check_digit (char ch)
bool blender::text_check_identifier (char ch)
bool blender::text_check_identifier_nodigit (char ch)
bool blender::text_check_whitespace (char ch)
int blender::text_find_identifier_start (const char *str, int i)
Character Classification

Define text.cc functions here (declared in BKE_text.h), This could be removed if Blender gets its own unicode library.

int blender::text_check_identifier_unicode (unsigned int ch)
int blender::text_check_identifier_nodigit_unicode (unsigned int ch)
Buffer Conversion for Undo/Redo

Buffer conversion functions that rely on the buffer already being validated.

The only requirement for these functions is that they're reverse-able, the undo logic doesn't inspect their content.

Currently buffers:

  • Always ends with a new-line.
  • Are not null terminated.
char * blender::txt_to_buf_for_undo (struct Text *text, size_t *r_buf_len) ATTR_NONNULL(1
void blender::txt_from_buf_for_undo (struct Text *text, const char *buf, size_t buf_len) ATTR_NONNULL(1

Macro Definition Documentation

◆ _MSC_STDINT_H_

#define _MSC_STDINT_H_

◆ _W64

#define _W64

◆ ATTR_ALIGN

#define ATTR_ALIGN ( x)
Value:
__attribute__((aligned(x)))
struct AtomicSpinLock __attribute__((aligned(32))) AtomicSpinLock

◆ ATTR_ALLOC_SIZE

◆ ATTR_FALLTHROUGH

#define ATTR_FALLTHROUGH   ((void)0)

Referenced by blender::ANIM_center_frame(), blender::animviz_motionpath_compute_range(), blender::BKE_lib_override_library_property_operation_operands_validate(), blender::BKE_packedfile_unpack_to_file(), blender::BLI_hash_mm2(), blender::BLI_hash_mm3(), blender::blo_read_file_internal(), blender::ui::but_new(), blender::ed::transform::calc_orientation_from_type_ex(), blender::click_select_channel_action_slot(), blender::clip_listener(), blender::Color_richcmpr(), blender::densfunc(), blender::ui::do_but_textedit(), blender::nodes::draw_property_for_socket(), blender::ed_marker_move_modal(), blender::ED_select_circle_get_name(), blender::ED_select_pick_get_name(), blender::Euler_richcmpr(), blender::Euler_vectorcall(), blender::get_cpa_texture(), blender::io::alembic::get_curve_order(), blender::workbench::Instance::get_material(), blender::ed::transform::gizmo_orientation_axis(), blender::ui::handle_button_event(), blender::ui::handle_menu_event(), blender::handleNumInput(), blender::hook_falloff(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::image_closest_texture_lookup(), blender::influence_data_from_modifier(), blender::init_meta(), blender::long_id_names_process_action_slots_identifiers(), blender::eevee::ShaderModule::material_create_info_amend(), blender::Matrix_richcmpr(), blender::merge_uvs_for_vertex(), blender::nla_blend_get_inverted_strip_value(), blender::nla_blend_value(), blender::nla_draw_strip(), blender::ed::object::object_convert_exec(), blender::draw::overlay::Fluids::object_sync(), blender::orthogonalize_m3_zero_axes_impl(), blender::ed::outliner::outliner_right_columns_width(), blender::gpu::PruningStream::parse_token_range(), blender::ed::animation::pastebuf_find_matching_copybuf_item(), blender::ui::pie_handler(), blender::poselib_blend_cleanup(), blender::psys_get_texture(), blender::pyrna_param_to_py(), blender::pyrna_prop_richcmp(), blender::pyrna_struct_richcmp(), blender::Quaternion_richcmpr(), blender::screen_animation_step_invoke(), blender::ed::transform::setSnappingCallback(), blender::ed::transform::setUserConstraint(), blender::simpleDeform_bend(), blender::SimpleDeformModifier_do(), blender::slide_marker_modal(), blender::slide_plane_marker_modal(), blender::slide_point_modal(), blender::slide_spline_curvature_modal(), blender::str_utf8_copy_max_bytes_impl(), blender::text_autocomplete_modal(), blender::text_listener(), blender::texture_value_blend(), blender::eevee::to_displacement_type(), blender::ed::space_node::ui_node_draw_input(), blender::uiTemplateImageStereo3d(), util_murmur_hash3(), blender::uv_map_transform_center(), blender::view3d_interactive_add_modal(), and blender::view3d_main_region_listener().

◆ ATTR_MALLOC

◆ ATTR_NONNULL

◆ ATTR_NORETURN

#define ATTR_NORETURN

◆ ATTR_PRINTF_FORMAT

#define ATTR_PRINTF_FORMAT ( format_param,
dots_param )

◆ ATTR_RETURNS_NONNULL

#define ATTR_RETURNS_NONNULL

◆ ATTR_SENTINEL

#define ATTR_SENTINEL ( arg_pos)

◆ ATTR_WARN_UNUSED_RESULT

◆ BLI_ALIGN_STRUCT

#define BLI_ALIGN_STRUCT

◆ INT16_C

#define INT16_C ( val)
Value:
val##i16

◆ INT16_MAX

◆ INT16_MIN

#define INT16_MIN   ((int16_t)_I16_MIN)

◆ INT32_C

#define INT32_C ( val)
Value:
val##i32

◆ INT32_MAX

#define INT32_MAX   _I32_MAX

Referenced by blender::ed::space_node::add_interface_from_socket(), blender::nodes::socket_items::ops::add_node_identifier_property(), blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), blender::create_operator_state(), blender::ed::curves::CURVES_OT_select_ends(), blender::ed::curves::CURVES_OT_select_random(), blender::def_geo_foreach_geometry_element_output(), blender::def_geo_repeat_output(), blender::ed::greasepencil::undo::StepDrawingGeometry::encode(), blender::ed::greasepencil::undo::StepDrawingReference::encode(), blender::bke::generate_unique_instance_ids(), blender::io::obj::geom_add_curve_vertex_indices(), blender::io::obj::geom_add_polygon(), blender::io::obj::geom_add_polyline(), blender::string_search::get_best_word_index_that_startswith(), GHOST_SystemWayland::getAllDisplayDimensions(), ghost_wl_display_event_pump_from_thread(), blender::ed::greasepencil::GREASE_PENCIL_OT_select_ends(), blender::make_socket_type_int(), blender::SubFrame::max(), blender::ed::object::OBJECT_OT_drop_geometry_nodes(), blender::ed::object::OBJECT_OT_transform_to_mouse(), blender::ed::space_node::NestedNodeRefIDGenerator::operator()(), blender::io::obj::parse_vertex_index(), blender::ed::pointcloud::POINTCLOUD_OT_select_random(), blender::nodes::socket_items::ops::remove_item_by_index(), blender::rna_def_combine_list_item(), blender::rna_def_curves_sculpt_options(), blender::rna_def_depsgraph(), blender::rna_def_index_switch_item(), blender::rna_def_node(), blender::rna_def_nodetree(), blender::rna_def_userdef_system(), blender::ed::sculpt_paint::SCULPT_CURVES_OT_select_random(), blender::RandomNumberGenerator::shuffle(), blender::ed::object::bake_simulation::single_bake_operator_props(), blender::TEST(), blender::TEST(), blender::geometry::valid_int_num(), blender::WM_operator_properties_id_lookup(), and blender::writestruct_at_address_nr().

◆ INT32_MIN

◆ INT64_C

#define INT64_C ( val)
Value:
val##i64

◆ INT64_MAX

◆ INT64_MIN

#define INT64_MIN   ((int64_t)_I64_MIN)

Referenced by blender::rna_int_print(), and TEST().

◆ INT8_C

#define INT8_C ( val)
Value:
val##i8

◆ INT8_MAX

#define INT8_MAX   _I8_MAX

◆ INT8_MIN

#define INT8_MIN   ((int8_t)_I8_MIN)

◆ INT_FAST16_MAX

#define INT_FAST16_MAX   INT16_MAX

◆ INT_FAST16_MIN

#define INT_FAST16_MIN   INT16_MIN

◆ INT_FAST32_MAX

#define INT_FAST32_MAX   INT32_MAX

◆ INT_FAST32_MIN

#define INT_FAST32_MIN   INT32_MIN

◆ INT_FAST64_MAX

#define INT_FAST64_MAX   INT64_MAX

◆ INT_FAST64_MIN

#define INT_FAST64_MIN   INT64_MIN

◆ INT_FAST8_MAX

#define INT_FAST8_MAX   INT8_MAX

◆ INT_FAST8_MIN

#define INT_FAST8_MIN   INT8_MIN

◆ INT_LEAST16_MAX

#define INT_LEAST16_MAX   INT16_MAX

◆ INT_LEAST16_MIN

#define INT_LEAST16_MIN   INT16_MIN

◆ INT_LEAST32_MAX

#define INT_LEAST32_MAX   INT32_MAX

◆ INT_LEAST32_MIN

#define INT_LEAST32_MIN   INT32_MIN

◆ INT_LEAST64_MAX

#define INT_LEAST64_MAX   INT64_MAX

◆ INT_LEAST64_MIN

#define INT_LEAST64_MIN   INT64_MIN

◆ INT_LEAST8_MAX

#define INT_LEAST8_MAX   INT8_MAX

◆ INT_LEAST8_MIN

#define INT_LEAST8_MIN   INT8_MIN

◆ INTMAX_C

#define INTMAX_C   INT64_C

◆ INTMAX_MAX

#define INTMAX_MAX   INT64_MAX

◆ INTMAX_MIN

#define INTMAX_MIN   INT64_MIN

◆ INTPTR_MAX

#define INTPTR_MAX   INT32_MAX

◆ INTPTR_MIN

#define INTPTR_MIN   INT32_MIN

◆ PTRDIFF_MAX

#define PTRDIFF_MAX   _I32_MAX

◆ PTRDIFF_MIN

#define PTRDIFF_MIN   _I32_MIN

◆ SIG_ATOMIC_MAX

#define SIG_ATOMIC_MAX   INT_MAX

◆ SIG_ATOMIC_MIN

#define SIG_ATOMIC_MIN   INT_MIN

◆ SIZE_MAX

◆ UINT16_C

#define UINT16_C ( val)
Value:
val##ui16

◆ UINT16_MAX

#define UINT16_MAX   _UI16_MAX

Referenced by blender::PyC_Long_AsU16().

◆ UINT32_C

#define UINT32_C ( val)
Value:
val##ui32

◆ UINT32_MAX

◆ UINT64_C

#define UINT64_C ( val)
Value:
val##ui64

◆ UINT64_MAX

◆ UINT8_C

#define UINT8_C ( val)
Value:
val##ui8

◆ UINT8_MAX

◆ UINT_FAST16_MAX

#define UINT_FAST16_MAX   UINT16_MAX

◆ UINT_FAST32_MAX

#define UINT_FAST32_MAX   UINT32_MAX

◆ UINT_FAST64_MAX

#define UINT_FAST64_MAX   UINT64_MAX

◆ UINT_FAST8_MAX

#define UINT_FAST8_MAX   UINT8_MAX

◆ UINT_LEAST16_MAX

#define UINT_LEAST16_MAX   UINT16_MAX

◆ UINT_LEAST32_MAX

#define UINT_LEAST32_MAX   UINT32_MAX

◆ UINT_LEAST64_MAX

#define UINT_LEAST64_MAX   UINT64_MAX

◆ UINT_LEAST8_MAX

#define UINT_LEAST8_MAX   UINT8_MAX

◆ UINTMAX_C

#define UINTMAX_C   UINT64_C

◆ UINTMAX_MAX

#define UINTMAX_MAX   UINT64_MAX

◆ UINTPTR_MAX

◆ WCHAR_MAX

#define WCHAR_MAX   _UI16_MAX

◆ WCHAR_MIN

#define WCHAR_MIN   0

◆ WINT_MAX

#define WINT_MAX   _UI16_MAX

◆ WINT_MIN

#define WINT_MIN   0