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

ev_CocoaMenuBar.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  * Copyright (C) 2001 Hubert Figuiere
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 
00023 #ifndef EV_COCOAMENUBAR_H
00024 #define EV_COCOAMENUBAR_H
00025 
00026 #import <Cocoa/Cocoa.h>
00027 
00028 #include "ev_CocoaMenu.h"
00029 
00030 class AV_View;
00031 class AP_CocoaFrame;
00032 class EV_CocoaMenuBar;
00033 
00034 #if 0
00035 
00036 #define EV_COCOAMENU_MODSHIFT     0x080
00037 #define EV_COCOAMENU_MODCONTROL   0x100
00038 #define EV_COCOAMENU_MODALTERNATE 0x200
00039 #define EV_COCOAMENU_MODCOMMAND   0x400
00040 
00041 struct EV_CocoaCommandKeyRef
00042 {
00043     id      target;
00044     SEL     action;
00045 
00046     XAP_Menu_Id menuid;
00047 
00048     UT_uint32   key;
00049 };
00050 
00051 @class EV_CocoaPaletteMenuItem;
00052 
00053 @interface EV_CocoaMenuDelegate : NSObject
00054 {
00055     EV_CocoaMenuBar *   m_MenuBar;
00056 
00057     struct EV_CocoaCommandKeyRef    m_KeyRef;
00058 }
00059 - (id)initWithMenuBar:(EV_CocoaMenuBar *)menuBar;
00060 - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action;
00061 - (BOOL)queryCommandKey:(char)c withModifierFlags:(unsigned int)modifierFlags;
00062 @end
00063 
00064 @interface EV_CocoaDockMenu : NSMenu
00065 {
00066     int m_numberOfFrames;
00067 
00068     EV_CocoaPaletteMenuItem *   m_pMenuItem_Palette;
00069     EV_CocoaPaletteMenuItem *   m_pMenuItem_Preview;
00070 }
00071 -(id)initWithNumberOfFrames:(int)numberOfFrames;
00072 -(void)setMenuItem_Palette:(EV_CocoaPaletteMenuItem *)pMenuItem_Palette;
00073 -(void)setMenuItem_Preview:(EV_CocoaPaletteMenuItem *)pMenuItem_Preview;
00074 -(void)menuNeedsUpdate;
00075 @end
00076 
00077 #endif
00078 
00079 /*****************************************************************/
00080 
00081 class EV_CocoaMenuBar : public EV_CocoaMenu
00082 {
00083 public:
00084     EV_CocoaMenuBar(const char * szMenuLayoutName, const char * szMenuLabelSetName);
00085 
00086     virtual ~EV_CocoaMenuBar();
00087 
00088 #if 0
00089     NSMenu *            getMenuBar() const { return m_wMenuBar; }
00090 
00091     bool                lookupCommandKey (struct EV_CocoaCommandKeyRef * keyRef) const;
00092     void                addCommandKey (const struct EV_CocoaCommandKeyRef * keyRef);
00093 
00094     static EV_CocoaDockMenu *   synthesizeDockMenu(const UT_Vector & vecDocs);
00095     static void                 releaseDockMenu(EV_CocoaDockMenu * pMenu);
00096 private:
00097     static NSMenuItem *                 s_pMenuItem_FileNew;
00098     static NSMenuItem *                 s_pMenuItem_FileOpen;
00099     static EV_CocoaPaletteMenuItem *    s_pMenuItem_Palette;
00100     static EV_CocoaPaletteMenuItem *    s_pMenuItem_Preview;
00101 protected:
00102     NSMenu *            m_wMenuBar;
00103     UT_Vector           m_vecKeyRef;
00104 #endif
00105 };
00106 
00107 #endif /* EV_COCOAMENUBAR_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1