Blender V5.3
space_text.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstring>
10
11#include "DNA_space_types.h"
12#include "DNA_text_types.h"
13
14#include "MEM_guardedalloc.h"
15
16#include "BLI_listbase.hh"
17#include "BLI_string_utf8.hh"
18
19#include "BKE_context.hh"
20#include "BKE_lib_query.hh"
21#include "BKE_lib_remap.hh"
22#include "BKE_screen.hh"
23#include "BKE_text.h"
24
25#include "ED_screen.hh"
26#include "ED_space_api.hh"
27
28#include "WM_api.hh"
29#include "WM_types.hh"
30
31#include "UI_interface.hh"
32#include "UI_resources.hh"
33#include "UI_view2d.hh"
34
35#include "BLO_read_write.hh"
36
37#include "RNA_access.hh"
38#include "RNA_path.hh"
39
40#include "text_format.hh"
41#include "text_intern.hh" /* Own include. */
42
43namespace blender {
44
45/* -------------------------------------------------------------------- */
48
49static SpaceLink *text_create(const ScrArea * /*area*/, const Scene * /*scene*/)
50{
51 ARegion *region;
52 SpaceText *stext;
53
54 stext = MEM_new<SpaceText>("inittext");
55 stext->spacetype = SPACE_TEXT;
56
57 stext->line_height = 12;
58 stext->tabnumber = 4;
59 stext->margin_column = 80;
60 stext->showsyntax = true;
61 stext->showlinenrs = true;
62 stext->flags |= ST_FIND_WRAP;
63
64 stext->runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
65
66 /* Header. */
67 region = BKE_area_region_new();
68
69 BLI_addtail(&stext->regionbase, region);
72
73 /* Footer. */
74 region = BKE_area_region_new();
75 BLI_addtail(&stext->regionbase, region);
78
79 /* Properties region. */
80 region = BKE_area_region_new();
81
82 BLI_addtail(&stext->regionbase, region);
83 region->regiontype = RGN_TYPE_UI;
84 region->alignment = RGN_ALIGN_RIGHT;
85 region->flag = RGN_FLAG_HIDDEN;
86
87 /* Main region. */
88 region = BKE_area_region_new();
89
90 BLI_addtail(&stext->regionbase, region);
92
93 return reinterpret_cast<SpaceLink *>(stext);
94}
95
96/* Doesn't free the space-link itself. */
97static void text_free(SpaceLink *sl)
98{
99 SpaceText *stext = reinterpret_cast<SpaceText *>(sl);
101 MEM_delete(stext->runtime);
102 stext->text = nullptr;
103}
104
105/* Spacetype; init callback. */
106static void text_init(wmWindowManager * /*wm*/, ScrArea * /*area*/) {}
107
109{
110 SpaceText *stextn = MEM_dupalloc(reinterpret_cast<SpaceText *>(sl));
111
112 /* Add its own runtime data. */
113 stextn->runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
114
115 return reinterpret_cast<SpaceLink *>(stextn);
116}
117
118#ifdef WITH_INPUT_IME
119static std::optional<ARegionIMECursorState> text_main_region_cursor_ime(wmWindow * /*win*/,
120 const ScrArea *area,
121 const ARegion *region,
122 ARegionIMECursor *r_cursor)
123{
124 SpaceText *st = area->spacedata.first_as<SpaceText>();
125 /* Pending while scrolling, since the position is valid again once it ends.
126 * This must *not* cancel the composition. */
127 if (st->flags & ST_SCROLL_SELECT) {
129 }
130
131 /* Font metrics are cached during draw; zero means the region hasn't been drawn yet. */
132 if (st->runtime->line_height_px == 0) {
134 }
135
136 const std::optional<int2> cursor_xy = space_text_cursor_region_xy_get(st, region);
137 if (!cursor_xy) {
138 return std::nullopt;
139 }
140 const int x = (*cursor_xy)[0];
141 const int y = (*cursor_xy)[1];
142
143 /* Report the glyph extent, not the line cell: the preview sits its baseline a descender
144 * above `ymin` (see #region_overlay_draw) while the editor draws text one line height
145 * below the cell top, both use the same font & size so the descender matches. */
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;
149
150 r_cursor->rect = {
151 .xmin = x,
152 .xmax = x,
153 .ymin = ymin,
154 .ymax = ymin + line_height,
155 };
156 r_cursor->font_size = line_height;
158}
159
160#endif
161
162static void text_listener(const wmSpaceTypeListenerParams *params)
163{
164 ScrArea *area = params->area;
165 const wmNotifier *wmn = params->notifier;
166 SpaceText *st = area->spacedata.first_as<SpaceText>();
167
168 /* context changes. */
169 switch (wmn->category) {
170 case NC_TEXT:
171 /* Check if active text was changed, no need to redraw if text isn't active
172 * `reference == nullptr` means text was unlinked, should update anyway for this
173 * case -- no way to know was text active before unlinking or not. */
174 if (wmn->reference && wmn->reference != st->text) {
175 break;
176 }
177
178 switch (wmn->data) {
179 case ND_DISPLAY:
180 case ND_CURSOR:
181 ED_area_tag_redraw(area);
182 break;
183 }
184
185 switch (wmn->action) {
186 case NA_EDITED:
187 if (st->text) {
190 }
191
192 ED_area_tag_redraw(area);
193 ATTR_FALLTHROUGH; /* Fall down to tag redraw. */
194 case NA_ADDED:
195 case NA_REMOVED:
196 case NA_SELECTED:
197 ED_area_tag_redraw(area);
198 break;
199 }
200
201 break;
202 case NC_SPACE:
203 if (wmn->data == ND_SPACE_TEXT) {
204 ED_area_tag_redraw(area);
205 }
206 break;
207 }
208}
209
211{
220
225
231
235
237
243
249
252
257
260
262
264
266
268}
269
270static void text_keymap(wmKeyConfig *keyconf)
271{
272 WM_keymap_ensure(keyconf, "Text Generic", SPACE_TEXT, RGN_TYPE_WINDOW);
274}
275
276const char *text_context_dir[] = {"edit_text", nullptr};
277
278static int /*eContextResult*/ text_context(const bContext *C,
279 const char *member,
281{
283
284 if (CTX_data_dir(member)) {
286 return CTX_RESULT_OK;
287 }
288 if (CTX_data_equals(member, "edit_text")) {
289 if (st->text != nullptr) {
291 }
292 return CTX_RESULT_OK;
293 }
294
296}
297
299
300/* -------------------------------------------------------------------- */
303
304/* Add handlers, stuff you only do once or on area/region changes. */
306{
307 wmKeyMap *keymap;
308 ListBaseT<wmDropBox> *lb;
309
310 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_STANDARD, region->winx, region->winy);
311
312 /* Own keymap. */
313 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Text Generic", SPACE_TEXT, RGN_TYPE_WINDOW);
315 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Text", SPACE_TEXT, RGN_TYPE_WINDOW);
317
318 /* Add drop boxes. */
320
322}
323
324static void text_main_region_draw(const bContext *C, ARegion *region)
325{
326 /* Draw entirely, view changes should be handled here. */
328 // View2D *v2d = &region->v2d;
329
330 /* Clear and setup matrix. */
332
333 // view2d_view_ortho(v2d);
334
335 /* Data. */
336 draw_text_main(st, region);
337
338 /* Reset view matrix. */
339 // view2d_view_restore(C);
340
341 /* Scroll-bars? */
342}
343
344static void text_cursor(wmWindow *win, ScrArea *area, ARegion *region)
345{
346 SpaceText *st = area->spacedata.first_as<SpaceText>();
347 int wmcursor = WM_CURSOR_TEXT_EDIT;
348
350 win->runtime->eventstate->xy[0] - region->winrct.xmin,
352 {
353 wmcursor = WM_CURSOR_DEFAULT;
354 }
355
356 WM_cursor_set(win, wmcursor);
357}
358
360
361/* -------------------------------------------------------------------- */
364
365static bool text_drop_path_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
366{
367 if (drag->type == WM_DRAG_PATH) {
369 if (ELEM(file_type, FILE_TYPE_PYSCRIPT, FILE_TYPE_TEXT)) {
370 return true;
371 }
372 }
373 return false;
374}
375
376static void text_drop_path_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
377{
378 /* Copy drag path to properties. */
379 RNA_string_set(drop->ptr, "filepath", WM_drag_get_single_path(drag));
380}
381
382static bool text_drop_id_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
383{
384 return (drag->type == WM_DRAG_ID);
385}
386
387static void text_drop_id_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
388{
389 ID *id = WM_drag_get_local_ID(drag, 0);
390
391 /* Copy drag path to properties. */
392 std::string text = RNA_path_full_ID_py(id);
393 RNA_string_set(drop->ptr, "text", text.c_str());
394}
395
396static bool text_drop_string_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
397{
398 return (drag->type == WM_DRAG_STRING);
399}
400
401static void text_drop_string_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
402{
403 const std::string &str = WM_drag_get_string(drag);
404 RNA_string_set(drop->ptr, "text", str.c_str());
405}
406
407/* This region dropbox definition. */
408static void text_dropboxes()
409{
410 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW);
411
412 WM_dropbox_add(lb, "TEXT_OT_open", text_drop_path_poll, text_drop_path_copy, nullptr, nullptr);
413 WM_dropbox_add(lb, "TEXT_OT_insert", text_drop_id_poll, text_drop_id_copy, nullptr, nullptr);
415 lb, "TEXT_OT_insert", text_drop_string_poll, text_drop_string_copy, nullptr, nullptr);
416}
417
419
420/* -------------------------------------------------------------------- */
423
424/* Add handlers, stuff you only do once or on area/region changes. */
425static void text_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
426{
427 ED_region_header_init(region);
428}
429
430static void text_header_region_draw(const bContext *C, ARegion *region)
431{
432 ED_region_header(C, region);
433}
434
436
437/* -------------------------------------------------------------------- */
440
441/* Add handlers, stuff you only do once or on area/region changes. */
443{
444 wmKeyMap *keymap;
445
447 ED_region_panels_init(wm, region);
448
449 /* Own keymaps. */
450 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Text Generic", SPACE_TEXT, RGN_TYPE_WINDOW);
452}
453
454static void text_properties_region_draw(const bContext *C, ARegion *region)
455{
456 ED_region_panels(C, region);
457}
458
459static void text_id_remap(ScrArea * /*area*/,
460 SpaceLink *slink,
461 const bke::id::IDRemapper &mappings)
462{
463 SpaceText *stext = reinterpret_cast<SpaceText *>(slink);
464 mappings.apply(reinterpret_cast<ID **>(&stext->text), ID_REMAP_APPLY_ENSURE_REAL);
465}
466
468{
469 SpaceText *st = reinterpret_cast<SpaceText *>(space_link);
472}
473
475{
476 SpaceText *st = reinterpret_cast<SpaceText *>(sl);
477 st->runtime = MEM_new<ed::text::SpaceText_Runtime>(__func__);
478
479 /* Live edit runs scripts, don't keep this setting on file load since it's
480 * not obvious editing the text has this consequence. */
481 st->live_edit = false;
482}
483
485{
486 writer->write_struct_cast<SpaceText>(sl, [](BlendStructWriter<SpaceText> &struct_writer) {
487 struct_writer.shallow_data.runtime = nullptr;
488 struct_writer.shallow_data.live_edit = false;
489 });
490}
491
493
494/* -------------------------------------------------------------------- */
497
499{
500 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
501 ARegionType *art;
502
503 st->spaceid = SPACE_TEXT;
504 STRNCPY_UTF8(st->name, "Text");
505 st->struct_size = sizeof(SpaceText);
506
507 st->create = text_create;
508 st->free = text_free;
509 st->init = text_init;
510 st->duplicate = text_duplicate;
511 st->operatortypes = text_operatortypes;
512 st->keymap = text_keymap;
513 st->listener = text_listener;
514 st->context = text_context;
515 st->dropboxes = text_dropboxes;
516 st->id_remap = text_id_remap;
517 st->foreach_id = text_foreach_id;
518 st->blend_read_data = text_space_blend_read_data;
519 st->blend_read_after_liblink = nullptr;
520 st->blend_write = text_space_blend_write;
521
522 /* Regions: main window. */
523 art = MEM_new_zeroed<ARegionType>("spacetype text region");
527 art->cursor = text_cursor;
528 art->event_cursor = true;
529#ifdef WITH_INPUT_IME
530 art->cursor_ime = text_main_region_cursor_ime;
531#endif
532
533 BLI_addhead(&st->regiontypes, art);
534
535 /* Regions: properties. */
536 art = MEM_new_zeroed<ARegionType>("spacetype text region");
537 art->regionid = RGN_TYPE_UI;
541
545 BLI_addhead(&st->regiontypes, art);
546
547 /* Regions: header. */
548 art = MEM_new_zeroed<ARegionType>("spacetype text region");
550 art->prefsizey = HEADERY;
552
555 BLI_addhead(&st->regiontypes, art);
556
557 /* Regions: footer. */
558 art = MEM_new_zeroed<ARegionType>("spacetype text region");
560 art->prefsizey = HEADERY;
564 BLI_addhead(&st->regiontypes, art);
565
566 BKE_spacetype_register(std::move(st));
567
568 /* Register formatters.
569 * The first registered formatter is default when there is no extension in the ID-name. */
570 ED_text_format_register_py(); /* Keep first (default formatter). */
575}
576
578
579} // namespace blender
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define ATTR_FALLTHROUGH
#define STRNCPY_UTF8(dst, src)
#define HEADERY
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_COMPACT_PANEL_WIDTH
#define ND_CURSOR
Definition WM_types.hh:533
#define ND_DISPLAY
Definition WM_types.hh:534
#define NA_ADDED
Definition WM_types.hh:636
#define NA_EDITED
Definition WM_types.hh:634
#define NC_TEXT
Definition WM_types.hh:399
#define NA_REMOVED
Definition WM_types.hh:637
#define ND_SPACE_TEXT
Definition WM_types.hh:573
#define NC_SPACE
Definition WM_types.hh:405
#define NA_SELECTED
Definition WM_types.hh:639
#define ELEM(...)
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
#define str(s)
void frame_buffer_clear(int colorid)
@ V2D_COMMONVIEW_STANDARD
Definition UI_view2d.hh:58
BMesh Iterators.
UserDef U
Definition blender.cc:58
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)
Definition text_ops.cc:2582
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)
Definition text_ops.cc:383
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)
Definition text_draw.cc:757
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:98
void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot)
Definition text_ops.cc:1183
void TEXT_OT_make_internal(wmOperatorType *ot)
Definition text_ops.cc:683
static void text_header_region_init(wmWindowManager *, ARegion *region)
void ED_text_format_register_py()
void TEXT_OT_cursor_set(wmOperatorType *ot)
Definition text_ops.cc:3477
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)
Definition text_ops.cc:4328
@ WM_DRAG_STRING
Definition WM_types.hh:1311
@ WM_DRAG_PATH
Definition WM_types.hh:1302
static void text_drop_path_copy(bContext *, wmDrag *drag, wmDropBox *drop)
void TEXT_OT_scroll_bar(wmOperatorType *ot)
Definition text_ops.cc:3027
void TEXT_OT_resolve_conflict(wmOperatorType *ot)
Definition text_ops.cc:4291
static void text_header_region_draw(const bContext *C, ARegion *region)
void TEXT_OT_select_all(wmOperatorType *ot)
Definition text_ops.cc:1601
static void text_operatortypes()
void TEXT_OT_convert_whitespace(wmOperatorType *ot)
Definition text_ops.cc:1558
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)
Definition text_ops.cc:1060
static void text_main_region_init(wmWindowManager *wm, ARegion *region)
static void text_update_edited(bContext *C, Object *obedit, const eEditFontMode mode)
Definition editfont.cc:408
void TEXT_OT_unindent(wmOperatorType *ot)
Definition text_ops.cc:1270
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)
Definition text_ops.cc:4443
SpaceText * CTX_wm_space_text(const bContext *C)
void TEXT_OT_save(wmOperatorType *ot)
Definition text_ops.cc:787
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)
Definition text_ops.cc:1327
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)
Definition area_utils.cc:73
void TEXT_OT_select_word(wmOperatorType *ot)
Definition text_ops.cc:1666
void ED_spacetype_text()
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)
Definition text_ops.cc:647
std::string RNA_path_full_ID_py(ID *id)
Definition rna_path.cc:1290
void TEXT_OT_jump(wmOperatorType *ot)
Definition text_ops.cc:2454
void TEXT_OT_scroll(wmOperatorType *ot)
Definition text_ops.cc:2917
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3999
void TEXT_OT_replace(wmOperatorType *ot)
Definition text_ops.cc:3926
static void text_keymap(wmKeyConfig *keyconf)
void TEXT_OT_comment_toggle(wmOperatorType *ot)
Definition text_ops.cc:1385
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)
Definition wm_keymap.cc:935
static void text_free(SpaceLink *sl)
Definition space_text.cc:97
void TEXT_OT_replace_set_selected(wmOperatorType *ot)
Definition text_ops.cc:4000
void TEXT_OT_jump_to_file_at_point(wmOperatorType *ot)
Definition text_ops.cc:4170
void TEXT_OT_cut(wmOperatorType *ot)
Definition text_ops.cc:1147
static void text_init(wmWindowManager *, ScrArea *)
void TEXT_OT_select_line(wmOperatorType *ot)
Definition text_ops.cc:1633
ARegion * BKE_area_region_new()
Definition screen.cc:522
const char * text_context_dir[]
void TEXT_OT_open(wmOperatorType *ot)
Definition text_ops.cc:495
void space_text_free_caches(SpaceText *st)
Definition text_draw.cc:806
bool CTX_data_dir(const char *member)
static void text_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
@ ED_KEYMAP_UI
Definition ED_screen.hh:852
@ ED_KEYMAP_FOOTER
Definition ED_screen.hh:859
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:858
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:855
void TEXT_OT_move_lines(wmOperatorType *ot)
Definition text_ops.cc:1704
void TEXT_OT_start_find(wmOperatorType *ot)
static SpaceLink * text_create(const ScrArea *, const Scene *)
Definition space_text.cc:49
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)
Definition text_ops.cc:3428
@ V2D_SCROLL_VERTICAL_HIDE
void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
Definition text_ops.cc:2624
@ WM_CURSOR_TEXT_EDIT
Definition wm_cursors.hh:18
@ WM_CURSOR_DEFAULT
Definition wm_cursors.hh:17
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
static void text_listener(const wmSpaceTypeListenerParams *params)
void TEXT_OT_find_set_selected(wmOperatorType *ot)
Definition text_ops.cc:3969
void TEXT_OT_find(wmOperatorType *ot)
Definition text_ops.cc:3857
void TEXT_OT_move_select(wmOperatorType *ot)
Definition text_ops.cc:2401
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:379
void TEXT_OT_indent(wmOperatorType *ot)
Definition text_ops.cc:1229
void ED_region_header_init(ARegion *region)
Definition area.cc:4406
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)
Definition text_ops.cc:2373
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)
Definition text_ops.cc:1012
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)
Definition text_ops.cc:3746
void TEXT_OT_reload(wmOperatorType *ot)
Definition text_ops.cc:585
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:4391
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)
Definition area.cc:4006
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)
Definition text_ops.cc:1106
static SpaceLink * text_duplicate(SpaceLink *sl)
void TEXT_OT_run_script(wmOperatorType *ot)
Definition text_ops.cc:947
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void TEXT_OT_save_as(wmOperatorType *ot)
Definition text_ops.cc:867
void TEXT_OT_line_number(wmOperatorType *ot)
Definition text_ops.cc:3547
void(*) cursor(wmWindow *win, ScrArea *area, ARegion *region)
ARegionTypeFlag flag
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
eRegion_Type regiontype
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
ListBaseT< SpaceLink > spacedata
eSpaceText_Flags flags
ListBaseT< ARegion > regionbase
ed::text::SpaceText_Runtime * runtime
eView2D_Scroll scroll
ListBaseT< wmEventHandler > handlers
eWM_DragDataType type
Definition WM_types.hh:1424
PointerRNA * ptr
Definition WM_types.hh:1524
unsigned int action
Definition WM_types.hh:371
unsigned int category
Definition WM_types.hh:371
unsigned int data
Definition WM_types.hh:371
bke::WindowRuntime * runtime