+2000-02-11 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/PainterBase.C (ellipse, circle): do not specify the default
+ arguments.
+
+ * src/LColor.h: add using directive.
+
+ * src/Painter.[Ch]: change return type of methods from Painter& to
+ PainterBase&. Add a using directive.
+
+ * src/WorkArea.C: wrap xforms callbacks in C functions
+ C_WorkArea_xxx.
+
+ * lib/layouts/foils.layout: font fix and simplifications from Carl
+ Ollivier-Gooch.
+
2000-02-10 Lars Gullik Bjønnes <larsbj@lyx.org>
* a lot of files: The Painter, LColor and WorkArea from the old
# standard font definition
Font
Series Bold
- Size Larger
+ Size Large
EndFont
End
# Shortfoilhead style definition
Style ShortFoilhead
- Margin Static
- LatexType Command
- LatexName foilhead
+ CopyStyle Foilhead
LatexParam "[-0.5in]"
- LabelSep xxx
- ParSkip 0.4
- TopSep 1.3
- BottomSep 0.7
- ParSep 0.7
- Align Center
- AlignPossible Center
- LabelType No_Label
-
- # standard font definition
- Font
- Series Bold
- Size Larger
- EndFont
-
End
# landscape foilhead style definition
Style Rotatefoilhead
- Margin Static
- LatexType Command
+ CopyStyle Foilhead
LatexName rotatefoilhead
- LabelSep xxx
- ParSkip 0.4
- TopSep 1.3
- BottomSep 0.7
- ParSep 0.7
- Align Center
- AlignPossible Center
- LabelType No_Label
-
- # standard font definition
- Font
- Series Bold
- Size Larger
- EndFont
-
End
# ShortRotatefoilhead style definition
Style ShortRotatefoilhead
- Margin Static
- LatexType Command
- LatexName rotatefoilhead
+ CopyStyle Rotatefoilhead
LatexParam "[-0.5in]"
- LabelSep xxx
- ParSkip 0.4
- TopSep 1.3
- BottomSep 0.7
- ParSep 0.7
- Align Center
- AlignPossible Center
- LabelType No_Label
-
- # standard font definition
- Font
- Series Bold
- Size Larger
- EndFont
-
End
# then a few lists
#endif
#include <map>
+using std::map;
+using std::less;
#include "LString.h"
extern bool Lgb_bug_find_hack;
-Painter & Painter::point(int x, int y, LColor::color c)
+PainterBase & Painter::point(int x, int y, LColor::color c)
{
if (lyxerr.debugging()) {
if (!Lgb_bug_find_hack)
}
-Painter & Painter::line(int x1, int y1, int x2, int y2,
+PainterBase & Painter::line(int x1, int y1, int x2, int y2,
LColor::color col,
enum line_style ls,
enum line_width lw)
}
-Painter & Painter::lines(int const * xp, int const * yp, int np,
+PainterBase & Painter::lines(int const * xp, int const * yp, int np,
LColor::color col,
enum line_style ls,
enum line_width lw)
}
-Painter & Painter::rectangle(int x, int y, int w, int h,
+PainterBase & Painter::rectangle(int x, int y, int w, int h,
LColor::color col,
enum line_style ls,
enum line_width lw)
}
-Painter & Painter::fillRectangle(int x, int y, int w, int h,
+PainterBase & Painter::fillRectangle(int x, int y, int w, int h,
LColor::color col)
{
if (lyxerr.debugging()) {
}
-Painter & Painter::fillPolygon(int const * xp, int const * yp, int np,
+PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np,
LColor::color col)
{
if (lyxerr.debugging()) {
}
-Painter & Painter::arc(int x, int y,
+PainterBase & Painter::arc(int x, int y,
unsigned int w, unsigned int h,
int a1, int a2, LColor::color col)
{
/// Draw lines from x1,y1 to x2,y2. They are arrays
-Painter & Painter::segments(int const * x1, int const * y1,
+PainterBase & Painter::segments(int const * x1, int const * y1,
int const * x2, int const * y2, int ns,
LColor::color col,
enum line_style ls, enum line_width lw)
}
-Painter & Painter::pixmap(int x, int y, Pixmap bitmap)
+PainterBase & Painter::pixmap(int x, int y, Pixmap bitmap)
{
if (lyxerr.debugging()) {
if (!Lgb_bug_find_hack)
}
-Painter & Painter::text(int x, int y, string const & s, LyXFont const & f)
+PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
{
if (lyxerr.debugging()) {
if (!Lgb_bug_find_hack)
}
-Painter & Painter::text(int x, int y, char const * s, int ls,
+PainterBase & Painter::text(int x, int y, char const * s, int ls,
LyXFont const & f)
{
if (lyxerr.debugging()) {
}
-Painter & Painter::text(int x, int y, char c, LyXFont const & f)
+PainterBase & Painter::text(int x, int y, char c, LyXFont const & f)
{
if (lyxerr.debugging()) {
if (!Lgb_bug_find_hack)
#include "PainterBase.h"
#include "LColor.h"
+using std::less;
+
class LyXFont;
class WorkArea;
/**@Basic drawing routines */
/// Draw a line from point to point
- Painter & line(int x1, int y1, int x2, int y2,
+ PainterBase & line(int x1, int y1, int x2, int y2,
LColor::color = LColor::foreground,
enum line_style = line_solid,
enum line_width = line_thin);
/// Here xp and yp are arrays of points
- Painter & lines(int const * xp, int const * yp, int np,
+ PainterBase & lines(int const * xp, int const * yp, int np,
LColor::color = LColor::foreground,
enum line_style = line_solid,
enum line_width = line_thin);
/// Here xp and yp are arrays of points
- Painter & fillPolygon(int const * xp, int const * yp, int np,
+ PainterBase & fillPolygon(int const * xp, int const * yp, int np,
LColor::color = LColor::foreground);
/// Draw lines from x1,y1 to x2,y2. They are arrays
- Painter & segments(int const * x1, int const * y1,
+ PainterBase & segments(int const * x1, int const * y1,
int const * x2, int const * y2, int ns,
LColor::color = LColor::foreground,
enum line_style = line_solid,
enum line_width = line_thin);
/// Draw a rectangle
- Painter & rectangle(int x, int y, int w, int h,
+ PainterBase & rectangle(int x, int y, int w, int h,
LColor::color = LColor::foreground,
enum line_style = line_solid,
enum line_width = line_thin);
/// Draw an arc
- Painter & arc(int x, int y, unsigned int w, unsigned int h,
+ PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
int a1, int a2,
LColor::color = LColor::foreground);
/// Draw a pixel
- Painter & point(int x, int y, LColor::color = LColor::foreground);
+ PainterBase & point(int x, int y, LColor::color = LColor::foreground);
/// Fill a rectangle
- Painter & fillRectangle(int x, int y, int w, int h,
+ PainterBase & fillRectangle(int x, int y, int w, int h,
LColor::color = LColor::background);
/**@Image stuff */
/// For the figure inset
- Painter & pixmap(int x, int y, Pixmap bitmap);
+ PainterBase & pixmap(int x, int y, Pixmap bitmap);
/**@String functions */
/// Draw a string at position x, y (y is the baseline)
- Painter & text(int x, int y, string const & str, LyXFont const & f);
+ PainterBase & text(int x, int y, string const & str, LyXFont const & f);
/** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */
- Painter & text(int x, int y, char const * str, int l,
+ PainterBase & text(int x, int y, char const * str, int l,
LyXFont const & f);
/// Draw a char at position x, y (y is the baseline)
- Painter & text(int x, int y, char c, LyXFont const & f);
+ PainterBase & text(int x, int y, char c, LyXFont const & f);
protected:
/**@Support for X only, by now */
friend class WorkArea;
///
- Painter & setDisplay(Display * d) { display = d; return *this; }
+ PainterBase & setDisplay(Display * d) { display = d; return *this; }
///
- Painter & setDrawable(Drawable d) { drawable = d; return *this; }
+ PainterBase & setDrawable(Drawable d) { drawable = d; return *this; }
/// Get foreground color in ordinary GC
GC getGCForeground(LColor::color c);
PainterBase & PainterBase::circle(int x, int y, unsigned int d,
- LColor::color col = LColor::foreground)
+ LColor::color col)
{
return ellipse(x, y, d, d, col);
}
PainterBase & PainterBase::ellipse(int x, int y,
unsigned int w, unsigned int h,
- LColor::color col = LColor::foreground)
+ LColor::color col)
{
return arc(x, y, w, h, 0, 0, col);
}
XSync(fl_get_display(), 0);
}
+extern "C" {
+// Just a bunch of C wrappers around static members of WorkArea
+ void C_WorkArea_up_cb(FL_OBJECT * ob, long buf)
+ {
+ WorkArea::up_cb(ob, buf);
+ }
+
+ void C_WorkArea_down_cb(FL_OBJECT * ob, long buf)
+ {
+ WorkArea::down_cb(ob, buf);
+ }
+
+ void C_WorkArea_scroll_cb(FL_OBJECT * ob, long buf)
+ {
+ WorkArea::scroll_cb(ob, buf);
+ }
+
+ int C_WorkArea_work_area_handler(FL_OBJECT * ob, int event,
+ FL_Coord, FL_Coord,
+ int key, void * xev)
+ {
+ return WorkArea::work_area_handler(ob, event,
+ 0, 0, key, xev);
+ }
+}
+
+
WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
: owner(o), workareapixmap(0)
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj,NorthEastGravity, NorthEastGravity);
obj->u_vdata = this;
- fl_set_object_callback(obj,up_cb, 0);
+ fl_set_object_callback(obj,C_WorkArea_up_cb, 0);
fl_set_pixmapbutton_data(obj, const_cast<char**>(up_xpm));
// Remove the blue feedback rectangle
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthEastGravity, SouthEastGravity);
obj->u_vdata = this;
- fl_set_object_callback(obj, scroll_cb, 0);
+ fl_set_object_callback(obj, C_WorkArea_scroll_cb, 0);
fl_set_slider_precision(obj, 0);
// down - scrollbar button
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity);
obj->u_vdata = this;
- fl_set_object_callback(obj, down_cb, 0);
+ fl_set_object_callback(obj, C_WorkArea_down_cb, 0);
fl_set_pixmapbutton_data(obj, const_cast<char**>(down_xpm));
fl_set_border_width(-bw);
xpos + bw, ypos + bw,
width - 15 - 2 * bw, // scrollbarwidth
height - 2 * bw, "",
- work_area_handler);
+ C_WorkArea_work_area_handler);
obj->wantkey = FL_KEY_TAB;
obj->u_vdata = this; /* This is how we pass the WorkArea
to the work_area_handler. */
#endif
#include <utility>
+using std::pair;
#include FORMS_H_LOCATION
#include "Painter.h"
//Signal3<int, int, unsigned int> trippleclick;
///
//Signal2<Window, XEvent *> selection;
-private:
- ///
- void createPixmap(int, int);
/// xforms callback
static int work_area_handler(FL_OBJECT *, int event,
FL_Coord, FL_Coord,
static void down_cb(FL_OBJECT *, long);
/// xforms callback
static void scroll_cb(FL_OBJECT *, long);
+private:
+ ///
+ void createPixmap(int, int);
///
FL_OBJECT * backgroundbox;
///