Provides the interface that applications use to interact with and control the system.
Public Member Functions | |
void | add_image (const std::string &name, const Bitmap &bitmap) |
void | add_toplevel_container_after (Container *container, Container *relative, ALIGNMENT where) |
void | add_toplevel_container_before (Container *container, Container *relative, ALIGNMENT where) |
void | add_toplevel_container_end (Container *container, ALIGNMENT where) |
void | add_toplevel_container_front (Container *container, ALIGNMENT where) |
void | automatic_interface_update (bool enable) |
Used to toggle on or off automatic interface updates when the size of the Managed Window changes. | |
void | create_children (Container *container, const layout::Container &data) |
Pointer< Component > | create_component (const layout::Component &data) |
void | destroy_layout () |
Color | get_color (component_type type, int part) |
Component * | get_component (const Point &position) const |
const ContainerList & | get_containers () const |
WidgetPtr | get_content_widget () const |
DockManager * | get_dockmanager () const |
Font | get_font (int id) const |
int | get_font_height (int id) const |
Bitmap * | get_image (const std::string &name) const |
Rect | get_interface_rect () const |
layout::Layout * | get_layout () const |
WidgetPtr | get_managed_widget () const |
Size | get_min_size () const |
const PanelChildWidgets & | get_panel_child_widgets () const |
Renderer * | get_renderer () const |
Theme * | get_theme () const |
InterfaceManager (const WidgetPtr &managed, const WidgetPtr &content) | |
Constructs the interface manager to manage the given widget with the given content window in the center of the interface. | |
void | refresh_interface () |
void | remove_toplevel_container (Container *container) |
void | set_color (component_type type, int part, const Color &color) |
void | set_dockmanager (DockManager *manager) |
Sets the DockManager. | |
void | set_font (int id, const Font &font) |
void | set_layout (const layout::Layout &) |
Realizes the given layout. | |
void | set_renderer (Renderer *renderer) |
Sets the Renderer that will be used to render components. | |
void | set_theme (Theme *theme) |
Sets the Theme that will define what colors to use when rendering Components. | |
void | update_interface () |
void | update_interface (const Rect &rect) |
void | update_min_size () |
~InterfaceManager () | |
Private Types | |
typedef std::map < component_type, ComponentFactory * > | ComponentFactories |
typedef std::map< std::string, Bitmap > | ImageMap |
Private Member Functions | |
void | add_component (Component *component) |
void | add_toplevel_container (Pointer< Container > container, const ContainerList::iterator &where, ALIGNMENT alignment) |
void | cleanup () |
Component * | get_component (const Point &position, Container *root) const |
void | initialize () |
InterfaceManager (const InterfaceManager &) | |
bool | on_left_down (const MouseEventData &data) |
bool | on_left_up (const MouseEventData &data) |
bool | on_mouse_move (const MouseEventData &data) |
InterfaceManager & | operator= (const InterfaceManager &) |
void | register_child_widget (WidgetID child, Panel *panel) |
void | remove_component (Component *component) |
void | unregister_child_widget (WidgetID child) |
Private Attributes | |
ComponentPtrList | m_components |
The list of all the components. | |
ContainerList | m_containers |
The list of toplevel containers. | |
WidgetAdapter | m_content |
The content widget appearing in the middle of the interface. | |
std::auto_ptr< DockManager > | m_dockmanager |
The DockManager. | |
ComponentFactories | m_factories |
Component factories. | |
std::auto_ptr< GuiData > | m_gui_data |
Data used by the gui toolkit layer. | |
ImageMap | m_images |
Rect | m_interface_rect |
The interface rect. | |
WidgetAdapter | m_managed |
The widget to manage the interface for. | |
PanelChildWidgets | m_panel_child_widgets |
The WidgetID->Panel association. | |
std::auto_ptr< Renderer > | m_renderer |
The Renderer used to render Components. | |
std::auto_ptr< Theme > | m_theme |
The theme defining what colors to render components with. |
typedef std::map<component_type, ComponentFactory*> ifm::InterfaceManager::ComponentFactories [private] |
typedef std::map<std::string, Bitmap> ifm::InterfaceManager::ImageMap [private] |
Constructs the interface manager to manage the given widget with the given content window in the center of the interface.
ifm::InterfaceManager::~InterfaceManager | ( | ) |
ifm::InterfaceManager::InterfaceManager | ( | const InterfaceManager & | ) | [private] |
void ifm::InterfaceManager::add_component | ( | Component * | component | ) | [private] |
Add the given component to the components list.
void ifm::InterfaceManager::add_image | ( | const std::string & | name, | |
const Bitmap & | bitmap | |||
) |
Adds a Container as a top level container and puts it at the end of the list. Such a container will appear along the edge of the Content Widget.
Adds a Container as a top level container and puts it at the front of the list. Such a container will appear along the outer most edge of the Managed Widget.
void ifm::InterfaceManager::automatic_interface_update | ( | bool | enable | ) |
Used to toggle on or off automatic interface updates when the size of the Managed Window changes.
void ifm::InterfaceManager::cleanup | ( | ) | [private] |
Performs any special cleanup needed.
void ifm::InterfaceManager::create_children | ( | Container * | container, | |
const layout::Container & | data | |||
) |
Creates the children for a Container.
Pointer< Component > ifm::InterfaceManager::create_component | ( | const layout::Component & | data | ) |
Creates a component. The type of component created depends on the m_type value of the ComponentData.
void ifm::InterfaceManager::destroy_layout | ( | ) |
Destroys the current layout, removing all Components. Does not update the interface.
Color ifm::InterfaceManager::get_color | ( | component_type | type, | |
int | part | |||
) |
If a color is not explicitly defined for this component type and part combination, the default color from the ALL component type will be returned.
Component * ifm::InterfaceManager::get_component | ( | const Point & | position, | |
Container * | root | |||
) | const [private] |
const ContainerList & ifm::InterfaceManager::get_containers | ( | ) | const |
WidgetPtr ifm::InterfaceManager::get_content_widget | ( | ) | const |
DockManager * ifm::InterfaceManager::get_dockmanager | ( | ) | const |
Font ifm::InterfaceManager::get_font | ( | int | id | ) | const |
int ifm::InterfaceManager::get_font_height | ( | int | id | ) | const |
Bitmap * ifm::InterfaceManager::get_image | ( | const std::string & | name | ) | const |
Rect ifm::InterfaceManager::get_interface_rect | ( | ) | const |
layout::Layout * ifm::InterfaceManager::get_layout | ( | ) | const |
WidgetPtr ifm::InterfaceManager::get_managed_widget | ( | ) | const |
const PanelChildWidgets & ifm::InterfaceManager::get_panel_child_widgets | ( | ) | const |
Renderer * ifm::InterfaceManager::get_renderer | ( | ) | const |
void ifm::InterfaceManager::initialize | ( | ) | [private] |
Performs any special initialization needed.
bool ifm::InterfaceManager::on_left_down | ( | const MouseEventData & | data | ) | [private] |
Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.
data | The data for this event |
bool ifm::InterfaceManager::on_left_up | ( | const MouseEventData & | data | ) | [private] |
Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.
data | The data for this event |
bool ifm::InterfaceManager::on_mouse_move | ( | const MouseEventData & | data | ) | [private] |
Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.
data | The data for this event |
InterfaceManager& ifm::InterfaceManager::operator= | ( | const InterfaceManager & | ) | [private] |
void ifm::InterfaceManager::refresh_interface | ( | ) |
Refreshes the interface by rerendering all components.
Called by Panels so that they will be notified when their Child Widget is created or destroyed based on its WidgetID.
void ifm::InterfaceManager::remove_component | ( | Component * | component | ) | [private] |
Remove a component from the components list.
void ifm::InterfaceManager::remove_toplevel_container | ( | Container * | container | ) |
Removes the given container from the top level container list.
void ifm::InterfaceManager::set_color | ( | component_type | type, | |
int | part, | |||
const Color & | color | |||
) |
Specify the color value used to render the specified part for the given type of components. Not all parts are used by all components.
ALL may be passed for the component type. In this case, the default color this part will be set. If a component type does not have a color explicitly defined for the given part, this default value will be used.
type | The type of component | |
part | The part | |
color | The color value |
void ifm::InterfaceManager::set_dockmanager | ( | DockManager * | manager | ) |
Sets the DockManager.
The DockManager implements docking functionality. Replacing the default DockManager to change the feel of your application.
void ifm::InterfaceManager::set_font | ( | int | id, | |
const Font & | font | |||
) |
Specify the Font to use for the given font id. You should update the interface for the changes to be in effect, a simple refresh will not work completely because the height of the Font might have changed so the components will need to be repositioned.
void ifm::InterfaceManager::set_layout | ( | const layout::Layout & | layout | ) |
void ifm::InterfaceManager::set_renderer | ( | Renderer * | renderer | ) |
Sets the Renderer that will be used to render components.
The interface will not be refreshed to reflect the new Renderer, call refresh_interface to redraw Components.
Any existing Renderer will be deleted.
void ifm::InterfaceManager::set_theme | ( | Theme * | theme | ) |
Sets the Theme that will define what colors to use when rendering Components.
The interface will not be refreshed to reflect the new Theme, call refresh_interface to redraw Components.
Any existing Theme will be deleted.
void ifm::InterfaceManager::unregister_child_widget | ( | WidgetID | child | ) | [private] |
Called by Panels when they are being destroyed so that they will no longer be notified when their Child Widget is created or destroyed
void ifm::InterfaceManager::update_interface | ( | ) |
Updates the layout using the Rect previously passed to update_interface(const Rect&).
void ifm::InterfaceManager::update_interface | ( | const Rect & | rect | ) |
Updates the positioning of all Components to fit within the given Rect.
void ifm::InterfaceManager::update_min_size | ( | ) |
Updates the minimum size of the managed window. Call this function after you change the minimum size of a managed widget or the content widget in order to update the minimum size of the managed window properly.
The list of all the components.
The list of toplevel containers.
The content widget appearing in the middle of the interface.
std::auto_ptr<DockManager> ifm::InterfaceManager::m_dockmanager [private] |
The DockManager.
Component factories.
std::auto_ptr<GuiData> ifm::InterfaceManager::m_gui_data [private] |
Data used by the gui toolkit layer.
ImageMap ifm::InterfaceManager::m_images [private] |
Rect ifm::InterfaceManager::m_interface_rect [private] |
The interface rect.
The widget to manage the interface for.
The WidgetID->Panel association.
std::auto_ptr<Renderer> ifm::InterfaceManager::m_renderer [private] |
The Renderer used to render Components.
std::auto_ptr<Theme> ifm::InterfaceManager::m_theme [private] |
The theme defining what colors to render components with.