|
Blender V4.5
|
#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "CLG_log.h"#include "BLI_array_utils.h"#include "BLI_utildefines.h"#include "DNA_curve_types.h"#include "DNA_object_types.h"#include "BKE_context.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_undo_system.hh"#include "BKE_vfont.hh"#include "DEG_depsgraph.hh"#include "ED_curve.hh"#include "ED_undo.hh"#include "WM_api.hh"#include "WM_types.hh"#include "BLI_array_store.h"#include "BLI_array_store_utils.h"#include "BLI_listbase.h"Go to the source code of this file.
Classes | |
| struct | UndoFont |
| struct | FontUndoStep |
| struct | [struct].uf_arraystore |
Macros | |
| #define | USE_ARRAY_STORE |
| #define | ARRAY_CHUNK_SIZE 32 |
| #define | STATE_COMPACT(uf, id, len) |
| #define | STATE_EXPAND(uf, id, len) |
| #define | STATE_FREE(uf, id) |
Functions | |
| static void | undofont_to_editfont (UndoFont *uf, Curve *cu) |
| static void * | undofont_from_editfont (UndoFont *uf, Curve *cu) |
| static void | undofont_free_data (UndoFont *uf) |
| static Object * | editfont_object_from_context (bContext *C) |
Implements ED Undo System | |
| static bool | font_undosys_poll (bContext *C) |
| static bool | font_undosys_step_encode (bContext *C, Main *bmain, UndoStep *us_p) |
| static void | font_undosys_step_decode (bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir, bool) |
| static void | font_undosys_step_free (UndoStep *us_p) |
| static void | font_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) |
| void | ED_font_undosys_type (UndoType *ut) |
Variables | |
| static CLG_LogRef | LOG = {"ed.undo.font"} |
Array Store | |
| static struct | uf_arraystore = {{nullptr}} |
| static void | uf_arraystore_compact_ex (UndoFont *uf, const UndoFont *uf_ref, bool create) |
| static void | uf_arraystore_compact (UndoFont *um, const UndoFont *uf_ref) |
| static void | uf_arraystore_compact_with_info (UndoFont *um, const UndoFont *uf_ref) |
| static void | uf_arraystore_expand_clear (UndoFont *um) |
| static void | uf_arraystore_expand (UndoFont *uf) |
| static void | uf_arraystore_free (UndoFont *uf) |
| #define ARRAY_CHUNK_SIZE 32 |
Definition at line 43 of file editfont_undo.cc.
Referenced by text_undosys_step_encode_to_state().
| #define STATE_COMPACT | ( | uf, | |
| id, | |||
| len ) |
Referenced by uf_arraystore_compact_ex().
| #define STATE_EXPAND | ( | uf, | |
| id, | |||
| len ) |
Referenced by uf_arraystore_expand().
| #define STATE_FREE | ( | uf, | |
| id ) |
Referenced by uf_arraystore_free().
| #define USE_ARRAY_STORE |
Definition at line 36 of file editfont_undo.cc.
| void ED_font_undosys_type | ( | UndoType * | ut | ) |
Export for ED_undo_sys.
Definition at line 403 of file editfont_undo.cc.
References ED_font_undosys_type(), UndoType::flags, font_undosys_foreach_ID_ref(), font_undosys_poll(), font_undosys_step_decode(), font_undosys_step_encode(), font_undosys_step_free(), UndoType::name, UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_foreach_ID_ref, UndoType::step_free, UndoType::step_size, and UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE.
Referenced by ED_font_undosys_type(), and ED_undosys_type_init().
Definition at line 310 of file editfont_undo.cc.
References BKE_view_layer_edit_object_get(), BKE_view_layer_synced_ensure(), C, CTX_data_scene(), CTX_data_view_layer(), Object::data, Curve::editfont, editfont_object_from_context(), OB_FONT, and Object::type.
Referenced by editfont_object_from_context(), font_undosys_poll(), and font_undosys_step_encode().
|
static |
Definition at line 394 of file editfont_undo.cc.
References font_undosys_foreach_ID_ref(), FontUndoStep::obedit_ref, and FontUndoStep::scene_ref.
Referenced by ED_font_undosys_type(), and font_undosys_foreach_ID_ref().
|
static |
Definition at line 341 of file editfont_undo.cc.
References C, editfont_object_from_context(), and font_undosys_poll().
Referenced by ED_font_undosys_type(), font_undosys_poll(), and font_undosys_step_decode().
|
static |
Definition at line 360 of file editfont_undo.cc.
References BLI_assert, C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_manager(), FontUndoStep::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_editmode_validate_scene_from_windows(), ED_undo_object_set_active_or_warn(), Curve::editfont, font_undosys_poll(), font_undosys_step_decode(), Curve::id, ID_RECALC_GEOMETRY, Main::is_memfile_undo_flush_needed, LOG, UndoStep::name, NC_GEOM, ND_DATA, EditFont::needs_flush_to_id, FontUndoStep::obedit_ref, FontUndoStep::scene_ref, undofont_to_editfont(), and WM_event_add_notifier().
Referenced by ED_font_undosys_type(), and font_undosys_step_decode().
Definition at line 346 of file editfont_undo.cc.
References C, CTX_data_scene(), FontUndoStep::data, UndoStep::data_size, Curve::editfont, editfont_object_from_context(), font_undosys_step_encode(), Main::is_memfile_undo_flush_needed, EditFont::needs_flush_to_id, FontUndoStep::obedit_ref, FontUndoStep::scene_ref, FontUndoStep::step, UndoFont::undo_size, and undofont_from_editfont().
Referenced by ED_font_undosys_type(), and font_undosys_step_encode().
|
static |
Definition at line 388 of file editfont_undo.cc.
References FontUndoStep::data, font_undosys_step_free(), and undofont_free_data().
Referenced by ED_font_undosys_type(), and font_undosys_step_free().
Move data from allocated arrays to de-duplicated states and clear arrays.
Definition at line 121 of file editfont_undo.cc.
References uf_arraystore_compact(), and uf_arraystore_compact_ex().
Referenced by uf_arraystore_compact(), and uf_arraystore_compact_with_info().
| create | When false, only free the arrays. This is done since when reading from an undo state, they must be temporarily expanded. then discarded afterwards, having this argument avoids having 2x code paths. |
Definition at line 89 of file editfont_undo.cc.
References UndoFont::len, STATE_COMPACT, uf_arraystore, and uf_arraystore_compact_ex().
Referenced by uf_arraystore_compact(), uf_arraystore_compact_ex(), and uf_arraystore_expand_clear().
Definition at line 126 of file editfont_undo.cc.
References BLI_array_store_at_size_calc_memory_usage(), printf, uf_arraystore, uf_arraystore_compact(), and uf_arraystore_compact_with_info().
Referenced by uf_arraystore_compact_with_info(), and undofont_from_editfont().
|
static |
Definition at line 167 of file editfont_undo.cc.
References UndoFont::len, STATE_EXPAND, and uf_arraystore_expand().
Referenced by uf_arraystore_expand(), and undofont_to_editfont().
|
static |
Remove data we only expanded for temporary use.
Definition at line 162 of file editfont_undo.cc.
References uf_arraystore_compact_ex(), and uf_arraystore_expand_clear().
Referenced by uf_arraystore_expand_clear(), and undofont_to_editfont().
|
static |
Definition at line 186 of file editfont_undo.cc.
References BLI_array_store_at_size_clear(), BLI_assert, printf, STATE_FREE, uf_arraystore, and uf_arraystore_free().
Referenced by uf_arraystore_free(), and undofont_free_data().
|
static |
Definition at line 290 of file editfont_undo.cc.
References BLI_findptr(), BLI_remlink(), data, MEM_freeN(), offsetof, UndoFont::textbuf, UndoFont::textbufinfo, uf_arraystore, uf_arraystore_free(), and undofont_free_data().
Referenced by font_undosys_step_free(), and undofont_free_data().
Definition at line 246 of file editfont_undo.cc.
References BLI_addtail(), BLI_array_is_zeroed, BLI_assert, BLI_genericNodeN(), Curve::editfont, EditFont::len, UndoFont::len, MEM_get_memory_in_use, MEM_mallocN(), EditFont::pos, UndoFont::pos, EditFont::selend, UndoFont::selend, EditFont::selstart, UndoFont::selstart, EditFont::textbuf, UndoFont::textbuf, EditFont::textbufinfo, UndoFont::textbufinfo, uf_arraystore, uf_arraystore_compact_with_info(), UndoFont::undo_size, and undofont_from_editfont().
Referenced by font_undosys_step_encode(), and undofont_from_editfont().
Definition at line 220 of file editfont_undo.cc.
References Curve::editfont, EditFont::len, UndoFont::len, EditFont::pos, UndoFont::pos, EditFont::selend, UndoFont::selend, EditFont::selstart, UndoFont::selstart, EditFont::textbuf, UndoFont::textbuf, EditFont::textbufinfo, UndoFont::textbufinfo, uf_arraystore_expand(), uf_arraystore_expand_clear(), and undofont_to_editfont().
Referenced by font_undosys_step_decode(), and undofont_to_editfont().
|
static |
Only needed this locally.
Definition at line 47 of file editfont_undo.cc.
| struct [struct].uf_arraystore uf_arraystore |