• 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., 59 Temple Place - Suite 330, Boston, MA
00019  * 02111-1307, 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     EV_UnixMenu(XAP_UnixApp * pUnixApp,
00041             XAP_Frame * pFrame,
00042             const char * szMenuLayoutName,
00043             const char * szMenuLabelSetName);
00044     virtual ~EV_UnixMenu();
00045 
00046     bool                synthesizeMenu(GtkWidget * wMenuRoot, bool isPopup);
00047     bool                menuEvent(XAP_Menu_Id id);
00048     virtual bool        refreshMenu(AV_View * pView) = 0;
00049 
00050     XAP_Frame *     getFrame();
00051 
00052 protected:
00053     bool                _refreshMenu(AV_View * pView, GtkWidget * wMenuRoot);
00054     bool                _isItemPresent(XAP_Menu_Id id) const;
00055     virtual bool        _doAddMenuItem(UT_uint32 layout_pos);
00056 
00057 protected: // FIXME! These variables should be private.
00058     XAP_UnixApp *       m_pUnixApp;
00059     XAP_Frame *     m_pFrame;
00060 
00061     // Menu accelerator group, dynamically filled on synth()
00062     GtkAccelGroup *     m_accelGroup;
00063 
00064     // actual GTK menu widgets
00065     UT_GenericVector<GtkWidget*> m_vecMenuWidgets;
00066 private:
00067         void _convertStringToAccel(const char *s, guint &accel_key, GdkModifierType &ac_mods);
00068         GtkWidget * s_createNormalMenuEntry(const XAP_Menu_Id id,
00069                                             bool isCheckable,
00070                                             bool isRadio,
00071                                             bool isPopup,
00072                                             const char *szLabelName,
00073                                             const char *szMnemonicName);
00074     UT_Vector           m_vecCallbacks;
00075 };
00076 
00077 #endif /* EV_UNIXMENU_H */

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1