History log of /haiku-fatelf/src/kits/interface/Shape.cpp
Revision Date Author Comments
# 08f914dc 26-Dec-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix CID-8112 & -8113 (strange pointer arithmetic)
* BShape:: AddShape(): drop manual multiplication in typed pointer
arithmetic - addding the number of elements to a typed pointer
will already move that pointer in steps of sizeof(type).
The effect of this bug would be overwritten memory somewhere behind the data array.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39951 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00873f78 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Added BShape::CurrentPoint(), returning the current end point of the path.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35908 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76ab3f88 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Basically, this changeset implements BShape::ArcTo(). In more detail:
* Added BShape::ArcTo() and BShapeIterator::IterateArcTo(), using a previously
unused virtual slot. (Added the symbols for binary compatibility for GCC2
and GCC4.)
* Added operator=(), operator==() and operator!=() to BShape.
* Added BShape::BezierTo() version taking three points, which is sometimes
more convenient.
* Added the four new shape data ops OP_LARGE_ARC_TO_CW, OP_LARGE_ARC_TO_CCW,
OP_SMALL_ARC_TO_CW and OP_SMALL_ARC_TO_CCW. For a single arc, provided the
radius is large enough, there are four possibilities to draw the arc, these
are controlled by the two boolean flags to ArcTo() and mapped to the new
commands accordingly.
* Some style cleanup in Shape.cpp (sorry for mixing it up, but it gets
worse below...)
* Added ShapeTest to src/tests/servers/app.
* Changed the way BShapes are transformed from view to screen space in the
app_server. For arcs, it would be nontrivial to apply a proper transformation,
it's much easier to let AGG take care of it. This affects ServerPicture as
well.
* Wrapped iterating the BShape into try/catch blocks in ShapeIterator. But
I really don't understand the purpose of the class in the first place.
Maybe it can now be dropped, since coordinates don't have to be transformed
in place anymore.
* Refactored copy&paste shape iteration code in Painter. The transformation
to screen space happens there.
* Since RemoteDrawingEngine needed to be adopted anyway, I also updated
it for the new DrawString() with offsets version. But the client still needs
to be adapted.
* Style cleanup in Painter.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35905 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f591e3a0 17-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* fix weird Shape op/point allocation
* handle out of memory situations
* don't try to copy (and assign op!) in SetData if opCount/ptCount is 0
-> FontDemo doesn't crash anymore eventually when cycling fonts in outline
mode


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22000 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b0ecfab 01-Mar-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Added "const" to many parameters.
Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates.
Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized.
Removed some function call overhead.
Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter,


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20292 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f9eca85 30-Oct-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

moved Shape related defines to their own header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fdedfbd 21-Apr-2006 Jérôme Duval <korli@users.berlios.de>

fixed some Archive() following stippi's path


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 805cb76e 05-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Added several R4.5 compatibility exports - they are now only compiled when GCC
2.95 is used.
* Added empty _klock_node_() syscall for compatibility - all R5 syscalls are now
also only compiled with GCC 2.95.
* This should fix bug #403.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17011 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec56c2c1 04-Feb-2006 Michael Lotz <mmlr@mlotz.ch>

Fixed and cleaned up BShape and BShapeIterator. They should now work and behave like the R5 version.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16230 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b5f439b6 06-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

seems like the BShape implementation was never tested, this update brings it into working condition, but the code could use more refactoring... duplication all over the place

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14734 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2da902f 01-Apr-2005 Michael Lotz <mmlr@mlotz.ch>

Implemented BPortLink::AttachShape and BPortLink::ReadShape and used them for passing the shapes in AS_GET_GLYPH_SHAPES.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12215 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca187707 28-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Forgot to turn off mangling, thanks to Marcus for pointing this out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84591cff 27-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Began exporting of R4.5 compatibility functions, just as an example.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c4f452b 20-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixed some allocation bugs, and a play bug


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3584 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b7fdea42 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

*** empty log message ***


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3540 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67105bd6 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30fd5147 14-May-2003 haydentech <haydentech@nowhere.fake>

Minor header-related changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3246 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e1d7ae79 14-May-2003 haydentech <haydentech@nowhere.fake>

Conform to new scoping rules for variables defined in a for loop


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3245 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4045c229 06-Feb-2003 Marc Flerackers <mflerackers@nowhere.fake>

