2002-05-26 18:30:34 +00:00
|
|
|
// -*- C++ -*-
|
2002-06-12 15:01:32 +00:00
|
|
|
/**
|
|
|
|
* \file XWorkArea.h
|
|
|
|
* Copyright 1995-2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
2002-05-26 18:30:34 +00:00
|
|
|
*
|
2002-06-12 15:01:32 +00:00
|
|
|
* \author unknown
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
*/
|
2002-05-26 18:30:34 +00:00
|
|
|
|
2002-05-29 16:21:03 +00:00
|
|
|
#ifndef XWORKAREA_H
|
|
|
|
#define XWORKAREA_H
|
2002-05-26 18:30:34 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
#include "frontends/WorkArea.h"
|
2002-06-12 15:01:32 +00:00
|
|
|
#include "XPainter.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
#include FORMS_H_LOCATION
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
class XWorkArea : public WorkArea {
|
2002-05-26 18:30:34 +00:00
|
|
|
public:
|
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
XWorkArea(int xpos, int ypos, int width, int height);
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
~XWorkArea();
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual Painter & getPainter() { return painter_; }
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual int workWidth() const { return work_area->w; }
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual int workHeight() const { return work_area->h; }
|
2002-06-12 00:51:45 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual void redraw() const {
|
2002-05-26 18:30:34 +00:00
|
|
|
fl_redraw_object(work_area);
|
|
|
|
fl_redraw_object(scrollbar);
|
|
|
|
}
|
|
|
|
///
|
|
|
|
Window getWin() const { return work_area->form->window; }
|
2002-06-12 15:01:32 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual void setScrollbarParams(int height, int pos, int line_height);
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
|
|
|
Pixmap getPixmap() const { return workareapixmap; }
|
|
|
|
/// xforms callback
|
|
|
|
static int work_area_handler(FL_OBJECT *, int event,
|
|
|
|
FL_Coord, FL_Coord,
|
|
|
|
int /*key*/, void * xev);
|
2002-06-12 15:01:32 +00:00
|
|
|
|
2002-06-19 18:29:07 +00:00
|
|
|
/// return x position of window
|
|
|
|
int xpos() const { return work_area->x; }
|
|
|
|
/// return y position of window
|
|
|
|
int ypos() const { return work_area->y; }
|
|
|
|
|
2002-06-12 15:01:32 +00:00
|
|
|
/// xforms callback from scrollbar
|
|
|
|
void scroll_cb();
|
2002-05-26 18:30:34 +00:00
|
|
|
/// a selection exists
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual void haveSelection(bool) const;
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual string const getClipboard() const;
|
2002-05-26 18:30:34 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual void putClipboard(string const &) const;
|
2002-05-26 18:30:34 +00:00
|
|
|
|
|
|
|
/// handles SelectionRequest X Event, to fill the clipboard
|
|
|
|
int event_cb(XEvent * xev);
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
void createPixmap(int, int);
|
|
|
|
|
|
|
|
///
|
|
|
|
FL_OBJECT * backgroundbox;
|
|
|
|
///
|
|
|
|
FL_OBJECT * work_area;
|
|
|
|
///
|
|
|
|
FL_OBJECT * scrollbar;
|
|
|
|
///
|
|
|
|
mutable FL_OBJECT * splash_;
|
|
|
|
///
|
|
|
|
mutable FL_OBJECT * splash_text_;
|
|
|
|
/// The pixmap overlay on the workarea
|
|
|
|
Pixmap workareapixmap;
|
|
|
|
///
|
2002-06-12 15:01:32 +00:00
|
|
|
XPainter painter_;
|
2002-05-26 18:30:34 +00:00
|
|
|
/// if we call redraw with true needed for locking-insets
|
|
|
|
bool screen_cleared;
|
2002-06-12 15:01:32 +00:00
|
|
|
/// the current document's height (for scrollbar)
|
|
|
|
int doc_height_;
|
2002-05-26 18:30:34 +00:00
|
|
|
};
|
2002-06-12 15:01:32 +00:00
|
|
|
|
|
|
|
#endif // XWORKAREA_H
|