]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/Menubar_pimpl.h
different low-level key handling for xforms 0.89, use signals in workarea, changes...
[lyx.git] / src / frontends / gnome / Menubar_pimpl.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 2000 The LyX Team.
8  *
9  * ====================================================== */
10
11 #ifndef MENUBAR_PIMPL_H
12 #define MENUBAR_PIMPL_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include <vector>
19 #include "LString.h"
20 #include <gnome--/app.h>
21 #include "frontends/Menubar.h"
22
23 class LyXView;
24 class MenuBackend;
25 class MenuItem;
26 class StrPool;
27
28 #include "debug.h"
29
30 /*
31   Structure containing Gtk widget and corresponding LyX action
32 */
33 struct GtkWidgetToAction
34 {
35 public:
36   GtkWidgetToAction(GtkWidget * w, int a) { widget_=w; action_=a; }
37   
38 public:
39   GtkWidget * widget_;
40   int action_;
41 };
42
43 /** The LyX GUI independent menubar class
44   The GUI interface is implemented in the corresponding Menubar_pimpl class. 
45   */
46 class Menubar::Pimpl: public SigC::Object {
47 public:
48   ///
49   Pimpl(LyXView *, MenuBackend const &);
50   ///
51   ~Pimpl();
52   ///
53   void set(string const &);
54   /// Opens a top-level submenu given its name
55   void openByName(string const &) {}
56   /// update the state of menuitems
57   void update();
58   
59 protected:
60   /// callback function
61   void callback(int action);
62   /// compose Gnome::UI::Array object describing the menu
63   void composeUIInfo(string const & menu_name, vector<Gnome::UI::Info> & Menus);
64   /// populate wid_act_ vector with all widgets and corresponding actions
65   void connectWidgetToAction(GnomeUIInfo * guinfo);
66   
67 private:
68   /// 
69   LyXView * owner_;
70   ///
71   MenuBackend const * menubackend_;
72   ///
73   string current_menu_name_;
74   Gnome::UI::Array Menu_;
75
76   ///
77   bool ignore_action_;
78   int  action_;
79   vector<GtkWidgetToAction> wid_act_;
80 };
81 #endif