141 if ((
ID *)object_context->
object == old_id) {
146 object_context->
object =
nullptr;
177 return (
ID *)object_context->
object;
190 if (object_context->
object ==
nullptr) {
198 if (active_object !=
nullptr) {
215 if (active_object ==
nullptr) {
223 if (object_context->
object != active_object) {
251 if (used_id ==
nullptr) {
255 if (id_type !=
ID_OB) {
263 if (object_eval ==
nullptr) {
279 return std::max<float>(name_width /
UI_UNIT_X + 1.0f, 3.0f);
299 std::unique_ptr<ColumnValues> values = data_source.
get_column_values(*column->id);
307 if (!used_ids.
add(*column->id)) {
318 if (used_ids.
add(column_id)) {
319 SpreadsheetColumnID *new_id = spreadsheet_column_id_copy(&column_id);
320 SpreadsheetColumn *new_column = spreadsheet_column_new(new_id);
321 BLI_addtail(&columns, new_column);
334 data_source = std::make_unique<DataSource>();
343 std::unique_ptr<ColumnValues> values_ptr = data_source->get_column_values(*column->id);
346 const ColumnValues *values = scope.
add(std::move(values_ptr), __func__);
351 const int tot_rows = data_source->tot_rows();
356 data_source.get())) {
357 Object *object_eval = geometry_data_source->object_eval();
362 spreadsheet_layout.
row_indices = geometry_data_source->get_selected_element_indices();
472 std::stringstream ss;
475 char visible_rows_str[16];
477 ss << visible_rows_str <<
" / ";
479 char tot_rows_str[16];
481 ss << tot_rows_str <<
" | Columns: " << runtime->
tot_columns;
482 std::string stats_str = ss.str();
499 uiItemL(layout, stats_str.c_str(), ICON_NONE);
struct ScrArea * CTX_wm_area(const bContext *C)
struct SpaceSpreadsheet * CTX_wm_space_spreadsheet(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
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 len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_size(int fontid, int 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_original_object(struct Object *object)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ SPREADSHEET_CONTEXT_OBJECT
@ SPREADSHEET_FILTER_SELECTED_ONLY
#define SPREADSHEET_WIDTH_UNIT
@ SPREADSHEET_FLAG_PINNED
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_region_tag_redraw(struct ARegion *region)
void ED_region_header_init(struct ARegion *region)
void ED_spreadsheet_context_path_clear(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.
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
Span< int64_t > as_span() const
T * add(std::unique_ptr< T > resource, const char *name)
constexpr int64_t size() const
constexpr const char * data() const
constexpr int64_t size() const
StringRefNull name() const
virtual void foreach_default_column_ids(FunctionRef< void(const SpreadsheetColumnID &)> fn) const
virtual std::unique_ptr< ColumnValues > get_column_values(const SpreadsheetColumnID &column_id) const
const Depsgraph * depsgraph
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
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)
void draw_spreadsheet_in_region(const bContext *C, ARegion *region, const SpreadsheetDrawer &drawer)
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)
SpreadsheetContext * spreadsheet_context_new(eSpaceSpreadsheet_ContextType type)
SpreadsheetColumn * spreadsheet_column_copy(const SpreadsheetColumn *src_column)
std::string to_string(const T &n)
struct SELECTID_Context context
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 int get_index_column_width(const int tot_rows)
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)
ID * ED_spreadsheet_get_current_id(struct SpaceSpreadsheet *sspreadsheet)
static void spreadsheet_main_region_init(wmWindowManager *wm, ARegion *region)
static void spreadsheet_footer_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
void ED_spacetype_spreadsheet(void)
static void spreadsheet_main_region_draw(const bContext *C, ARegion *region)
static void spreadsheet_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id)
static void spreadsheet_footer_region_free(ARegion *UNUSED(region))
static void update_context_path(const bContext *C)
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 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_keymap(wmKeyConfig *UNUSED(keyconf))
static void update_pinned_context_path_if_outdated(const bContext *C)
void spreadsheet_operatortypes(void)
void(* draw)(const struct bContext *C, struct ARegion *region)
void(* listener)(const wmRegionListenerParams *params)
void(* free)(struct ARegion *)
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
SpaceSpreadsheet_Runtime * runtime
struct SpaceLink *(* duplicate)(struct SpaceLink *sl)
void(* keymap)(struct wmKeyConfig *keyconf)
void(* operatortypes)(void)
void(* free)(struct SpaceLink *sl)
struct SpaceLink *(* create)(const struct ScrArea *area, const struct Scene *scene)
void(* init)(struct wmWindowManager *wm, struct ScrArea *area)
void(* id_remap)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id)
char name[BKE_ST_MAXNAME]
Span< int64_t > row_indices
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)