Guitarix
UIManager Class Reference

#include <gx_main_window.h>

Public Types

typedef std::function< bool(const Glib::ustring &, Glib::RefPtr< Gio::Menu > &, int, int)> search_func
 

Public Member Functions

 UIManager (const std::string &file, Gtk::MenuBar *bar)
 
Glib::RefPtr< Gtk::AccelGroup > & get_accel_group ()
 
Glib::RefPtr< Gio::SimpleActionGroup > & get_action_group ()
 
void insert_action_group (Glib::RefPtr< Gio::SimpleActionGroup > &group)
 
void set_accelerators_from_menu ()
 
bool foreach_menu (search_func func)
 
Glib::RefPtr< Gio::SimpleAction > add_action (const Glib::ustring &action)
 
Glib::RefPtr< Gio::SimpleAction > add_action (const Glib::ustring &action, sigc::slot< void()> slot)
 
Glib::RefPtr< ToggleActionadd_toggle_action (const Glib::ustring &action, bool state=false)
 
Glib::RefPtr< RadioActionadd_radio_action (const Glib::ustring &action)
 
Glib::RefPtr< UiBoolToggleActionadd_ui_bool_action (gx_engine::GxMachineBase &machine, const std::string &id, const Glib::ustring &name, bool is_active=false)
 
void add_accelerator (Glib::RefPtr< Gio::Action > action, Glib::VariantBase &target, const Glib::ustring &accelerator)
 
Glib::RefPtr< Gio::Menu > get_linked_menu (const Glib::ustring &action)
 
Gtk::MenuItem * find_item (const Glib::ustring &action)
 
bool remove_item (const Glib::ustring &action)
 

Static Public Member Functions

static void add_accelerator (Glib::RefPtr< Gtk::AccelGroup > &group, Glib::RefPtr< Gio::Action > action, const Glib::ustring &accelerator, Glib::VariantBase &target)
 
static void set_widget_action (Gtk::Widget *w, const Glib::ustring &action)
 
static void set_widget_action (Gtk::Widget *w, const Glib::RefPtr< Gio::Action > &action)
 

Private Member Functions

void set_accelerators_from_menu (Glib::RefPtr< Gio::Menu > &menu)
 
bool foreach_menu_ (Glib::RefPtr< Gio::Menu > &menu, search_func &func, int &startpos)
 

Private Attributes

Glib::RefPtr< Gio::Menu > menu
 
Glib::RefPtr< Gtk::AccelGroup > accelgroup
 
Glib::RefPtr< Gio::SimpleActionGroup > actiongroup
 
Gtk::MenuBar * menubar
 

Detailed Description

Definition at line 109 of file gx_main_window.h.

Member Typedef Documentation

◆ search_func

typedef std::function<bool(const Glib::ustring&, Glib::RefPtr<Gio::Menu>&, int, int)> UIManager::search_func

Definition at line 111 of file gx_main_window.h.

Constructor & Destructor Documentation

◆ UIManager()

UIManager::UIManager ( const std::string &  file,
Gtk::MenuBar *  bar 
)

Member Function Documentation

◆ add_accelerator() [1/2]

void UIManager::add_accelerator ( Glib::RefPtr< Gio::Action >  action,
Glib::VariantBase &  target,
const Glib::ustring &  accelerator 
)

◆ add_accelerator() [2/2]

static void UIManager::add_accelerator ( Glib::RefPtr< Gtk::AccelGroup > &  group,
Glib::RefPtr< Gio::Action >  action,
const Glib::ustring &  accelerator,
Glib::VariantBase &  target 
)
static

◆ add_action() [1/2]

Glib::RefPtr< Gio::SimpleAction > UIManager::add_action ( const Glib::ustring &  action)

◆ add_action() [2/2]

Glib::RefPtr< Gio::SimpleAction > UIManager::add_action ( const Glib::ustring &  action,
sigc::slot< void()>  slot 
)

◆ add_radio_action()

Glib::RefPtr< RadioAction > UIManager::add_radio_action ( const Glib::ustring &  action)

◆ add_toggle_action()

Glib::RefPtr< ToggleAction > UIManager::add_toggle_action ( const Glib::ustring &  action,
bool  state = false 
)

◆ add_ui_bool_action()

Glib::RefPtr< UiBoolToggleAction > UIManager::add_ui_bool_action ( gx_engine::GxMachineBase machine,
const std::string &  id,
const Glib::ustring &  name,
bool  is_active = false 
)

◆ find_item()

Gtk::MenuItem * UIManager::find_item ( const Glib::ustring &  action)

◆ foreach_menu()

bool UIManager::foreach_menu ( search_func  func)
inline

Definition at line 127 of file gx_main_window.h.

◆ foreach_menu_()

bool UIManager::foreach_menu_ ( Glib::RefPtr< Gio::Menu > &  menu,
search_func func,
int &  startpos 
)
private

Referenced by foreach_menu().

◆ get_accel_group()

Glib::RefPtr< Gtk::AccelGroup > & UIManager::get_accel_group ( )
inline

Definition at line 121 of file gx_main_window.h.

◆ get_action_group()

Glib::RefPtr< Gio::SimpleActionGroup > & UIManager::get_action_group ( )
inline

Definition at line 122 of file gx_main_window.h.

◆ get_linked_menu()

Glib::RefPtr< Gio::Menu > UIManager::get_linked_menu ( const Glib::ustring &  action)

◆ insert_action_group()

void UIManager::insert_action_group ( Glib::RefPtr< Gio::SimpleActionGroup > &  group)
inline

Definition at line 123 of file gx_main_window.h.

◆ remove_item()

bool UIManager::remove_item ( const Glib::ustring &  action)

◆ set_accelerators_from_menu() [1/2]

void UIManager::set_accelerators_from_menu ( )
inline

Definition at line 126 of file gx_main_window.h.

Referenced by set_accelerators_from_menu().

◆ set_accelerators_from_menu() [2/2]

void UIManager::set_accelerators_from_menu ( Glib::RefPtr< Gio::Menu > &  menu)
private

◆ set_widget_action() [1/2]

static void UIManager::set_widget_action ( Gtk::Widget *  w,
const Glib::RefPtr< Gio::Action > &  action 
)
static

◆ set_widget_action() [2/2]

static void UIManager::set_widget_action ( Gtk::Widget *  w,
const Glib::ustring &  action 
)
static

Member Data Documentation

◆ accelgroup

Glib::RefPtr<Gtk::AccelGroup> UIManager::accelgroup
private

Definition at line 114 of file gx_main_window.h.

Referenced by get_accel_group().

◆ actiongroup

Glib::RefPtr<Gio::SimpleActionGroup> UIManager::actiongroup
private

Definition at line 115 of file gx_main_window.h.

Referenced by get_action_group(), and insert_action_group().

◆ menu

Glib::RefPtr<Gio::Menu> UIManager::menu
private

Definition at line 113 of file gx_main_window.h.

Referenced by foreach_menu(), and set_accelerators_from_menu().

◆ menubar

Gtk::MenuBar* UIManager::menubar
private

Definition at line 116 of file gx_main_window.h.


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