1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
2000-02-04 09:38:32 +00:00
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
#ifndef LyXView_H
|
|
|
|
#define LyXView_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include FORMS_H_LOCATION
|
1999-11-04 01:40:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXFunc;
|
|
|
|
class Toolbar;
|
|
|
|
class MiniBuffer;
|
|
|
|
class Intl;
|
2000-04-08 17:02:02 +00:00
|
|
|
class Buffer;
|
|
|
|
class Menus;
|
|
|
|
class BufferView;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
struct FD_form_main {
|
|
|
|
///
|
1999-11-09 23:52:04 +00:00
|
|
|
FL_FORM * form_main;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-09 23:52:04 +00:00
|
|
|
FL_OBJECT * timer_autosave;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-09 23:52:04 +00:00
|
|
|
FL_OBJECT * timer_update;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-09 23:52:04 +00:00
|
|
|
void * vdata;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
long ldata;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
This class is the form containing the view of the buffer. The actual buffer
|
|
|
|
view is supposed (at least IMHO) to be another class, that shows its output
|
|
|
|
in one or more LyXView's.
|
|
|
|
*/
|
|
|
|
class LyXView {
|
|
|
|
public:
|
|
|
|
/// constructor
|
|
|
|
LyXView(int w, int h);
|
|
|
|
|
|
|
|
/// destructor
|
|
|
|
~LyXView();
|
|
|
|
|
|
|
|
/// Where to place the form.
|
|
|
|
void setPosition(int, int);
|
|
|
|
|
|
|
|
/// Show the main form.
|
1999-11-15 12:01:38 +00:00
|
|
|
void show(int, int, char const * t = "LyX");
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// init (should probably be removed later) (Lgb)
|
|
|
|
void init();
|
|
|
|
|
|
|
|
/// Redraw the main form.
|
|
|
|
void redraw();
|
|
|
|
|
|
|
|
/// returns the buffer currently shown in the main form.
|
2000-04-08 17:02:02 +00:00
|
|
|
Buffer * buffer() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
BufferView * view() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-12-19 22:35:36 +00:00
|
|
|
/// returns a pointer to the main form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FD_form_main * getMainForm() const;
|
1999-12-19 22:35:36 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// returns a pointer to the form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FL_FORM * getForm() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the toolbar
|
2000-04-08 17:02:02 +00:00
|
|
|
Toolbar * getToolbar() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the lyxfunc
|
2000-04-08 17:02:02 +00:00
|
|
|
LyXFunc * getLyXFunc() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the minibuffer
|
2000-04-08 17:02:02 +00:00
|
|
|
MiniBuffer * getMiniBuffer() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
Menus * getMenus() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
Intl * getIntl() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
void updateLayoutChoice();
|
|
|
|
|
|
|
|
/// Updates the title of the window
|
|
|
|
void updateWindowTitle();
|
|
|
|
|
|
|
|
/// Reset autosave timer
|
|
|
|
void resetAutosaveTimer();
|
|
|
|
private:
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXFunc * lyxfunc;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Toolbar * toolbar;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
MiniBuffer * minibuffer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Menus * menus;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Intl * intl;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** This is supposed to be a pointer or a list of pointers to the
|
|
|
|
BufferViews currently being shown in the LyXView. So far
|
|
|
|
this is not used, but that should change pretty soon. (Lgb) */
|
1999-11-04 01:40:20 +00:00
|
|
|
BufferView * bufferview;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void invalidateLayoutChoice();
|
|
|
|
///
|
|
|
|
void UpdateDocumentClassChoice();
|
1999-10-25 14:18:30 +00:00
|
|
|
public:
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
|
1999-09-27 18:44:28 +00:00
|
|
|
/** This callback is run when a close event is sent from the
|
|
|
|
window manager. */
|
|
|
|
static int atCloseMainFormCB(FL_FORM *, void *);
|
|
|
|
/// A callback
|
|
|
|
static void AutosaveTimerCB(FL_OBJECT *, long);
|
|
|
|
/// A callback
|
|
|
|
static void UpdateTimerCB(FL_OBJECT *, long);
|
1999-10-25 14:18:30 +00:00
|
|
|
private:
|
|
|
|
/// makes the main form.
|
1999-12-19 22:35:36 +00:00
|
|
|
void create_form_form_main(int width, int height);
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A pointer to the form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FD_form_main * form_main_;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A pointer to the form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FL_FORM * form_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** The last textclass layout list in the layout choice selector
|
|
|
|
This should probably be moved to the toolbar, but for now it's
|
|
|
|
here. (Asger) */
|
|
|
|
int last_textclass;
|
|
|
|
};
|
|
|
|
#endif
|