2000-07-24 13:53:19 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2003-07-25 21:34:45 +00:00
|
|
|
|
* \file XFormsMenubar.h
|
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
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* 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
|
|
|
|
|
2003-07-25 21:34:45 +00:00
|
|
|
|
#ifndef XFORMSMENUBAR_H
|
|
|
|
|
#define XFORMSMENUBAR_H
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
|
#include "funcrequest.h"
|
2000-07-24 13:53:19 +00:00
|
|
|
|
#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>
|
|
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
|
|
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;
|
2003-07-25 21:34:45 +00:00
|
|
|
|
class MenuBackend;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2003-07-25 21:34:45 +00:00
|
|
|
|
class XFormsMenubar : public Menubar {
|
2000-07-24 13:53:19 +00:00
|
|
|
|
public:
|
2003-09-21 18:57:15 +00:00
|
|
|
|
///
|
|
|
|
|
typedef std::vector<FuncRequest> Funcs;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
2003-07-25 21:34:45 +00:00
|
|
|
|
XFormsMenubar(LyXView *, MenuBackend const &);
|
2002-08-21 06:32:10 +00:00
|
|
|
|
///
|
2003-07-25 21:34:45 +00:00
|
|
|
|
~XFormsMenubar();
|
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
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void openByName(std::string const &);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
static void MenuCallback(FL_OBJECT *, long);
|
|
|
|
|
|
2002-07-20 21:50:05 +00:00
|
|
|
|
private:
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void add_toc(int menu, std::string const & extra_label,
|
2000-08-31 11:51:59 +00:00
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void add_references(int menu, std::string const & extra_label,
|
2000-08-31 11:51:59 +00:00
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
2002-07-20 15:25:41 +00:00
|
|
|
|
int create_submenu(Window win, XFormsView * view,
|
2003-09-21 18:57:15 +00:00
|
|
|
|
Menu const & menu,
|
|
|
|
|
std::vector<int> & smn, Funcs & funcs);
|
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 {
|
|
|
|
|
///
|
2003-07-25 21:34:45 +00:00
|
|
|
|
ItemInfo(XFormsMenubar * p, MenuItem const * i,
|
2002-08-21 06:32:10 +00:00
|
|
|
|
FL_OBJECT * o);
|
|
|
|
|
~ItemInfo();
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
2003-07-25 21:34:45 +00:00
|
|
|
|
XFormsMenubar * menubar_;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
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
|