1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-04 01:40:20 +00:00
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-1998 The LyX Team.
|
|
|
|
*
|
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
#ifndef LyXView_H
|
|
|
|
#define LyXView_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include FORMS_H_LOCATION
|
|
|
|
#include "lyx.h"
|
|
|
|
#include "buffer.h"
|
|
|
|
#include "menus.h"
|
|
|
|
#include "BufferView.h"
|
1999-11-04 01:40:20 +00:00
|
|
|
#include "layout.h"
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXFunc;
|
|
|
|
class Toolbar;
|
|
|
|
class MiniBuffer;
|
|
|
|
class Intl;
|
|
|
|
|
|
|
|
///
|
|
|
|
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-04 01:40:20 +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.
|
1999-11-09 23:52:04 +00:00
|
|
|
Buffer * buffer() const { return bufferview->buffer(); }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
BufferView * currentView() { return bufferview; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// returns a pointer to the form.
|
1999-11-04 01:40:20 +00:00
|
|
|
FL_FORM * getForm() { return _form; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the toolbar
|
1999-11-04 01:40:20 +00:00
|
|
|
Toolbar * getToolbar() { return toolbar; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the lyxfunc
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXFunc * getLyXFunc() { return lyxfunc; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the minibuffer
|
1999-11-04 01:40:20 +00:00
|
|
|
MiniBuffer * getMiniBuffer() { return minibuffer; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Menus * getMenus() { return menus; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Intl * getIntl() { return intl; }
|
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-11-04 01:40:20 +00:00
|
|
|
FD_form_main * create_form_form_main(int width, int height);
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A pointer to the form.
|
1999-11-04 01:40:20 +00:00
|
|
|
FD_form_main * _form_main;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A pointer to the form.
|
1999-11-04 01:40:20 +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
|