]> git.lyx.org Git - features.git/commitdiff
Some changes to compile new painter code with compaq cxx
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 11 Feb 2000 13:52:44 +0000 (13:52 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 11 Feb 2000 13:52:44 +0000 (13:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@551 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
lib/layouts/foils.layout
src/LColor.h
src/Painter.C
src/Painter.h
src/PainterBase.C
src/WorkArea.C
src/WorkArea.h

index b05ab52d4539626164331024ee36c193d90ccf46..6baf57cd83718db2611f44eb5adc69c796a9d2b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+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
index 6fb7ac6735760f395996031eb1d5293fbf1517e4..f2ac43fd98a0c67e5a946a4edebd2050881dee7a 100644 (file)
@@ -53,7 +53,7 @@ Style Foilhead
   # standard font definition
   Font 
     Series             Bold
-    Size               Larger
+    Size               Large
   EndFont
 
 End
@@ -61,72 +61,22 @@ 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
index 848a29c7006422f1a4003aeb07c17669ee7c1438..d8034ace753c821abd0fe9856f3fd33aea08e231 100644 (file)
@@ -18,6 +18,8 @@
 #endif
 
 #include <map>
+using std::map;
+using std::less;
 
 #include "LString.h"
 
index d052f05b4f4095127f7128562f17f0cb0ef2c144..b46b1cef75dc2a7a3583763e44dc458baf0cde75 100644 (file)
@@ -60,7 +60,7 @@ Painter::~Painter() {
 
 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)
@@ -74,7 +74,7 @@ Painter & Painter::point(int x, int y, LColor::color c)
 }
 
 
-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)
@@ -92,7 +92,7 @@ Painter & Painter::line(int x1, int y1, int x2, int y2,
 }
 
 
-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)
@@ -124,7 +124,7 @@ Painter & Painter::lines(int const * xp, int const * yp, int np,
 }      
 
 
-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)
@@ -142,7 +142,7 @@ Painter & Painter::rectangle(int x, int y, int w, int h,
 }
 
 
-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()) {
@@ -157,7 +157,7 @@ Painter & Painter::fillRectangle(int x, int y, int w, int h,
 }
 
 
-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()) {
@@ -186,7 +186,7 @@ Painter & Painter::fillPolygon(int const * xp, int const * yp, int np,
 }      
 
 
-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)
 {
@@ -204,7 +204,7 @@ Painter & Painter::arc(int x, int y,
 
 
 /// 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)
@@ -236,7 +236,7 @@ Painter & Painter::segments(int const * x1, int const * y1,
 }
 
 
-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)
@@ -257,7 +257,7 @@ Painter & Painter::pixmap(int x, int y, Pixmap bitmap)
 }
 
 
-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)
@@ -274,7 +274,7 @@ Painter & Painter::text(int x, int y, string const & s, LyXFont const & f)
 }
 
 
-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()) {
@@ -292,7 +292,7 @@ Painter & Painter::text(int x, int y, char const * s, int ls,
 }
 
 
-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)
index 0c7ed2a93315ecb01985611bfdc8e9b9a3f45770..ddc5dea23ba011d74b41daf162a02efa71548e34 100644 (file)
@@ -27,6 +27,8 @@
 #include "PainterBase.h"
 #include "LColor.h"
 
+using std::less;
+
 class LyXFont;
 class WorkArea;
 
@@ -44,72 +46,72 @@ public:
     
        /**@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);
index 30e1ea921074cc50b41ce35989e7c6f7c01d6b26..efc760c4ed330118d6de342472251afdbe63f888 100644 (file)
@@ -55,7 +55,7 @@ int PainterBase::width(char c, LyXFont const & f)
 
 
 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);
 }
@@ -63,7 +63,7 @@ PainterBase & PainterBase::circle(int x, int y, unsigned int d,
 
 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);
 }
index 68a62c53eb622e328d1f5b046e1d916140b71984..29a783a5271985521c78e44a215dea2206795f04 100644 (file)
@@ -32,6 +32,33 @@ void waitForX()
        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)
@@ -88,7 +115,7 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
        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
@@ -108,7 +135,7 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
        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
@@ -126,7 +153,7 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
        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);
@@ -154,7 +181,7 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
                                      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. */
index 99cf3d538fbad3ec692ba1c5174b7775c232ba8a..6bc18a4c70d0d6a4591c7eb3636fb7e89364e651 100644 (file)
@@ -17,6 +17,7 @@
 #endif
 
 #include <utility>
+using std::pair;
 
 #include FORMS_H_LOCATION
 #include "Painter.h"
@@ -112,9 +113,6 @@ public:
        //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,
@@ -125,6 +123,9 @@ private:
        static void down_cb(FL_OBJECT *, long);
        /// xforms callback
        static void scroll_cb(FL_OBJECT *, long);
+private:
+       ///
+       void createPixmap(int, int);
        ///
        FL_OBJECT * backgroundbox;
        ///