Initial checkin


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2639 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f914dc676137720fa83b6621d16d01ddd463ca 26-Dec-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix CID-8112 & -8113 (strange pointer arithmetic)
* BShape:: AddShape(): drop manual multiplication in typed pointer
arithmetic - addding the number of elements to a typed pointer
will already move that pointer in steps of sizeof(type).
The effect of this bug would be overwritten memory somewhere behind the data array.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39951 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00873f781865e715519570b3a002aa5ac06efc75 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Added BShape::CurrentPoint(), returning the current end point of the path.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35908 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76ab3f88df26cbb595ca663798c7d84f9758c7c4 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Basically, this changeset implements BShape::ArcTo(). In more detail:
* Added BShape::ArcTo() and BShapeIterator::IterateArcTo(), using a previously
unused virtual slot. (Added the symbols for binary compatibility for GCC2
and GCC4.)
* Added operator=(), operator==() and operator!=() to BShape.
* Added BShape::BezierTo() version taking three points, which is sometimes
more convenient.
* Added the four new shape data ops OP_LARGE_ARC_TO_CW, OP_LARGE_ARC_TO_CCW,
OP_SMALL_ARC_TO_CW and OP_SMALL_ARC_TO_CCW. For a single arc, provided the
radius is large enough, there are four possibilities to draw the arc, these
are controlled by the two boolean flags to ArcTo() and mapped to the new
commands accordingly.
* Some style cleanup in Shape.cpp (sorry for mixing it up, but it gets
worse below...)
* Added ShapeTest to src/tests/servers/app.
* Changed the way BShapes are transformed from view to screen space in the
app_server. For arcs, it would be nontrivial to apply a proper transformation,
it's much easier to let AGG take care of it. This affects ServerPicture as
well.
* Wrapped iterating the BShape into try/catch blocks in ShapeIterator. But
I really don't understand the purpose of the class in the first place.
Maybe it can now be dropped, since coordinates don't have to be transformed
in place anymore.
* Refactored copy&paste shape iteration code in Painter. The transformation
to screen space happens there.
* Since RemoteDrawingEngine needed to be adopted anyway, I also updated
it for the new DrawString() with offsets version. But the client still needs
to be adapted.
* Style cleanup in Painter.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35905 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f591e3a0f272539a6e6176ad609922a261eff587 17-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* fix weird Shape op/point allocation
* handle out of memory situations
* don't try to copy (and assign op!) in SetData if opCount/ptCount is 0
-> FontDemo doesn't crash anymore eventually when cycling fonts in outline
mode


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22000 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b0ecfab9004dab03fc2cdc6b0d1bc01fd4336af 01-Mar-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Added "const" to many parameters.
Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates.
Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized.
Removed some function call overhead.
Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter,


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20292 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f9eca855a65581e353ad28a0d71b4f48893ac01 30-Oct-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

moved Shape related defines to their own header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fdedfbde40258f52c2778d1ca87131b6635fb5d 21-Apr-2006 Jérôme Duval <korli@users.berlios.de>

fixed some Archive() following stippi's path


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 805cb76ed8e50f1ae3fd6990a8a6f3d0936be89b 05-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Added several R4.5 compatibility exports - they are now only compiled when GCC
2.95 is used.
* Added empty _klock_node_() syscall for compatibility - all R5 syscalls are now
also only compiled with GCC 2.95.
* This should fix bug #403.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17011 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec56c2c1dc70c9e7198505c8eae93f223099bc36 04-Feb-2006 Michael Lotz <mmlr@mlotz.ch>

Fixed and cleaned up BShape and BShapeIterator. They should now work and behave like the R5 version.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16230 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b5f439b6687d692266659487864f9ba0eeda52ae 06-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

seems like the BShape implementation was never tested, this update brings it into working condition, but the code could use more refactoring... duplication all over the place

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14734 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2da902f2e4736f49ce04a47d9db03bd81b70a57 01-Apr-2005 Michael Lotz <mmlr@mlotz.ch>

Implemented BPortLink::AttachShape and BPortLink::ReadShape and used them for passing the shapes in AS_GET_GLYPH_SHAPES.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12215 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca187707649353261281d97d3101a89c2e4cb13e 28-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Forgot to turn off mangling, thanks to Marcus for pointing this out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84591cffe14d8d6263f55739c04695164f2545dc 27-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Began exporting of R4.5 compatibility functions, just as an example.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c4f452b0c218b2fd38399bbebc0c44acf91fa2c 20-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixed some allocation bugs, and a play bug


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3584 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b7fdea42f4e4e65422e5dda2954577c963b1a97b 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

*** empty log message ***


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3540 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67105bd61c1116e4013d8509943509f6a7cf4072 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30fd51473f390b92d40b3a3c83b25e2d4a042f08 14-May-2003 haydentech <haydentech@nowhere.fake>

Minor header-related changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3246 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e1d7ae79b29588b2170bf1824e42e79b65b7edbf 14-May-2003 haydentech <haydentech@nowhere.fake>

Conform to new scoping rules for variables defined in a for loop


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3245 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4045c2293989406d1204dc63db92148510362048 06-Feb-2003 Marc Flerackers <mflerackers@nowhere.fake>

Initial checkin


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2639 a95241bf-73f2-0310-859d-f6bbb57e9c96