• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ev_UnixMenu.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiSource Program Utilities
00004  * Copyright (C) 1998-2000 AbiSource, Inc.
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 #ifndef EV_UNIXMENU_H
00023 #define EV_UNIXMENU_H
00024 
00025 #include "ut_types.h"
00026 #include "ut_vector.h"
00027 #include "xap_Types.h"
00028 #include "ev_Menu.h"
00029 
00030 class AV_View;
00031 class XAP_UnixApp;
00032 class XAP_UnixFrameImpl;
00033 class XAP_Frame;
00034 
00035 /*****************************************************************/
00036 
00037 class EV_UnixMenu : public EV_Menu
00038 {
00039 public:
00040     class _wd;
00041 
00042     EV_UnixMenu(XAP_UnixApp * pUnixApp,
00043             XAP_Frame * pFrame,
00044             const char * szMenuLayoutName,
00045             const char * szMenuLabelSetName);
00046     virtual ~EV_UnixMenu();
00047 
00048     bool                synthesizeMenu(GtkWidget * wMenuRoot, bool isPopup);
00049     bool                menuEvent(XAP_Menu_Id id);
00050     virtual bool        refreshMenu(AV_View * pView) = 0;
00051 
00052     XAP_Frame *     getFrame();
00053 
00054 protected:
00055     bool                _refreshMenu(AV_View * pView, GtkWidget * wMenuRoot);
00056     bool                _isItemPresent(XAP_Menu_Id id) const;
00057     virtual bool        _doAddMenuItem(UT_uint32 layout_pos);
00058 
00059 protected: // FIXME! These variables should be private.
00060     XAP_UnixApp *       m_pUnixApp;
00061     XAP_Frame *     m_pFrame;
00062 
00063     // Menu accelerator group, dynamically filled on synth()
00064     GtkAccelGroup *     m_accelGroup;
00065 
00066     // actual GTK menu widgets
00067     UT_GenericVector<GtkWidget*> m_vecMenuWidgets;
00068 private:
00069         void _convertStringToAccel(const char *s, guint &accel_key, GdkModifierType &ac_mods);
00070         GtkWidget * s_createNormalMenuEntry(const XAP_Menu_Id id,
00071                                             bool isCheckable,
00072                                             bool isRadio,
00073                                             bool isPopup,
00074                                             const char *szLabelName,
00075                                             const char *szMnemonicName);
00076     UT_GenericVector<_wd*>           m_vecCallbacks;
00077 };
00078 
00079 #endif /* EV_UNIXMENU_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1