2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2021-09-23 18:56:29 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup editorui
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
#include "BLI_string_ref.hh"
|
2021-10-26 11:05:01 -05:00
|
|
|
#include "BLI_vector.hh"
|
|
|
|
|
|
|
|
|
|
#include "UI_resources.h"
|
2021-09-23 18:56:29 +02:00
|
|
|
|
2021-10-21 13:54:48 -05:00
|
|
|
namespace blender::nodes::geometry_nodes_eval_log {
|
|
|
|
|
struct GeometryAttributeInfo;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-26 11:05:01 -05:00
|
|
|
struct StructRNA;
|
2022-01-24 21:16:06 +11:00
|
|
|
struct uiBlock;
|
2021-10-26 11:05:01 -05:00
|
|
|
struct uiSearchItems;
|
|
|
|
|
|
2021-09-23 18:56:29 +02:00
|
|
|
namespace blender::ui {
|
2021-10-26 11:05:01 -05:00
|
|
|
|
2022-06-16 11:29:20 +02:00
|
|
|
class AbstractGridView;
|
2021-09-23 18:56:29 +02:00
|
|
|
class AbstractTreeView;
|
2021-10-21 13:54:48 -05:00
|
|
|
|
2021-10-26 11:05:01 -05:00
|
|
|
/**
|
|
|
|
|
* An item in a breadcrumb-like context. Currently this struct is very simple, but more
|
|
|
|
|
* could be added to it in the future, to support interactivity or tooltips, for example.
|
|
|
|
|
*/
|
|
|
|
|
struct ContextPathItem {
|
|
|
|
|
/* Text to display in the UI. */
|
|
|
|
|
std::string name;
|
|
|
|
|
/* #BIFIconID */
|
|
|
|
|
int icon;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void context_path_add_generic(Vector<ContextPathItem> &path,
|
|
|
|
|
StructRNA &rna_type,
|
|
|
|
|
void *ptr,
|
|
|
|
|
const BIFIconID icon_override = ICON_NONE);
|
|
|
|
|
|
|
|
|
|
void template_breadcrumbs(uiLayout &layout, Span<ContextPathItem> context_path);
|
|
|
|
|
|
2021-10-21 13:54:48 -05:00
|
|
|
void attribute_search_add_items(
|
|
|
|
|
StringRefNull str,
|
2022-07-07 08:13:11 -05:00
|
|
|
bool can_create_attribute,
|
2021-10-21 13:54:48 -05:00
|
|
|
Span<const nodes::geometry_nodes_eval_log::GeometryAttributeInfo *> infos,
|
|
|
|
|
uiSearchItems *items,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool is_first);
|
2021-10-21 13:54:48 -05:00
|
|
|
|
|
|
|
|
} // namespace blender::ui
|
2021-09-23 18:56:29 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2022-07-04 15:29:24 +02:00
|
|
|
* Override this for all available view types.
|
2021-12-09 00:55:11 +11:00
|
|
|
*/
|
2022-06-16 11:29:20 +02:00
|
|
|
blender::ui::AbstractGridView *UI_block_add_view(
|
|
|
|
|
uiBlock &block,
|
|
|
|
|
blender::StringRef idname,
|
2022-07-04 15:06:23 +10:00
|
|
|
std::unique_ptr<blender::ui::AbstractGridView> grid_view);
|
2021-09-23 18:56:29 +02:00
|
|
|
blender::ui::AbstractTreeView *UI_block_add_view(
|
|
|
|
|
uiBlock &block,
|
|
|
|
|
blender::StringRef idname,
|
|
|
|
|
std::unique_ptr<blender::ui::AbstractTreeView> tree_view);
|