2000-07-24 13:53:19 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2002-09-26 08:57:43 +00:00
|
|
|
|
* \file xforms/Menubar_pimpl.h
|
2002-03-11 17:00:41 +00:00
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
|
* Copyright 1996-2001 Lars Gullik Bj<EFBFBD>nnes
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2000-07-24 13:53:19 +00:00
|
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-03-11 17:00:41 +00:00
|
|
|
|
*/
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
|
|
|
|
#ifndef MENUBAR_PIMPL_H
|
|
|
|
|
#define MENUBAR_PIMPL_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
#include "frontends/Menubar.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
2002-05-22 01:16:37 +00:00
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include "forms_fwd.h"
|
|
|
|
|
#include <X11/X.h> // Window
|
2002-05-22 01:16:37 +00:00
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
class LyXView;
|
2002-07-20 15:25:41 +00:00
|
|
|
|
class XFormsView;
|
2002-07-21 21:21:06 +00:00
|
|
|
|
class Menu;
|
|
|
|
|
class MenuItem;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
|
|
|
|
/** The LyX GUI independent menubar class
|
2002-03-21 21:21:28 +00:00
|
|
|
|
The GUI interface is implemented in the corresponding Menubar_pimpl class.
|
2000-07-24 13:53:19 +00:00
|
|
|
|
*/
|
|
|
|
|
struct Menubar::Pimpl {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
Pimpl(LyXView *, MenuBackend const &);
|
2002-08-21 06:32:10 +00:00
|
|
|
|
///
|
|
|
|
|
~Pimpl();
|
2002-07-20 21:50:05 +00:00
|
|
|
|
|
|
|
|
|
/// update the state of the menuitems
|
|
|
|
|
void update();
|
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/// Opens a top-level submenu given its name
|
|
|
|
|
void openByName(string const &);
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
static void MenuCallback(FL_OBJECT *, long);
|
|
|
|
|
|
2002-07-20 21:50:05 +00:00
|
|
|
|
private:
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
2000-08-31 11:51:59 +00:00
|
|
|
|
void add_toc(int menu, string const & extra_label,
|
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
|
|
|
|
void add_references(int menu, string const & extra_label,
|
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
2002-07-20 15:25:41 +00:00
|
|
|
|
int create_submenu(Window win, XFormsView * view,
|
2002-07-25 14:00:29 +00:00
|
|
|
|
Menu const & menu,
|
|
|
|
|
std::vector<int> & smn, bool & all_disabled);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2000-09-26 16:16:55 +00:00
|
|
|
|
//
|
2002-08-21 06:32:10 +00:00
|
|
|
|
void makeMenubar(Menu const & menu);
|
2000-09-26 16:16:55 +00:00
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
///
|
2002-07-20 15:25:41 +00:00
|
|
|
|
XFormsView * owner_;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
|
|
|
|
MenuBackend const * menubackend_;
|
|
|
|
|
///
|
|
|
|
|
struct ItemInfo {
|
|
|
|
|
///
|
2002-03-21 21:21:28 +00:00
|
|
|
|
ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
|
2002-08-21 06:32:10 +00:00
|
|
|
|
FL_OBJECT * o);
|
|
|
|
|
~ItemInfo();
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
|
|
|
|
Menubar::Pimpl * pimpl_;
|
|
|
|
|
///
|
2001-03-07 16:18:05 +00:00
|
|
|
|
boost::shared_ptr<MenuItem const> item_;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
|
|
|
|
FL_OBJECT * obj_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
2001-03-07 16:18:05 +00:00
|
|
|
|
typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
|
|
|
|
ButtonList buttonlist_;
|
|
|
|
|
};
|
|
|
|
|
#endif
|