48 SpaceSpreadsheet *spreadsheet_space = MEM_cnew<SpaceSpreadsheet>(
"spreadsheet space");
55 ARegion *region = MEM_cnew<ARegion>(
"spreadsheet header");
63 ARegion *region = MEM_cnew<ARegion>(
"spreadsheet footer region");
71 ARegion *region = MEM_cnew<ARegion>(
"spreadsheet dataset region");
79 ARegion *region = MEM_cnew<ARegion>(
"spreadsheet right region");
88 ARegion *region = MEM_cnew<ARegion>(
"spreadsheet main region");
100 MEM_delete(sspreadsheet->
runtime);
117 sspreadsheet->
runtime = MEM_new<SpaceSpreadsheet_Runtime>(__func__);
125 if (sspreadsheet_old->
runtime) {
126 sspreadsheet_new->
runtime = MEM_new<SpaceSpreadsheet_Runtime>(__func__,
130 sspreadsheet_new->
runtime = MEM_new<SpaceSpreadsheet_Runtime>(__func__);
161 const IDRemapper *mappings)
171 object_context->
object =
nullptr;
210 return (
ID *)object_context->
object;
257 if (used_id ==
nullptr) {
261 if (id_type !=
ID_OB) {
276 if (object_eval ==
nullptr) {
300 static const float float_width = 3;
301 switch (values.
type()) {
310 return 2.0f * float_width;
312 return 3.0f * float_width;
315 return 4.0f * float_width;
333 return std::max<float>(name_width /
UI_UNIT_X + 1.0f, data_width);
353 std::unique_ptr<ColumnValues> values = data_source.
get_column_values(*column->id);
361 if (!used_ids.
add(*column->id)) {
373 if (used_ids.
add(column_id)) {
374 SpreadsheetColumnID *new_id = spreadsheet_column_id_copy(&column_id);
375 SpreadsheetColumn *new_column = spreadsheet_column_new(new_id);
377 BLI_addhead(&columns, new_column);
380 BLI_addtail(&columns, new_column);
395 data_source = std::make_unique<DataSource>();
404 std::unique_ptr<ColumnValues> values_ptr = data_source->get_column_values(*column->id);
414 const int tot_rows = data_source->tot_rows();
417 *sspreadsheet, spreadsheet_layout, *data_source, scope);
528 std::stringstream ss;
531 char visible_rows_str[16];
533 ss << visible_rows_str <<
" / ";
535 char tot_rows_str[16];
537 ss << tot_rows_str <<
" | Columns: " << runtime->
tot_columns;
538 std::string stats_str = ss.str();
555 uiItemL(layout, stats_str.c_str(), ICON_NONE);
618 SpaceType *
st = MEM_cnew<SpaceType>(
"spacetype spreadsheet");
633 art = MEM_cnew<ARegionType>(
"spacetype spreadsheet region");
643 art = MEM_cnew<ARegionType>(
"spacetype spreadsheet header region");
656 art = MEM_cnew<ARegionType>(
"spacetype spreadsheet footer region");
669 art = MEM_cnew<ARegionType>(
"spacetype spreadsheet right region");
684 art = MEM_cnew<ARegionType>(
"spreadsheet dataset region");
struct ScrArea * CTX_wm_area(const bContext *C)
struct SpaceSpreadsheet * CTX_wm_space_spreadsheet(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
IDRemapperApplyResult BKE_id_remapper_apply(const struct IDRemapper *id_remapper, struct ID **r_id_ptr, IDRemapperApplyOptions options)
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
void BKE_spacetype_register(struct SpaceType *st)
float BLF_width(int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_size(int fontid, float size, int dpi)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
size_t BLI_str_format_int_grouped(char dst[16], int num) ATTR_NONNULL()
struct Depsgraph Depsgraph
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ SPREADSHEET_CONTEXT_OBJECT
@ SPREADSHEET_FILTER_ENABLE
@ SPREADSHEET_VALUE_TYPE_INT8
@ SPREADSHEET_VALUE_TYPE_FLOAT
@ SPREADSHEET_VALUE_TYPE_BYTE_COLOR
@ SPREADSHEET_VALUE_TYPE_UNKNOWN
@ SPREADSHEET_VALUE_TYPE_FLOAT3
@ SPREADSHEET_VALUE_TYPE_BOOL
@ SPREADSHEET_VALUE_TYPE_STRING
@ SPREADSHEET_VALUE_TYPE_INT32
@ SPREADSHEET_VALUE_TYPE_FLOAT2
@ SPREADSHEET_VALUE_TYPE_COLOR
@ SPREADSHEET_VALUE_TYPE_INSTANCES
#define SPREADSHEET_WIDTH_UNIT
@ SPREADSHEET_FLAG_PINNED
void ED_area_tag_redraw(ScrArea *area)
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_region_panels(const struct bContext *C, struct ARegion *region)
void ED_region_panels_draw(const struct bContext *C, struct ARegion *region)
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region)
void ED_region_tag_redraw(struct ARegion *region)
void ED_region_header_init(struct ARegion *region)
void ED_region_panels_layout(const struct bContext *C, struct ARegion *region)
bool ED_spreadsheet_context_path_update_tag(struct SpaceSpreadsheet *sspreadsheet)
bool ED_spreadsheet_context_path_is_active(const struct bContext *C, struct SpaceSpreadsheet *sspreadsheet)
bool ED_spreadsheet_context_path_exists(struct Main *bmain, struct SpaceSpreadsheet *sspreadsheet)
void ED_spreadsheet_context_path_guess(const struct bContext *C, struct SpaceSpreadsheet *sspreadsheet)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Read Guarded memory(de)allocation.
void UI_panel_category_active_set_default(struct ARegion *region, const char *idname)
#define UI_SIDEBAR_PANEL_WIDTH
const struct uiStyle * UI_style_get_dpi(void)
void uiItemL(uiLayout *layout, const char *name, int icon)
const struct uiStyle * UI_style_get(void)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
void UI_block_end(const struct bContext *C, uiBlock *block)
void uiItemSpacer(uiLayout *layout)
void UI_block_draw(const struct bContext *C, struct uiBlock *block)
uiLayout * UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, const struct uiStyle *style)
uiBlock * UI_block_begin(const struct bContext *C, struct ARegion *region, const char *name, eUIEmbossType emboss)
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
#define UI_DEFAULT_TEXT_POINTS
void UI_block_align_end(uiBlock *block)
void UI_ThemeClearColor(int colorid)
void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy)
#define ND_SPACE_SPREADSHEET
T * add(std::unique_ptr< T > resource)
constexpr int64_t size() const
constexpr const char * data() const
StringRefNull name() const
eSpreadsheetColumnValueType type() const
virtual void foreach_default_column_ids(FunctionRef< void(const SpreadsheetColumnID &, bool is_extra)>) const
virtual std::unique_ptr< ColumnValues > get_column_values(const SpreadsheetColumnID &) const
const Depsgraph * depsgraph
void *(* MEM_dupallocN)(const void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
SpreadsheetContext * spreadsheet_context_copy(const SpreadsheetContext *old_context)
void spreadsheet_context_free(SpreadsheetContext *context)
IndexMask spreadsheet_filter_rows(const SpaceSpreadsheet &sspreadsheet, const SpreadsheetLayout &spreadsheet_layout, const DataSource &data_source, ResourceScope &scope)
void draw_spreadsheet_in_region(const bContext *C, ARegion *region, const SpreadsheetDrawer &drawer)
SpreadsheetRowFilter * spreadsheet_row_filter_copy(const SpreadsheetRowFilter *src_row_filter)
std::unique_ptr< DataSource > data_source_from_geometry(const bContext *C, Object *object_eval)
void spreadsheet_column_free(SpreadsheetColumn *column)
std::unique_ptr< SpreadsheetDrawer > spreadsheet_drawer_from_layout(const SpreadsheetLayout &spreadsheet_layout)
void spreadsheet_row_filter_free(SpreadsheetRowFilter *row_filter)
void spreadsheet_column_assign_runtime_data(SpreadsheetColumn *column, const eSpreadsheetColumnValueType data_type, const StringRefNull display_name)
void spreadsheet_data_set_region_panels_register(ARegionType ®ion_type)
SpreadsheetColumn * spreadsheet_column_copy(const SpreadsheetColumn *src_column)
std::string to_string(const T &n)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static std::unique_ptr< DataSource > get_data_source(const bContext *C)
static void spreadsheet_free(SpaceLink *sl)
static void spreadsheet_init(wmWindowManager *UNUSED(wm), ScrArea *area)
static void spreadsheet_keymap(wmKeyConfig *keyconf)
static void spreadsheet_right_region_listener(const wmRegionListenerParams *UNUSED(params))
static int get_index_column_width(const int tot_rows)
void spreadsheet_update_context_path(const bContext *C)
static void spreadsheet_footer_region_listener(const wmRegionListenerParams *UNUSED(params))
static void spreadsheet_header_region_listener(const wmRegionListenerParams *params)
static void spreadsheet_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
static void spreadsheet_main_region_init(wmWindowManager *wm, ARegion *region)
ID * ED_spreadsheet_get_current_id(const struct SpaceSpreadsheet *sspreadsheet)
static void spreadsheet_sidebar_init(wmWindowManager *wm, ARegion *region)
void ED_spacetype_spreadsheet()
static void spreadsheet_footer_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
static void spreadsheet_main_region_draw(const bContext *C, ARegion *region)
static void spreadsheet_dataset_region_draw(const bContext *C, ARegion *region)
Object * spreadsheet_get_object_eval(const SpaceSpreadsheet *sspreadsheet, const Depsgraph *depsgraph)
static void spreadsheet_footer_region_free(ARegion *UNUSED(region))
static void spreadsheet_dataset_region_listener(const wmRegionListenerParams *params)
static SpaceLink * spreadsheet_duplicate(SpaceLink *sl)
static float get_column_width_in_pixels(const ColumnValues &values)
static float get_column_width(const ColumnValues &values)
static float get_default_column_width(const ColumnValues &values)
static SpaceLink * spreadsheet_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
static void spreadsheet_footer_region_draw(const bContext *C, ARegion *region)
static void update_context_path_from_context(const bContext *C)
static void spreadsheet_header_region_draw(const bContext *C, ARegion *region)
static void spreadsheet_header_region_free(ARegion *UNUSED(region))
static void spreadsheet_main_region_listener(const wmRegionListenerParams *params)
static void update_visible_columns(ListBase &columns, DataSource &data_source)
static void spreadsheet_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const IDRemapper *mappings)
static void spreadsheet_right_region_free(ARegion *UNUSED(region))
static void update_pinned_context_path_if_outdated(const bContext *C)
void spreadsheet_operatortypes()
void register_row_filter_panels(ARegionType ®ion_type)
void(* draw)(const struct bContext *C, struct ARegion *region)
void(* listener)(const wmRegionListenerParams *params)
void(* free)(struct ARegion *)
void(* layout)(const struct bContext *C, struct ARegion *region)
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
blender::ed::spreadsheet::SpreadsheetCache cache
SpaceSpreadsheet_Runtime * runtime
Vector< ColumnLayout > columns
struct wmKeyConfig * defaultconf
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)