Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ItemFactory Class Reference

Item factory for column views. More...

#include <src/gui/backend/gtk_widgets/item_factory.h>

Public Types

enum class  Type {
  Toggle , Text , Integer , Icon ,
  IconAndText , Position , Color
}
 Item factory column type. More...

Public Member Functions

 ItemFactory (Type type, bool editable, std::string column_name)
 Creates a new item factory.

Static Public Member Functions

static std::unique_ptr< ItemFactory > & generate_and_append_column (GtkColumnView *column_view, std::vector< std::unique_ptr< ItemFactory > > &item_factories, Type type, bool editable, bool resizable, GtkSorter *sorter, std::string column_name)
 Shorthand to generate and append a column to a column view.

Data Fields

GtkListItemFactory * list_item_factory_ = nullptr
 An owned GtkListItemFactory.
Type type_ = Type::Text
bool editable_ = false
bool ellipsize_label_ = true
gulong setup_id_ = 0
gulong bind_id_ = 0
gulong unbind_id_ = 0
gulong teardown_id_ = 0
std::string column_name_
 Column name, or empty if used for list views.

Detailed Description

Item factory for column views.

The owner widget is expected to have a std::vector<ItemFactory> that holds an ItemFactory for each column. 1 column = 1 ItemFactory.

This can also be used on listviews (ie, only 1 ItemFactory would be needed).

Definition at line 28 of file item_factory.h.

Member Enumeration Documentation

◆ Type

enum class ItemFactory::Type
strong

Item factory column type.

Enumerator
Integer 

Integer display.

Icon 

Icon.

IconAndText 

Composite type (eg, used in plugin browser).

Position 

Position.

Color 

Color.

Definition at line 34 of file item_factory.h.

Constructor & Destructor Documentation

◆ ItemFactory()

ItemFactory::ItemFactory ( Type type,
bool editable,
std::string column_name )

Creates a new item factory.

Parameters
editableWhether the item should be editable.
column_nameColumn name, if column view, otherwise NULL.

Field Documentation

◆ bind_id_

gulong ItemFactory::bind_id_ = 0

Definition at line 91 of file item_factory.h.

◆ column_name_

std::string ItemFactory::column_name_

Column name, or empty if used for list views.

Definition at line 96 of file item_factory.h.

◆ editable_

bool ItemFactory::editable_ = false

Definition at line 86 of file item_factory.h.

◆ ellipsize_label_

bool ItemFactory::ellipsize_label_ = true

Definition at line 88 of file item_factory.h.

◆ list_item_factory_

GtkListItemFactory* ItemFactory::list_item_factory_ = nullptr

An owned GtkListItemFactory.

Definition at line 82 of file item_factory.h.

◆ setup_id_

gulong ItemFactory::setup_id_ = 0

Definition at line 90 of file item_factory.h.

◆ teardown_id_

gulong ItemFactory::teardown_id_ = 0

Definition at line 93 of file item_factory.h.

◆ type_

Type ItemFactory::type_ = Type::Text

Definition at line 84 of file item_factory.h.

◆ unbind_id_

gulong ItemFactory::unbind_id_ = 0

Definition at line 92 of file item_factory.h.


The documentation for this class was generated from the following file: