Commit (JMM-DOUBLEGRAPHICS-1): Move layout and graphics classes to double precision

From: J.M. Maurer <j.m.maurer_at_student.utwente.nl>
Date: Tue Nov 23 2004 - 23:14:05 CET

This (quite massive) commit removes almost all integer math from
the layout and graphics classes.

Some very important issues about this commit, please read, dear AbiDevs:
(I'm sure I'm forgetting stuff, I'll get to that when I remember it)

* _tduX, _tduY and _tduR are not needed anymore, and are removed. Just use tdu.

* NEVER, EVER write code like:

  right = left + width
  or
  bottom = top + height

  The correct code is:

  right = left + width - tlu(1)
  and
  bottom = top + height - tlu(1)

  I have fixed quite a number of such issues, but not
  everywhere. Hence, you'll see drawing errors all over
  the place. Please correct them as you find them.
  Just remember, ____NEVER____ forget the "- tlu(1)".

  There is _1_ exception to this, and that is how the X
  cliprect function works. This is clearly documented in the
  Unix Graphics class. I am not aware of any
  other place where such code might be needed.

* See the previous point.

* Did you read the previous point? Really? Martin too? Great.

* From now on, please only convert device units using tdu ONLY (if possible)
  at the very last moment. For example when calling into
  a GDI function on Win32, or GDK function on Unix. I've done most of this,
  but function like drawChars still loose a lot of precision on this.

* "random" +2 or -1 or +3 values (note the lack of tlu) in the layout
  code is BAD. Bad bad bad. And yes, they are there. Please never use
  that, and if you find it please fix it.

* A lot of code is marked // FIXME: reason blah blah - MARCM
  Please grep through the code, and fix any issue you find if possible.

* NEVER compare doubles. If you must compare them, use:

  tdu(double1) == tdu(double2)
  or
  UT_dEQ(double1, double2) , which returns true if the difference is 10^-7 or less.

  If you find any double comparision, which uses the plain == operator,
  please fix it.

* Almost every function prototype has changed, but there is still some
  work left. Due to this, there are quite some warnings left (I already
  fixed hundreds and hundreds of them). Notably in the ap_Top/LeftRuler
  classes. This will be fixed in the future (feel free to fix them),
  when more function prototypes are changes, or s/UT_sint32/double is done.

* Unix and Win32 compile fine. I don't have access to OSX, sorry.
  Would be great of someone could get that up to speed.

  You'll see drawing errors on both platforms all over the place,
  which are caused by:

  * Point 2, the "-tlu(1)" thingy which is not everywhere yet. As I fixed _some_
    of them, there are still other functions which use the wrong values.

  * I fucked up. Sorry about that. In a patch of about 600 KB, you'd expect
    regressions. Sorry again.

* a lot of class member variables are called m_iFoo, while they should be
  called m_dFoo now. I did not feel like fixing them right now.
  The great thing however now is, that you can "see" which values are in
  layout units, and which are not (doubles are, integers are not, they are in
  device units). This is quite neat actually.

* I fixed random stuff all over the place, mostly funky math. Feel free
  to fix more.

* I didn't came up with the branchname, blame mg :-)

I think that'd be all. Thanks for listening :-)

Bye!
  Marc

Move the layout and graphics classes to double precision.

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: Tag: JMM-DOUBLEGRAPHICS-1
CVS: src/af/gr/unix/gr_UnixGraphics.cpp
CVS: src/af/gr/unix/gr_UnixGraphics.h
CVS: src/af/gr/unix/gr_UnixImage.cpp src/af/gr/unix/gr_UnixImage.h
CVS: src/af/gr/win/gr_Win32Graphics.cpp
CVS: src/af/gr/win/gr_Win32Graphics.h
CVS: src/af/gr/win/gr_Win32USPGraphics.cpp
CVS: src/af/gr/win/gr_Win32USPGraphics.h src/af/gr/xp/gr_Caret.cpp
CVS: src/af/gr/xp/gr_Caret.h src/af/gr/xp/gr_DrawArgs.h
CVS: src/af/gr/xp/gr_Graphics.cpp src/af/gr/xp/gr_Graphics.h
CVS: src/af/gr/xp/gr_Image.cpp src/af/gr/xp/gr_Image.h
CVS: src/af/gr/xp/gr_Painter.cpp src/af/gr/xp/gr_Painter.h
CVS: src/af/gr/xp/gr_VectorImage.cpp src/af/gr/xp/gr_VectorImage.h
CVS: src/af/util/xp/ut_misc.cpp src/af/util/xp/ut_misc.h
CVS: src/af/util/xp/ut_svg.cpp src/af/util/xp/ut_svg.h
CVS: src/af/util/xp/ut_units.cpp src/af/util/xp/ut_units.h
CVS: src/af/xap/unix/xap_UnixFrameImpl.cpp
CVS: src/af/xap/unix/xap_UnixNullGraphics.cpp
CVS: src/af/xap/unix/xap_UnixNullGraphics.h
CVS: src/af/xap/unix/xap_UnixPSGraphics.cpp
CVS: src/af/xap/unix/xap_UnixPSGraphics.h
CVS: src/af/xap/unix/xap_UnixPSImage.cpp
CVS: src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.cpp
CVS: src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.h
CVS: src/af/xap/xp/xap_Dlg_FontChooser.cpp
CVS: src/af/xap/xp/xap_Dlg_FontChooser.h
CVS: src/af/xap/xp/xap_Draw_Symbol.cpp
CVS: src/af/xap/xp/xap_Draw_Symbol.h
CVS: src/af/xap/xp/xap_FontPreview.cpp
CVS: src/af/xap/xp/xap_FontPreview.h src/af/xap/xp/xap_Frame.cpp
CVS: src/af/xap/xp/xap_Preview_Zoom.cpp src/af/xap/xp/xav_View.cpp
CVS: src/af/xap/xp/xav_View.h src/text/fmt/xp/fb_Alignment.cpp
CVS: src/text/fmt/xp/fb_Alignment.h
CVS: src/text/fmt/xp/fb_ColumnBreaker.cpp
CVS: src/text/fmt/xp/fb_ColumnBreaker.h
CVS: src/text/fmt/xp/fb_LineBreaker.cpp
CVS: src/text/fmt/xp/fb_LineBreaker.h src/text/fmt/xp/fg_Graphic.h
CVS: src/text/fmt/xp/fg_GraphicRaster.cpp
CVS: src/text/fmt/xp/fg_GraphicRaster.h
CVS: src/text/fmt/xp/fg_GraphicVector.cpp
CVS: src/text/fmt/xp/fg_GraphicVector.h
CVS: src/text/fmt/xp/fl_BlockLayout.cpp
CVS: src/text/fmt/xp/fl_BlockLayout.h
CVS: src/text/fmt/xp/fl_DocLayout.cpp
CVS: src/text/fmt/xp/fl_DocLayout.h
CVS: src/text/fmt/xp/fl_FootnoteLayout.cpp
CVS: src/text/fmt/xp/fl_FrameLayout.cpp
CVS: src/text/fmt/xp/fl_FrameLayout.h
CVS: src/text/fmt/xp/fl_SectionLayout.cpp
CVS: src/text/fmt/xp/fl_SectionLayout.h
CVS: src/text/fmt/xp/fl_TOCLayout.cpp
CVS: src/text/fmt/xp/fl_TOCLayout.h
CVS: src/text/fmt/xp/fl_TableLayout.cpp
CVS: src/text/fmt/xp/fl_TableLayout.h src/text/fmt/xp/fp_Column.cpp
CVS: src/text/fmt/xp/fp_Column.h
CVS: src/text/fmt/xp/fp_ContainerObject.cpp
CVS: src/text/fmt/xp/fp_ContainerObject.h
CVS: src/text/fmt/xp/fp_DirectionMarkerRun.cpp
CVS: src/text/fmt/xp/fp_DirectionMarkerRun.h
CVS: src/text/fmt/xp/fp_FmtMarkRun.cpp
CVS: src/text/fmt/xp/fp_FootnoteContainer.cpp
CVS: src/text/fmt/xp/fp_FootnoteContainer.h
CVS: src/text/fmt/xp/fp_FrameContainer.cpp
CVS: src/text/fmt/xp/fp_FrameContainer.h
CVS: src/text/fmt/xp/fp_Line.cpp src/text/fmt/xp/fp_Line.h
CVS: src/text/fmt/xp/fp_Page.cpp src/text/fmt/xp/fp_Page.h
CVS: src/text/fmt/xp/fp_Run.cpp src/text/fmt/xp/fp_Run.h
CVS: src/text/fmt/xp/fp_TOCContainer.cpp
CVS: src/text/fmt/xp/fp_TOCContainer.h
CVS: src/text/fmt/xp/fp_TableContainer.cpp
CVS: src/text/fmt/xp/fp_TableContainer.h
CVS: src/text/fmt/xp/fp_TextRun.cpp src/text/fmt/xp/fp_TextRun.h
CVS: src/text/fmt/xp/fv_FrameEdit.cpp
CVS: src/text/fmt/xp/fv_FrameEdit.h src/text/fmt/xp/fv_View.cpp
CVS: src/text/fmt/xp/fv_View.h src/text/fmt/xp/fv_View_cmd.cpp
CVS: src/text/fmt/xp/fv_View_protected.cpp
CVS: src/text/fmt/xp/fv_VisualDragText.cpp
CVS: src/text/fmt/xp/fv_VisualDragText.h
CVS: src/text/ptbl/xp/pd_Document.h
CVS: src/text/ptbl/xp/pp_PropertyMap.h
CVS: src/wp/ap/unix/ap_UnixFrame.cpp src/wp/ap/unix/ap_UnixFrame.h
CVS: src/wp/ap/win/ap_Win32Frame.cpp src/wp/ap/win/ap_Win32Frame.h
CVS: src/wp/ap/xp/ap_Dialog_MergeCells.cpp
CVS: src/wp/ap/xp/ap_Dialog_SplitCells.cpp
CVS: src/wp/ap/xp/ap_EditMethods.cpp src/wp/ap/xp/ap_LeftRuler.cpp
CVS: src/wp/ap/xp/ap_LeftRuler.h src/wp/ap/xp/ap_TopRuler.cpp
CVS: src/wp/ap/xp/ap_TopRuler.h
CVS: src/wp/impexp/xp/ie_exp_RTF_listenerWriteDoc.cpp
CVS: ----------------------------------------------------------------------
Received on Tue Nov 23 23:12:09 2004

This archive was generated by hypermail 2.1.8 : Tue Nov 23 2004 - 23:12:09 CET