Reviewed some g* interface headers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -9,18 +9,16 @@
|
|||||||
/**
|
/**
|
||||||
@class wxGDIObject
|
@class wxGDIObject
|
||||||
|
|
||||||
This class allows platforms to implement functionality to optimise GDI objects,
|
This class allows platforms to implement functionality to optimise GDI
|
||||||
such
|
objects, such as wxPen, wxBrush and wxFont. On Windows, the underling GDI
|
||||||
as wxPen, wxBrush and wxFont. On Windows, the underling GDI objects are a
|
objects are a scarce resource and are cleaned up when a usage count goes to
|
||||||
scarce resource
|
zero. On some platforms this class may not have any special functionality.
|
||||||
and are cleaned up when a usage count goes to zero. On some platforms this
|
|
||||||
class may not have any special functionality.
|
|
||||||
|
|
||||||
Since the functionality of this class is platform-specific, it is not
|
Since the functionality of this class is platform-specific, it is not
|
||||||
documented here in detail.
|
documented here in detail.
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
|
|
||||||
@see wxPen, wxBrush, wxFont
|
@see wxPen, wxBrush, wxFont
|
||||||
*/
|
*/
|
||||||
@@ -32,4 +30,3 @@ public:
|
|||||||
*/
|
*/
|
||||||
wxGDIObject();
|
wxGDIObject();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: glcanvas.h
|
// Name: glcanvas.h
|
||||||
// Purpose: interface of wxGLContext
|
// Purpose: interface of wxGLContext and wxGLCanvas
|
||||||
// Author: wxWidgets team
|
// Author: wxWidgets team
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
@@ -9,30 +9,29 @@
|
|||||||
/**
|
/**
|
||||||
@class wxGLContext
|
@class wxGLContext
|
||||||
|
|
||||||
An instance of a wxGLContext represents the state of an OpenGL state machine
|
An instance of a wxGLContext represents the state of an OpenGL state
|
||||||
and the connection between OpenGL and the system.
|
machine and the connection between OpenGL and the system.
|
||||||
|
|
||||||
The OpenGL state includes everything that can be set with the OpenGL API:
|
The OpenGL state includes everything that can be set with the OpenGL API:
|
||||||
colors, rendering variables, display lists, texture objects, etc.
|
colors, rendering variables, display lists, texture objects, etc. Although
|
||||||
Although it is possible to have multiple rendering contexts share display lists
|
it is possible to have multiple rendering contexts share display lists in
|
||||||
in order to save resources,
|
order to save resources, this method is hardly used today any more, because
|
||||||
this method is hardly used today any more, because display lists are only a
|
display lists are only a tiny fraction of the overall state.
|
||||||
tiny fraction of the overall state.
|
|
||||||
|
|
||||||
Therefore, one rendering context is usually used with or bound to multiple
|
Therefore, one rendering context is usually used with or bound to multiple
|
||||||
output windows in turn,
|
output windows in turn, so that the application has access to the complete
|
||||||
so that the application has access to the complete and identical state while
|
and identical state while rendering into each window.
|
||||||
rendering into each window.
|
|
||||||
|
|
||||||
Binding (making current) a rendering context with another instance of a
|
Binding (making current) a rendering context with another instance of a
|
||||||
wxGLCanvas however works only
|
wxGLCanvas however works only if the other wxGLCanvas was created with the
|
||||||
if the other wxGLCanvas was created with the same attributes as the wxGLCanvas
|
same attributes as the wxGLCanvas from which the wxGLContext was
|
||||||
from which the wxGLContext
|
initialized. (This applies to sharing display lists among contexts
|
||||||
was initialized. (This applies to sharing display lists among contexts
|
|
||||||
analogously.)
|
analogously.)
|
||||||
|
|
||||||
Note that some wxGLContext features are extremely platform-specific - its best
|
Note that some wxGLContext features are extremely platform-specific - its
|
||||||
to check your native platform's glcanvas header (on windows include/wx/msw/glcanvas.h) to see what features your native platform provides.
|
best to check your native platform's glcanvas header (on windows
|
||||||
|
include/wx/msw/glcanvas.h) to see what features your native platform
|
||||||
|
provides.
|
||||||
|
|
||||||
@library{wxgl}
|
@library{wxgl}
|
||||||
@category{gl}
|
@category{gl}
|
||||||
@@ -46,36 +45,40 @@ public:
|
|||||||
Constructor.
|
Constructor.
|
||||||
|
|
||||||
@param win
|
@param win
|
||||||
The canvas that is used to initialize this context. This parameter is
|
The canvas that is used to initialize this context. This parameter
|
||||||
needed only temporarily,
|
is needed only temporarily, and the caller may do anything with it
|
||||||
and the caller may do anything with it (e.g. destroy the window) after the
|
(e.g. destroy the window) after the constructor returned. @n
|
||||||
constructor returned.
|
It will be possible to bind (make current) this context to any
|
||||||
It will be possible to bind (make current) this context to any other
|
other wxGLCanvas that has been created with equivalent attributes
|
||||||
wxGLCanvas that has been created
|
as win.
|
||||||
with equivalent attributes as win.
|
|
||||||
@param other
|
@param other
|
||||||
Context to share display lists with or @NULL (the default) for no sharing.
|
Context to share display lists with or @NULL (the default) for no
|
||||||
|
sharing.
|
||||||
*/
|
*/
|
||||||
wxGLContext(wxGLCanvas* win, const wxGLContext* other = NULL);
|
wxGLContext(wxGLCanvas* win, const wxGLContext* other = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Makes the OpenGL state that is represented by this rendering context current
|
Makes the OpenGL state that is represented by this rendering context
|
||||||
with the wxGLCanvas @e win.
|
current with the wxGLCanvas @e win.
|
||||||
Note that @a win can be a different wxGLCanvas window than the one that was
|
|
||||||
passed to the constructor of this rendering context.
|
@note @a win can be a different wxGLCanvas window than the one that was
|
||||||
If @e RC is an object of type wxGLContext, the statements @e
|
passed to the constructor of this rendering context. If @e RC is
|
||||||
RC.SetCurrent(win); and @e win.SetCurrent(RC); are equivalent,
|
an object of type wxGLContext, the statements
|
||||||
see wxGLCanvas::SetCurrent.
|
@e "RC.SetCurrent(win);" and @e "win.SetCurrent(RC);" are
|
||||||
|
equivalent, see wxGLCanvas::SetCurrent().
|
||||||
*/
|
*/
|
||||||
virtual bool SetCurrent(const wxGLCanvas& win) const;
|
virtual bool SetCurrent(const wxGLCanvas& win) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@anchor wxGL_FLAGS
|
||||||
|
|
||||||
Constants for use with wxGLCanvas.
|
Constants for use with wxGLCanvas.
|
||||||
|
|
||||||
Notice that not all implementation support options such as stereo,
|
@note Not all implementations support options such as stereo, auxiliary
|
||||||
auxiliary buffers, alpha channel, and accumulator buffer, use
|
buffers, alpha channel, and accumulator buffer, use
|
||||||
wxGLCanvas::IsDisplaySupported() to check for individual attributes support.
|
wxGLCanvas::IsDisplaySupported() to check for individual attributes
|
||||||
|
support.
|
||||||
*/
|
*/
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -139,36 +142,33 @@ enum
|
|||||||
@class wxGLCanvas
|
@class wxGLCanvas
|
||||||
|
|
||||||
wxGLCanvas is a class for displaying OpenGL graphics. It is always used in
|
wxGLCanvas is a class for displaying OpenGL graphics. It is always used in
|
||||||
conjunction with wxGLContext as the context can only be
|
conjunction with wxGLContext as the context can only be made current (i.e.
|
||||||
be made current (i.e. active for the OpenGL commands) when it is associated to
|
active for the OpenGL commands) when it is associated to a wxGLCanvas.
|
||||||
a wxGLCanvas.
|
|
||||||
|
|
||||||
More precisely, you first need to create a wxGLCanvas window and then create an
|
More precisely, you first need to create a wxGLCanvas window and then
|
||||||
instance of a wxGLContext that is initialized with this
|
create an instance of a wxGLContext that is initialized with this
|
||||||
wxGLCanvas and then later use either wxGLCanvas::SetCurrent
|
wxGLCanvas and then later use either SetCurrent() with the instance of the
|
||||||
with the instance of the wxGLContext or
|
wxGLContext or wxGLContext::SetCurrent() with the instance of the
|
||||||
wxGLContext::SetCurrent with the instance of
|
wxGLCanvas (which might be not the same as was used for the creation of the
|
||||||
the wxGLCanvas (which might be not the same as was used
|
context) to bind the OpenGL state that is represented by the rendering
|
||||||
for the creation of the context) to bind the OpenGL state that is represented
|
context to the canvas, and then finally call SwapBuffers() to swap the
|
||||||
by the rendering context to the canvas, and then finally call
|
buffers of the OpenGL canvas and thus show your current output.
|
||||||
wxGLCanvas::SwapBuffers to swap the buffers of
|
|
||||||
the OpenGL canvas and thus show your current output.
|
|
||||||
|
|
||||||
Notice that previous versions of wxWidgets used to implicitly create a
|
Notice that previous versions of wxWidgets used to implicitly create a
|
||||||
wxGLContext inside wxGLCanvas itself. This is still supported in the current
|
wxGLContext inside wxGLCanvas itself. This is still supported in the
|
||||||
version but is deprecated now and will be removed in the future, please update
|
current version but is deprecated now and will be removed in the future,
|
||||||
your code to create the rendering contexts explicitly.
|
please update your code to create the rendering contexts explicitly.
|
||||||
|
|
||||||
To set up the attributes for the canvas (number of bits for the depth buffer,
|
To set up the attributes for the canvas (number of bits for the depth
|
||||||
number of bits for the stencil buffer and so on) you should set up the correct
|
buffer, number of bits for the stencil buffer and so on) you should set up
|
||||||
values of
|
the correct values of the @e attribList parameter. The values that should
|
||||||
the @e attribList parameter. The values that should be set up and their
|
be set up and their meanings will be described below.
|
||||||
meanings will be described below.
|
|
||||||
|
|
||||||
Notice that OpenGL is not enabled by default. To switch it on, you need to edit
|
@note OpenGL is not enabled by default. To switch it on, you need to edit
|
||||||
setup.h under Windows and set @c wxUSE_GLCANVAS to 1 (you may also need
|
setup.h under Windows and set @c wxUSE_GLCANVAS to 1 (you may also
|
||||||
to have to add @c opengl32.lib and @c glu32.lib to the list of libraries
|
need to have to add @c opengl32.lib and @c glu32.lib to the list of
|
||||||
your program is linked with). On Unix, pass @c --with-opengl to configure.
|
libraries your program is linked with). On Unix, pass
|
||||||
|
@c --with-opengl to configure.
|
||||||
|
|
||||||
@library{wxgl}
|
@library{wxgl}
|
||||||
@category{gl}
|
@category{gl}
|
||||||
@@ -179,24 +179,24 @@ class wxGLCanvas : public wxWindow
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Creates a window with the given parameters. Notice that you need to create and
|
Creates a window with the given parameters. Notice that you need to
|
||||||
use a wxGLContext to output to this window.
|
create and use a wxGLContext to output to this window.
|
||||||
If
|
|
||||||
|
|
||||||
@param attribList is not specified, double buffered RGBA mode is used.
|
If @a attribList is not specified, double buffered RGBA mode is used.
|
||||||
|
|
||||||
parent
|
@param parent
|
||||||
Pointer to a parent window.
|
Pointer to a parent window.
|
||||||
@param id
|
@param id
|
||||||
Window identifier. If -1, will automatically create an identifier.
|
Window identifier. If -1, will automatically create an identifier.
|
||||||
@param pos
|
@param pos
|
||||||
Window position. wxDefaultPosition is (-1, -1) which indicates that
|
Window position. wxDefaultPosition is (-1, -1) which indicates that
|
||||||
wxWidgets
|
wxWidgets should generate a default position for the window.
|
||||||
should generate a default position for the window.
|
|
||||||
@param size
|
@param size
|
||||||
Window size. wxDefaultSize is (-1, -1) which indicates that wxWidgets should
|
Window size. wxDefaultSize is (-1, -1) which indicates that
|
||||||
generate a default size for the window. If no suitable size can be found,
|
wxWidgets should generate a default size for the window. If no
|
||||||
the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized.
|
suitable size can be found, the window will be sized to 20x20
|
||||||
|
pixels so that the window is visible but obviously not correctly
|
||||||
|
sized.
|
||||||
@param style
|
@param style
|
||||||
Window style.
|
Window style.
|
||||||
@param name
|
@param name
|
||||||
@@ -204,24 +204,24 @@ public:
|
|||||||
@param attribList
|
@param attribList
|
||||||
Array of integers. With this parameter you can set the device
|
Array of integers. With this parameter you can set the device
|
||||||
context attributes associated to this window. This array is
|
context attributes associated to this window. This array is
|
||||||
zero-terminated: it should be set up with constants described in
|
zero-terminated: it should be set up using @ref wxGL_FLAGS
|
||||||
the table above. If a constant should be followed by a value, put
|
constants. If a constant should be followed by a value, put it in
|
||||||
it in the next array position. For example, the WX_GL_DEPTH_SIZE
|
the next array position. For example, WX_GL_DEPTH_SIZE should be
|
||||||
should be followed by the value that indicates the number of bits
|
followed by the value that indicates the number of bits for the
|
||||||
for the depth buffer, e.g:
|
depth buffer, e.g:
|
||||||
@code
|
@code
|
||||||
attribList[n++] = WX_GL_DEPTH_SIZE;
|
attribList[n++] = WX_GL_DEPTH_SIZE;
|
||||||
attribList[n++] = 32;
|
attribList[n++] = 32;
|
||||||
attribList[n] = 0; // terminate the list
|
attribList[n] = 0; // terminate the list
|
||||||
@endcode
|
@endcode
|
||||||
If the attribute list is not specified at all, i.e. if this
|
If the attribute list is not specified at all, i.e. if this
|
||||||
parameter is @NULL, the default attributes including @c WX_GL_RGBA
|
parameter is @NULL, the default attributes including WX_GL_RGBA and
|
||||||
and @c WX_GL_DOUBLEBUFFER are used. But notice that if you do
|
WX_GL_DOUBLEBUFFER are used. But notice that if you do specify some
|
||||||
specify some attributes you also need to explicitly include these
|
attributes you also need to explicitly include these two default
|
||||||
two default attributes in the list if you need them.
|
attributes in the list if you need them.
|
||||||
@param palette
|
@param palette
|
||||||
Palette for indexed colour (i.e. non WX_GL_RGBA) mode.
|
Palette for indexed colour (i.e. non WX_GL_RGBA) mode. Ignored
|
||||||
Ignored under most platforms.
|
under most platforms.
|
||||||
*/
|
*/
|
||||||
wxGLCanvas(wxWindow* parent, wxWindowID id = wxID_ANY,
|
wxGLCanvas(wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const int* attribList = NULL,
|
const int* attribList = NULL,
|
||||||
@@ -233,37 +233,42 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Determines if a canvas having the specified attributes is available.
|
Determines if a canvas having the specified attributes is available.
|
||||||
Returns @true if attributes are supported.
|
|
||||||
|
|
||||||
@param attribList
|
@param attribList
|
||||||
See attribList for wxGLCanvas().
|
See @a attribList for wxGLCanvas().
|
||||||
|
|
||||||
|
@return @true if attributes are supported.
|
||||||
*/
|
*/
|
||||||
static bool IsDisplaySupported(const int* attribList = NULL);
|
static bool IsDisplaySupported(const int* attribList = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the current colour for this window (using @c glcolor3f()), using the
|
Sets the current colour for this window (using @c glcolor3f()), using
|
||||||
wxWidgets colour database to find a named colour.
|
the wxWidgets colour database to find a named colour.
|
||||||
*/
|
*/
|
||||||
bool SetColour(const wxString& colour);
|
bool SetColour(const wxString& colour);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Makes the OpenGL state that is represented by the OpenGL rendering context
|
Makes the OpenGL state that is represented by the OpenGL rendering
|
||||||
@a context current, i.e. it will be used by all subsequent OpenGL calls.
|
context @a context current, i.e. it will be used by all subsequent
|
||||||
This is equivalent to wxGLContext::SetCurrent
|
OpenGL calls.
|
||||||
called with this window as parameter.
|
|
||||||
Note that this function may only be called when the window is shown on screen,
|
This is equivalent to wxGLContext::SetCurrent() called with this window
|
||||||
in particular it can't usually be called from the constructor as the window
|
as parameter.
|
||||||
isn't yet shown at this moment.
|
|
||||||
Returns @false if an error occurred.
|
@note This function may only be called when the window is shown on
|
||||||
|
screen, in particular it can't usually be called from the
|
||||||
|
constructor as the window isn't yet shown at this moment.
|
||||||
|
|
||||||
|
@return @false if an error occurred.
|
||||||
*/
|
*/
|
||||||
bool SetCurrent(const wxGLContext context);
|
bool SetCurrent(const wxGLContext context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Swaps the double-buffer of this window, making the back-buffer the front-buffer
|
Swaps the double-buffer of this window, making the back-buffer the
|
||||||
and vice versa,
|
front-buffer and vice versa, so that the output of the previous OpenGL
|
||||||
so that the output of the previous OpenGL commands is displayed on the window.
|
commands is displayed on the window.
|
||||||
Returns @false if an error occurred.
|
|
||||||
|
@return @false if an error occurred.
|
||||||
*/
|
*/
|
||||||
virtual bool SwapBuffers();
|
virtual bool SwapBuffers();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -9,67 +9,74 @@
|
|||||||
/**
|
/**
|
||||||
@class wxGraphicsPath
|
@class wxGraphicsPath
|
||||||
|
|
||||||
A wxGraphicsPath is a native representation of an geometric path. The contents
|
A wxGraphicsPath is a native representation of a geometric path. The
|
||||||
are specific an private to the respective renderer. Instances are ref counted and can
|
contents are specific an private to the respective renderer. Instances are
|
||||||
therefore be assigned as usual. The only way to get a valid instance is via
|
reference counted and can therefore be assigned as usual. The only way to
|
||||||
wxGraphicsContext::CreatePath or wxGraphicsRenderer::CreatePath.
|
get a valid instance is by using wxGraphicsContext::CreatePath() or
|
||||||
|
wxGraphicsRenderer::CreatePath().
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
*/
|
*/
|
||||||
class wxGraphicsPath : public wxGraphicsObject
|
class wxGraphicsPath : public wxGraphicsObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
|
Adds an arc of a circle centering at (@a x,@a y) with radius (@a r)
|
||||||
|
from @a startAngle to @a endAngle.
|
||||||
|
*/
|
||||||
|
virtual void AddArc(wxDouble x, wxDouble y, wxDouble r,
|
||||||
|
wxDouble startAngle, wxDouble endAngle,
|
||||||
|
bool clockwise);
|
||||||
|
/**
|
||||||
|
Adds an arc of a circle centering at @a c with radius (@a r)
|
||||||
|
from @a startAngle to @a endAngle.
|
||||||
*/
|
*/
|
||||||
void AddArc(wxDouble x, wxDouble y, wxDouble r,
|
|
||||||
wxDouble startAngle,
|
|
||||||
wxDouble endAngle, bool clockwise);
|
|
||||||
void AddArc(const wxPoint2DDouble& c, wxDouble r,
|
void AddArc(const wxPoint2DDouble& c, wxDouble r,
|
||||||
wxDouble startAngle,
|
wxDouble startAngle, wxDouble endAngle, bool clockwise);
|
||||||
wxDouble endAngle,
|
|
||||||
bool clockwise);
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to
|
Appends a an arc to two tangents connecting (current) to (@a x1,@a y1)
|
||||||
(x2,y2), also a straight line from (current) to (x1,y1).
|
and (@a x1,@a y1) to (@a x2,@a y2), also a straight line from (current)
|
||||||
|
to (@a x1,@a y1).
|
||||||
*/
|
*/
|
||||||
virtual void AddArcToPoint(wxDouble x1, wxDouble y1, wxDouble x2,
|
virtual void AddArcToPoint(wxDouble x1, wxDouble y1, wxDouble x2,
|
||||||
wxDouble y2, wxDouble r);
|
wxDouble y2, wxDouble r);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Appends a circle around (x,y) with radius r as a new closed subpath.
|
Appends a circle around (@a x,@a y) with radius @a r as a new closed
|
||||||
|
subpath.
|
||||||
*/
|
*/
|
||||||
virtual void AddCircle(wxDouble x, wxDouble y, wxDouble r);
|
virtual void AddCircle(wxDouble x, wxDouble y, wxDouble r);
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
|
Adds a cubic bezier curve from the current point, using two control
|
||||||
|
points and an end point.
|
||||||
|
*/
|
||||||
|
void AddCurveToPoint(wxDouble cx1, wxDouble cy1,
|
||||||
|
wxDouble cx2, wxDouble cy2,
|
||||||
|
wxDouble x, wxDouble y);
|
||||||
|
/**
|
||||||
|
Adds a cubic bezier curve from the current point, using two control
|
||||||
|
points and an end point.
|
||||||
*/
|
*/
|
||||||
void AddCurveToPoint(wxDouble cx1, wxDouble cy1, wxDouble cx2,
|
|
||||||
wxDouble cy2,
|
|
||||||
wxDouble x,
|
|
||||||
wxDouble y);
|
|
||||||
void AddCurveToPoint(const wxPoint2DDouble& c1,
|
void AddCurveToPoint(const wxPoint2DDouble& c1,
|
||||||
const wxPoint2DDouble& c2,
|
const wxPoint2DDouble& c2,
|
||||||
const wxPoint2DDouble& e);
|
const wxPoint2DDouble& e);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Appends an ellipse fitting into the passed in rectangle.
|
Appends an ellipse fitting into the passed in rectangle.
|
||||||
*/
|
*/
|
||||||
virtual void AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
|
virtual void AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
|
Adds a straight line from the current point to (@a x,@a y).
|
||||||
|
*/
|
||||||
|
virtual void AddLineToPoint(wxDouble x, wxDouble y);
|
||||||
|
/**
|
||||||
|
Adds a straight line from the current point to @a p.
|
||||||
*/
|
*/
|
||||||
void AddLineToPoint(wxDouble x, wxDouble y);
|
|
||||||
void AddLineToPoint(const wxPoint2DDouble& p);
|
void AddLineToPoint(const wxPoint2DDouble& p);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adds another path.
|
Adds another path.
|
||||||
@@ -77,11 +84,11 @@ public:
|
|||||||
virtual void AddPath(const wxGraphicsPath& path);
|
virtual void AddPath(const wxGraphicsPath& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adds a quadratic Bezier curve from the current point, using a control point and
|
Adds a quadratic bezier curve from the current point, using a control
|
||||||
an end point.
|
point and an end point.
|
||||||
*/
|
*/
|
||||||
virtual void AddQuadCurveToPoint(wxDouble cx, wxDouble cy, wxDouble x,
|
virtual void AddQuadCurveToPoint(wxDouble cx, wxDouble cy,
|
||||||
wxDouble y);
|
wxDouble x, wxDouble y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Appends a rectangle as a new closed subpath.
|
Appends a rectangle as a new closed subpath.
|
||||||
@@ -99,46 +106,52 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void CloseSubpath();
|
virtual void CloseSubpath();
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Returns @true if the point is within the path.
|
@return @true if the point is within the path.
|
||||||
*/
|
*/
|
||||||
bool Contains(const wxPoint2DDouble& c,
|
bool Contains(const wxPoint2DDouble& c,
|
||||||
int fillStyle = wxODDEVEN_RULE) const;
|
int fillStyle = wxODDEVEN_RULE) const;
|
||||||
const bool Contains(wxDouble x, wxDouble y,
|
|
||||||
int fillStyle = wxODDEVEN_RULE) const;
|
|
||||||
//@}
|
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Gets the bounding box enclosing all points (possibly including control points).
|
@return @true if the point is within the path.
|
||||||
|
*/
|
||||||
|
virtual bool Contains(wxDouble x, wxDouble y,
|
||||||
|
int fillStyle = wxODDEVEN_RULE) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Gets the bounding box enclosing all points (possibly including control
|
||||||
|
points).
|
||||||
*/
|
*/
|
||||||
wxRect2DDouble GetBox() const;
|
wxRect2DDouble GetBox() const;
|
||||||
const void GetBox(wxDouble* x, wxDouble* y, wxDouble* w,
|
/**
|
||||||
wxDouble* h) const;
|
Gets the bounding box enclosing all points (possibly including control
|
||||||
//@}
|
points).
|
||||||
|
*/
|
||||||
|
virtual void GetBox(wxDouble* x, wxDouble* y,
|
||||||
|
wxDouble* w, wxDouble* h) const;
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Gets the last point of the current path, (0,0) if not yet set.
|
Gets the last point of the current path, (0,0) if not yet set.
|
||||||
*/
|
*/
|
||||||
void GetCurrentPoint(wxDouble* x, wxDouble* y) const;
|
virtual void GetCurrentPoint(wxDouble* x, wxDouble* y) const;
|
||||||
const wxPoint2DDouble GetCurrentPoint() const;
|
/**
|
||||||
//@}
|
Gets the last point of the current path, (0,0) if not yet set.
|
||||||
|
*/
|
||||||
|
wxPoint2DDouble GetCurrentPoint() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the native path (CGPathRef for Core Graphics, Path pointer for GDIPlus
|
Returns the native path (CGPathRef for Core Graphics, Path pointer for
|
||||||
and a cairo_path_t pointer for cairo).
|
GDIPlus and a cairo_path_t pointer for cairo).
|
||||||
*/
|
*/
|
||||||
virtual void* GetNativePath() const;
|
virtual void* GetNativePath() const;
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Begins a new subpath at (x,y)
|
Begins a new subpath at (@a x,@a y).
|
||||||
|
*/
|
||||||
|
virtual void MoveToPoint(wxDouble x, wxDouble y);
|
||||||
|
/**
|
||||||
|
Begins a new subpath at @a p.
|
||||||
*/
|
*/
|
||||||
void MoveToPoint(wxDouble x, wxDouble y);
|
|
||||||
void MoveToPoint(const wxPoint2DDouble& p);
|
void MoveToPoint(const wxPoint2DDouble& p);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Transforms each point of this path by the matrix.
|
Transforms each point of this path by the matrix.
|
||||||
@@ -146,9 +159,9 @@ public:
|
|||||||
virtual void Transform(const wxGraphicsMatrix& matrix);
|
virtual void Transform(const wxGraphicsMatrix& matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gives back the native path returned by GetNativePath() because there might be
|
Gives back the native path returned by GetNativePath() because there
|
||||||
some deallocations necessary (eg on cairo the native path returned by
|
might be some deallocations necessary (e.g. on cairo the native path
|
||||||
GetNativePath is newly allocated each time).
|
returned by GetNativePath() is newly allocated each time).
|
||||||
*/
|
*/
|
||||||
virtual void UnGetNativePath(void* p) const;
|
virtual void UnGetNativePath(void* p) const;
|
||||||
};
|
};
|
||||||
@@ -162,7 +175,7 @@ public:
|
|||||||
allows reference counting. Not instantiated by user code.
|
allows reference counting. Not instantiated by user code.
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{FIXME}
|
@category{gdi}
|
||||||
|
|
||||||
@see wxGraphicsBrush, wxGraphicsPen, wxGraphicsMatrix, wxGraphicsPath
|
@see wxGraphicsBrush, wxGraphicsPen, wxGraphicsMatrix, wxGraphicsPath
|
||||||
*/
|
*/
|
||||||
@@ -170,13 +183,13 @@ class wxGraphicsObject : public wxObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Returns the renderer that was used to create this instance, or @NULL if it has
|
Returns the renderer that was used to create this instance, or @NULL
|
||||||
not been initialized yet
|
if it has not been initialized yet.
|
||||||
*/
|
*/
|
||||||
wxGraphicsRenderer* GetRenderer() const;
|
wxGraphicsRenderer* GetRenderer() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Is this object valid (@false) or still empty (@true)?
|
@return @false if this object is valid, otherwise returns @true.
|
||||||
*/
|
*/
|
||||||
bool IsNull() const;
|
bool IsNull() const;
|
||||||
};
|
};
|
||||||
@@ -196,10 +209,10 @@ public:
|
|||||||
{
|
{
|
||||||
// Create paint DC
|
// Create paint DC
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
// Create graphics context from it
|
// Create graphics context from it
|
||||||
wxGraphicsContext *gc = wxGraphicsContext::Create( dc );
|
wxGraphicsContext *gc = wxGraphicsContext::Create( dc );
|
||||||
|
|
||||||
if (gc)
|
if (gc)
|
||||||
{
|
{
|
||||||
// make a path that contains a circle and some lines
|
// make a path that contains a circle and some lines
|
||||||
@@ -212,9 +225,9 @@ public:
|
|||||||
path.AddLineToPoint(50.0, 100.0 );
|
path.AddLineToPoint(50.0, 100.0 );
|
||||||
path.CloseSubpath();
|
path.CloseSubpath();
|
||||||
path.AddRectangle(25.0, 25.0, 50.0, 50.0);
|
path.AddRectangle(25.0, 25.0, 50.0, 50.0);
|
||||||
|
|
||||||
gc->StrokePath(path);
|
gc->StrokePath(path);
|
||||||
|
|
||||||
delete gc;
|
delete gc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,7 +235,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@category{FIXME}
|
@category{gdi,dc}
|
||||||
|
|
||||||
@see wxGraphicsRenderer::CreateContext(), wxGCDC, wxDC
|
@see wxGraphicsRenderer::CreateContext(), wxGCDC, wxDC
|
||||||
*/
|
*/
|
||||||
@@ -235,21 +248,21 @@ public:
|
|||||||
@see wxGraphicsRenderer::CreateContext()
|
@see wxGraphicsRenderer::CreateContext()
|
||||||
*/
|
*/
|
||||||
static wxGraphicsContext* Create( wxWindow* window ) ;
|
static wxGraphicsContext* Create( wxWindow* window ) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxWindowDC
|
Creates a wxGraphicsContext from a wxWindowDC
|
||||||
|
|
||||||
@see wxGraphicsRenderer::CreateContext()
|
@see wxGraphicsRenderer::CreateContext()
|
||||||
*/
|
*/
|
||||||
static wxGraphicsContext* Create( const wxWindowDC& dc) ;
|
static wxGraphicsContext* Create( const wxWindowDC& dc) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxMemoryDC
|
Creates a wxGraphicsContext from a wxMemoryDC
|
||||||
|
|
||||||
@see wxGraphicsRenderer::CreateContext()
|
@see wxGraphicsRenderer::CreateContext()
|
||||||
*/
|
*/
|
||||||
static wxGraphicsContext * Create( const wxMemoryDC& dc) ;
|
static wxGraphicsContext * Create( const wxMemoryDC& dc) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxPrinterDC. Under
|
Creates a wxGraphicsContext from a wxPrinterDC. Under
|
||||||
GTK+, this will only work when using the GtkPrint
|
GTK+, this will only work when using the GtkPrint
|
||||||
@@ -527,17 +540,17 @@ public:
|
|||||||
Creates a wxGraphicsContext from a wxWindow.
|
Creates a wxGraphicsContext from a wxWindow.
|
||||||
*/
|
*/
|
||||||
virtual wxGraphicsContext* CreateContext(wxWindow* window) = 0;
|
virtual wxGraphicsContext* CreateContext(wxWindow* window) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxWindowDC
|
Creates a wxGraphicsContext from a wxWindowDC
|
||||||
*/
|
*/
|
||||||
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ;
|
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxMemoryDC
|
Creates a wxGraphicsContext from a wxMemoryDC
|
||||||
*/
|
*/
|
||||||
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ;
|
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a wxGraphicsContext from a wxPrinterDC
|
Creates a wxGraphicsContext from a wxPrinterDC
|
||||||
*/
|
*/
|
||||||
@@ -756,4 +769,3 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Translate(wxDouble dx, wxDouble dy);
|
virtual void Translate(wxDouble dx, wxDouble dy);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user