54 stext = MEM_new<SpaceText>(
"inittext");
64 stext->
runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
93 return reinterpret_cast<SpaceLink *
>(stext);
102 stext->
text =
nullptr;
113 stextn->
runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
115 return reinterpret_cast<SpaceLink *
>(stextn);
119static std::optional<ARegionIMECursorState> text_main_region_cursor_ime(wmWindow * ,
121 const ARegion *region,
122 ARegionIMECursor *r_cursor)
124 SpaceText *st = area->spacedata.first_as<SpaceText>();
132 if (st->runtime->line_height_px == 0) {
140 const int x = (*cursor_xy)[0];
141 const int y = (*cursor_xy)[1];
146 const int line_height = st->runtime->line_height_px;
147 const int baseline_y =
y - line_height;
148 const int ymin = baseline_y + st->runtime->descender_px;
154 .ymax = ymin + line_height,
156 r_cursor->font_size = line_height;
289 if (st->
text !=
nullptr) {
308 ListBaseT<wmDropBox> *lb;
477 st->
runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
487 struct_writer.shallow_data.runtime =
nullptr;
488 struct_writer.shallow_data.live_edit =
false;
500 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
519 st->blend_read_after_liblink =
nullptr;
530 art->
cursor_ime = text_main_region_cursor_ime;
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define STRNCPY_UTF8(dst, src)
Read Blender memory allocation and freeing.
#define UI_COMPACT_PANEL_WIDTH
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
void frame_buffer_clear(int colorid)
@ V2D_COMMONVIEW_STANDARD
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void ED_text_format_register_osl()
const char * WM_drag_get_single_path(const wmDrag *drag)
void TEXT_OT_delete(wmOperatorType *ot)
static void text_space_blend_write(BlendWriter *writer, SpaceLink *sl)
wmDropBox * WM_dropbox_add(ListBaseT< wmDropBox > *lb, const char *idname, bool(*poll)(bContext *C, wmDrag *drag, const wmEvent *event), void(*copy)(bContext *C, wmDrag *drag, wmDropBox *drop), void(*cancel)(Main *bmain, wmDrag *drag, wmDropBox *drop), WMDropboxTooltipFunc tooltip)
static bool text_drop_id_poll(bContext *, wmDrag *drag, const wmEvent *)
void TEXT_OT_new(wmOperatorType *ot)
static int text_context(const bContext *C, const char *member, bContextDataResult *result)
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
void space_text_drawcache_tag_update(SpaceText *st, const bool full)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot)
void TEXT_OT_make_internal(wmOperatorType *ot)
static void text_header_region_init(wmWindowManager *, ARegion *region)
void ED_text_format_register_py()
void TEXT_OT_cursor_set(wmOperatorType *ot)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void ED_text_format_register_pov_ini()
void TEXT_OT_autocomplete(wmOperatorType *ot)
void TEXT_OT_to_3d_object(wmOperatorType *ot)
static void text_drop_path_copy(bContext *, wmDrag *drag, wmDropBox *drop)
void TEXT_OT_scroll_bar(wmOperatorType *ot)
void TEXT_OT_resolve_conflict(wmOperatorType *ot)
static void text_header_region_draw(const bContext *C, ARegion *region)
void TEXT_OT_select_all(wmOperatorType *ot)
static void text_operatortypes()
void TEXT_OT_convert_whitespace(wmOperatorType *ot)
static void text_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
bool CTX_data_equals(const char *member, const char *str)
const std::string & WM_drag_get_string(const wmDrag *drag)
void TEXT_OT_duplicate_line(wmOperatorType *ot)
static void text_main_region_init(wmWindowManager *wm, ARegion *region)
static void text_update_edited(bContext *C, Object *obedit, const eEditFontMode mode)
void TEXT_OT_unindent(wmOperatorType *ot)
static void text_main_region_draw(const bContext *C, ARegion *region)
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
void TEXT_OT_update_shader(wmOperatorType *ot)
SpaceText * CTX_wm_space_text(const bContext *C)
void TEXT_OT_save(wmOperatorType *ot)
static void text_drop_string_copy(bContext *, wmDrag *drag, wmDropBox *drop)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBaseT< wmEventHandler > *handlers, ListBaseT< wmDropBox > *dropboxes)
void TEXT_OT_line_break(wmOperatorType *ot)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
void TEXT_OT_select_word(wmOperatorType *ot)
BMesh const char void * data
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
void TEXT_OT_unlink(wmOperatorType *ot)
std::string RNA_path_full_ID_py(ID *id)
void TEXT_OT_jump(wmOperatorType *ot)
void TEXT_OT_scroll(wmOperatorType *ot)
void ED_region_panels(const bContext *C, ARegion *region)
void TEXT_OT_replace(wmOperatorType *ot)
static void text_keymap(wmKeyConfig *keyconf)
void TEXT_OT_comment_toggle(wmOperatorType *ot)
static void text_id_remap(ScrArea *, SpaceLink *slink, const bke::id::IDRemapper &mappings)
static void text_properties_region_draw(const bContext *C, ARegion *region)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
static void text_free(SpaceLink *sl)
void TEXT_OT_replace_set_selected(wmOperatorType *ot)
void TEXT_OT_jump_to_file_at_point(wmOperatorType *ot)
void TEXT_OT_cut(wmOperatorType *ot)
static void text_init(wmWindowManager *, ScrArea *)
void TEXT_OT_select_line(wmOperatorType *ot)
ARegion * BKE_area_region_new()
const char * text_context_dir[]
void TEXT_OT_open(wmOperatorType *ot)
void space_text_free_caches(SpaceText *st)
bool CTX_data_dir(const char *member)
static void text_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
void TEXT_OT_move_lines(wmOperatorType *ot)
void TEXT_OT_start_find(wmOperatorType *ot)
static SpaceLink * text_create(const ScrArea *, const Scene *)
static void text_cursor(wmWindow *win, ScrArea *area, ARegion *region)
int WM_drag_get_path_file_type(const wmDrag *drag)
void TEXT_OT_selection_set(wmOperatorType *ot)
@ V2D_SCROLL_VERTICAL_HIDE
void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void text_listener(const wmSpaceTypeListenerParams *params)
void TEXT_OT_find_set_selected(wmOperatorType *ot)
void TEXT_OT_find(wmOperatorType *ot)
void TEXT_OT_move_select(wmOperatorType *ot)
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
void TEXT_OT_indent(wmOperatorType *ot)
void ED_region_header_init(ARegion *region)
@ UsePanelCategoriesSearch
void ED_text_format_register_pov()
std::optional< int2 > space_text_cursor_region_xy_get(const SpaceText *st, const ARegion *region)
void WM_cursor_set(wmWindow *win, int curs)
void TEXT_OT_move(wmOperatorType *ot)
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
void draw_text_main(SpaceText *st, ARegion *region)
@ CTX_RESULT_MEMBER_NOT_FOUND
void TEXT_OT_paste(wmOperatorType *ot)
ID * WM_drag_get_local_ID(const wmDrag *drag, short idcode)
@ ID_REMAP_APPLY_ENSURE_REAL
@ IDWALK_CB_DIRECT_WEAK_LINK
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
static void text_dropboxes()
void TEXT_OT_insert(wmOperatorType *ot)
void TEXT_OT_reload(wmOperatorType *ot)
void ED_region_header(const bContext *C, ARegion *region)
static void text_properties_region_init(wmWindowManager *wm, ARegion *region)
static bool text_drop_string_poll(bContext *, wmDrag *drag, const wmEvent *)
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
void ED_text_format_register_glsl()
static bool text_drop_path_poll(bContext *, wmDrag *drag, const wmEvent *)
static void text_drop_id_copy(bContext *, wmDrag *drag, wmDropBox *drop)
void TEXT_OT_copy(wmOperatorType *ot)
static SpaceLink * text_duplicate(SpaceLink *sl)
void TEXT_OT_run_script(wmOperatorType *ot)
void ED_area_tag_redraw(ScrArea *area)
void TEXT_OT_save_as(wmOperatorType *ot)
void TEXT_OT_line_number(wmOperatorType *ot)
void(*) cursor(wmWindow *win, ScrArea *area, ARegion *region)
int(*) snap_size(const ARegion *region, int size, int axis)
void(*) draw(const bContext *C, ARegion *region)
std::optional< ARegionIMECursorState >(*) cursor_ime(wmWindow *win, const ScrArea *area, const ARegion *region, ARegionIMECursor *r_cursor)
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
ListBaseT< SpaceLink > spacedata
ListBaseT< ARegion > regionbase
ed::text::SpaceText_Runtime * runtime
ListBaseT< wmEventHandler > handlers
rcti scroll_region_handle
const wmNotifier * notifier
bke::WindowRuntime * runtime