17#include "RNA_prototypes.hh"
67 return std::to_string(row_filter.
value_int);
82 result << std::fixed <<
"(" << row_filter.
value_float2[0] <<
", "
89 result << std::fixed <<
"(" << row_filter.
value_float3[0] <<
", "
103 std::ostringstream
result;
124 if (column->display_name == column_name) {
137 const StringRef column_name = filter->column_name;
142 (column ==
nullptr && !column_name.
is_empty()))
154 else if (column ==
nullptr) {
159 std::stringstream ss;
165 uiItemL(row, ss.str().c_str(), ICON_NONE);
171 uiItemIntO(row,
"", ICON_X,
"SPREADSHEET_OT_remove_row_filter_rule",
"index", current_index);
183 const StringRef column_name = filter->column_name;
189 (column ==
nullptr && !column_name.
is_empty()))
200 if (column ==
nullptr || column_name.
is_empty()) {
258 uiItemL(layout,
IFACE_(
"Unsupported column type"), ICON_ERROR);
275 uiItemO(layout,
nullptr, ICON_ADD,
"SPREADSHEET_OT_add_row_filter_rule");
285 PointerRNA *filter_ptr = MEM_new<PointerRNA>(
"panel customdata");
293 Panel *panel_iter = (
Panel *)region->panels.first;
298 panel_iter = panel_iter->
next;
302 PointerRNA *filter_ptr = MEM_new<PointerRNA>(
"panel customdata");
306 panel_iter = panel_iter->
next;
346 PanelType *panel_type = MEM_cnew<PanelType>(__func__);
357 PanelType *panel_type = MEM_cnew<PanelType>(__func__);
bScreen * CTX_wm_screen(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
SpaceSpreadsheet * CTX_wm_space_spreadsheet(const bContext *C)
@ PANEL_TYPE_HEADER_EXPAND
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
@ SPREADSHEET_ROW_FILTER_BOOL_VALUE
@ SPREADSHEET_ROW_FILTER_UI_EXPAND
@ SPREADSHEET_ROW_FILTER_ENABLED
@ SPREADSHEET_FILTER_ENABLE
eSpreadsheetFilterOperation
@ SPREADSHEET_ROW_FILTER_GREATER
@ SPREADSHEET_ROW_FILTER_EQUAL
@ SPREADSHEET_ROW_FILTER_LESS
eSpreadsheetColumnValueType
@ SPREADSHEET_VALUE_TYPE_INT8
@ SPREADSHEET_VALUE_TYPE_FLOAT
@ SPREADSHEET_VALUE_TYPE_INT32_2D
@ SPREADSHEET_VALUE_TYPE_BYTE_COLOR
@ SPREADSHEET_VALUE_TYPE_UNKNOWN
@ SPREADSHEET_VALUE_TYPE_FLOAT3
@ SPREADSHEET_VALUE_TYPE_BOOL
@ SPREADSHEET_VALUE_TYPE_STRING
@ SPREADSHEET_VALUE_TYPE_QUATERNION
@ SPREADSHEET_VALUE_TYPE_FLOAT4X4
@ SPREADSHEET_VALUE_TYPE_INT32
@ SPREADSHEET_VALUE_TYPE_FLOAT2
@ SPREADSHEET_VALUE_TYPE_COLOR
@ SPREADSHEET_VALUE_TYPE_INSTANCES
void uiLayoutSetActive(uiLayout *layout, bool active)
void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_panels_free_instanced(const bContext *C, ARegion *region)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS_ex(uiLayout *layout, float factor, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void UI_panel_custom_data_set(Panel *panel, PointerRNA *custom_data)
void uiLayoutSetEmboss(uiLayout *layout, eUIEmbossType emboss)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
bool UI_panel_list_matches_data(ARegion *region, ListBase *data, uiListPanelIDFromDataFunc panel_idname_func)
PointerRNA * UI_panel_custom_data_get(const Panel *panel)
Panel * UI_panel_add_instanced(const bContext *C, ARegion *region, ListBase *panels, const char *panel_idname, PointerRNA *custom_data)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
constexpr bool is_empty() const
constexpr const char * data() const
static void spreadsheet_filter_panel_draw(const bContext *C, Panel *panel)
static std::string operation_string(const eSpreadsheetColumnValueType data_type, const eSpreadsheetFilterOperation operation)
static void set_filter_expand_flag(const bContext *, Panel *panel, short expand_flag)
static std::string value_string(const SpreadsheetRowFilter &row_filter, const eSpreadsheetColumnValueType data_type)
static SpreadsheetColumn * lookup_visible_column_for_filter(const SpaceSpreadsheet &sspreadsheet, const StringRef column_name)
static void spreadsheet_row_filters_layout(const bContext *C, Panel *panel)
static void filter_panel_id_fn(void *, char *r_name)
static void filter_reorder(bContext *C, Panel *panel, int new_index)
static void spreadsheet_filter_panel_draw_header(const bContext *C, Panel *panel)
static short get_filter_expand_flag(const bContext *, Panel *panel)
void register_row_filter_panels(ARegionType ®ion_type)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void(* reorder)(bContext *C, Panel *pa, int new_index)
void(* set_list_data_expand_flag)(const bContext *C, Panel *pa, short expand_flag)
void(* draw)(const bContext *C, Panel *panel)
char idname[BKE_ST_MAXNAME]
char translation_context[BKE_ST_MAXNAME]
char category[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
short(* get_list_data_expand_flag)(const bContext *C, Panel *pa)
void(* draw_header)(const bContext *C, Panel *panel)