#include <ev_UnixMenu.h>
Classes | |
class | _wd |
Public Member Functions | |
EV_UnixMenu (XAP_UnixApp *pUnixApp, XAP_Frame *pFrame, const char *szMenuLayoutName, const char *szMenuLabelSetName) | |
virtual | ~EV_UnixMenu () |
bool | synthesizeMenu (GtkWidget *wMenuRoot, bool isPopup) |
bool | menuEvent (XAP_Menu_Id id) |
virtual bool | refreshMenu (AV_View *pView)=0 |
XAP_Frame * | getFrame () |
Protected Member Functions | |
bool | _refreshMenu (AV_View *pView, GtkWidget *wMenuRoot) |
bool | _isItemPresent (XAP_Menu_Id id) const |
virtual bool | _doAddMenuItem (UT_uint32 layout_pos) |
Protected Attributes | |
XAP_UnixApp * | m_pUnixApp |
XAP_Frame * | m_pFrame |
GtkAccelGroup * | m_accelGroup |
UT_GenericVector< GtkWidget * > | m_vecMenuWidgets |
Private Member Functions | |
void | _convertStringToAccel (const char *s, guint &accel_key, GdkModifierType &ac_mods) |
This subroutine calcules the gdk accel_key, ac_mods associated to a given string (for instance, str = "Ctrl+A" -> accel_key = 'A' ac_mods = GDK_CONTROL_MASK). | |
GtkWidget * | s_createNormalMenuEntry (const XAP_Menu_Id id, bool isCheckable, bool isRadio, bool isPopup, const char *szLabelName, const char *szMnemonicName) |
Private Attributes | |
UT_GenericVector< _wd * > | m_vecCallbacks |
EV_UnixMenu::EV_UnixMenu | ( | XAP_UnixApp * | pUnixApp, | |
XAP_Frame * | pFrame, | |||
const char * | szMenuLayoutName, | |||
const char * | szMenuLabelSetName | |||
) |
References m_accelGroup.
EV_UnixMenu::~EV_UnixMenu | ( | ) | [virtual] |
References UT_GenericVector< T >::clear(), m_vecCallbacks, m_vecMenuWidgets, and UT_VECTOR_PURGEALL.
void EV_UnixMenu::_convertStringToAccel | ( | const char * | s, | |
guint & | accel_key, | |||
GdkModifierType & | ac_mods | |||
) | [private] |
This subroutine calcules the gdk accel_key, ac_mods associated to a given string (for instance, str = "Ctrl+A" -> accel_key = 'A' ac_mods = GDK_CONTROL_MASK).
bool EV_UnixMenu::_doAddMenuItem | ( | UT_uint32 | layout_pos | ) | [protected, virtual] |
That will add a new menu entry for the menu item at layout_pos.
layout_pos | UT_uint32 with the relative position of the item in the menu. |
Implements EV_Menu.
References UT_GenericVector< T >::insertItemAt(), m_vecMenuWidgets, and UT_DEBUGMSG.
bool EV_UnixMenu::_isItemPresent | ( | XAP_Menu_Id | id | ) | const [protected] |
bool EV_UnixMenu::_refreshMenu | ( | AV_View * | pView, | |
GtkWidget * | wMenuRoot | |||
) | [protected] |
References _ev_convert(), _ev_GetLabelName(), EV_MIS_Gray, EV_MIS_Toggled, EV_MLF_BeginPopupMenu, EV_MLF_BeginSubMenu, EV_MLF_EndPopupMenu, EV_MLF_EndSubMenu, EV_MLF_Normal, EV_MLF_Separator, EV_Menu_ActionSet::getAction(), UT_GenericVector< T >::getItemCount(), EV_Menu_LabelSet::getLabel(), EV_Menu_Layout::getLayoutItem(), EV_Menu_Layout::getLayoutItemCount(), XAP_App::getMenuActionSet(), EV_Menu_LayoutItem::getMenuId(), EV_Menu_Action::getMenuItemState(), EV_Menu_LayoutItem::getMenuLayoutFlags(), UT_GenericVector< T >::getNthItem(), EV_Menu_Action::hasDynamicLabel(), EV_Menu_Action::hasGetStateFunction(), EV_Menu_Action::isCheckable(), EV_Menu_Action::isRadio(), m_pFrame, EV_Menu::m_pMenuLabelSet, EV_Menu::m_pMenuLayout, m_pUnixApp, m_vecMenuWidgets, s_createNormalMenuEntry(), EV_UnixMenu::_wd::s_onActivate(), UT_GenericVector< T >::setNthItem(), UT_ASSERT, and UT_DEBUGMSG.
Referenced by EV_UnixMenuPopup::refreshMenu(), and EV_UnixMenuBar::refreshMenu().
XAP_Frame * EV_UnixMenu::getFrame | ( | ) |
bool EV_UnixMenu::menuEvent | ( | XAP_Menu_Id | id | ) |
References EV_EditMethodContainer::findEditMethodByName(), EV_Menu_ActionSet::getAction(), XAP_Frame::getCurrentView(), XAP_App::getEditMethodContainer(), XAP_App::getMenuActionSet(), EV_Menu_Action::getMethodName(), EV_Menu_Action::getScriptName(), EV_Menu::invokeMenuMethod(), m_pFrame, m_pUnixApp, UT_ASSERT, and UT_return_val_if_fail.
Referenced by EV_UnixMenu::_wd::s_onActivate().
virtual bool EV_UnixMenu::refreshMenu | ( | AV_View * | pView | ) | [pure virtual] |
Implemented in EV_UnixMenuBar, and EV_UnixMenuPopup.
Referenced by EV_UnixMenu::_wd::s_onInitMenu().
GtkWidget* EV_UnixMenu::s_createNormalMenuEntry | ( | const XAP_Menu_Id | id, | |
bool | isCheckable, | |||
bool | isRadio, | |||
bool | isPopup, | |||
const char * | szLabelName, | |||
const char * | szMnemonicName | |||
) | [private] |
Referenced by _refreshMenu(), and synthesizeMenu().
bool EV_UnixMenu::synthesizeMenu | ( | GtkWidget * | wMenuRoot, | |
bool | isPopup | |||
) |
References _ev_convert(), _ev_get_underlined_char(), _ev_GetLabelName(), _ev_strip_underline(), ACCEL_FLAGS, ACTIVATE_ACCEL, UT_GenericVector< T >::addItem(), EV_EKP_PRESS, EV_EMS_ALT, EV_MLF_BeginPopupMenu, EV_MLF_BeginSubMenu, EV_MLF_EndPopupMenu, EV_MLF_EndSubMenu, EV_MLF_Normal, EV_MLF_Separator, FREEP, EV_Menu_ActionSet::getAction(), EV_Menu::getApp(), XAP_App::getEditEventMapper(), XAP_Frame::getFrameImpl(), EV_Menu_LabelSet::getLabel(), EV_Menu::getLabelName(), EV_Menu_Layout::getLayoutItem(), EV_Menu_Layout::getLayoutItemCount(), XAP_App::getMenuActionSet(), EV_Menu_LayoutItem::getMenuId(), EV_Menu_LayoutItem::getMenuLayoutFlags(), EV_Menu_Action::isCheckable(), EV_Menu_Action::isRadio(), EV_EditEventMapper::Keystroke(), m_accelGroup, m_pFrame, EV_Menu::m_pMenuLabelSet, EV_Menu::m_pMenuLayout, m_pUnixApp, m_vecCallbacks, m_vecMenuWidgets, s_createNormalMenuEntry(), EV_UnixMenu::_wd::s_onDestroyMenu(), EV_UnixMenu::_wd::s_onInitMenu(), UT_ASSERT, UT_continue_if_fail, and UT_UNUSED.
Referenced by EV_UnixMenuBar::rebuildMenuBar(), EV_UnixMenuBar::synthesizeMenuBar(), and EV_UnixMenuPopup::synthesizeMenuPopup().
GtkAccelGroup* EV_UnixMenu::m_accelGroup [protected] |
Referenced by EV_UnixMenu(), and synthesizeMenu().
XAP_Frame* EV_UnixMenu::m_pFrame [protected] |
XAP_UnixApp* EV_UnixMenu::m_pUnixApp [protected] |
Referenced by _refreshMenu(), menuEvent(), and synthesizeMenu().
UT_GenericVector<_wd*> EV_UnixMenu::m_vecCallbacks [private] |
Reimplemented in EV_UnixMenuPopup.
Referenced by synthesizeMenu(), and ~EV_UnixMenu().
UT_GenericVector<GtkWidget*> EV_UnixMenu::m_vecMenuWidgets [protected] |
Referenced by _doAddMenuItem(), _refreshMenu(), synthesizeMenu(), and ~EV_UnixMenu().