public:
wxCanvasObject( int x, int y, int width, int height );
+ // These are for screen output only therefore use
+ // int as coordinates.
virtual void Move( int x, int y );
virtual bool IsHit( int x, int y, int margin = 0 );
-
virtual void Render( int clip_x, int clip_y, int clip_width, int clip_height );
+
+ // Once we have world coordinates in doubles, this will get
+ // called for every object if the world coordinate system
+ // changes (zooming).
+ virtual void Rerender();
+
+ // Later...
virtual void WriteSVG( wxTextOutputStream &stream );
wxCanvas *GetOwner() { return m_owner; }
wxImage *GetBuffer() { return &m_buffer; }
bool NeedUpdate() { return m_needUpdate; }
+ bool IsFrozen() { return m_frozen; }
void BlitBuffer( wxDC &dc );
bool m_frozen;
wxCanvasObject *m_lastMouse;
-
friend class wxCanvasObject;
private:
#include "wx/gtk/win_gtk.h"
#endif
-#define USE_FREETYPE 1
+#ifndef wxUSE_FREETYPE
+ #define wxUSE_FREETYPE 1
+#endif
-#if USE_FREETYPE
-#include <freetype/freetype.h>
+#if wxUSE_FREETYPE
+ #include <freetype/freetype.h>
#endif
//----------------------------------------------------------------------------
// globals
//----------------------------------------------------------------------------
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
FT_Library g_freetypeLibrary;
#endif
(y <= m_area.y+m_area.height+margin));
}
-void wxCanvasObject::WriteSVG( wxTextOutputStream &stream )
+void wxCanvasObject::Render( int clip_x, int clip_y, int clip_width, int clip_height )
{
}
-void wxCanvasObject::Render( int clip_x, int clip_y, int clip_width, int clip_height )
+void wxCanvasObject::Rerender()
+{
+}
+
+void wxCanvasObject::WriteSVG( wxTextOutputStream &stream )
{
}
void wxCanvasLine::WriteSVG( wxTextOutputStream &stream )
{
+ // no idea
}
//----------------------------------------------------------------------------
class wxFaceData
{
public:
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
FT_Face m_face;
#else
void *m_dummy;
m_alpha = new unsigned char[100*m_size];
memset( m_alpha, 0, m_area.width*m_area.height );
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
wxFaceData *data = new wxFaceData;
m_faceData = data;
wxCanvasText::~wxCanvasText()
{
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
wxFaceData *data = (wxFaceData*) m_faceData;
delete data;
#endif
void wxCanvasText::CreateBuffer()
{
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
FT_Face face = ((wxFaceData*)m_faceData)->m_face;
FT_GlyphSlot slot = face->glyph;
int pen_x = 0;
{
wxMouseEvent child_event( wxEVT_MOTION );
child_event.SetEventObject( obj );
- child_event.m_x = x + obj->GetX();
- child_event.m_y = y + obj->GetY();
+ child_event.m_x = x - obj->GetX();
+ child_event.m_y = y - obj->GetY();
child_event.m_leftDown = event.m_leftDown;
child_event.m_rightDown = event.m_rightDown;
child_event.m_middleDown = event.m_middleDown;
{
child_event.SetEventType( wxEVT_LEAVE_WINDOW );
child_event.SetEventObject( m_lastMouse );
- child_event.m_x = x + m_lastMouse->GetX();
- child_event.m_y = y + m_lastMouse->GetY();
+ child_event.m_x = x - m_lastMouse->GetX();
+ child_event.m_y = y - m_lastMouse->GetY();
m_lastMouse->ProcessEvent( child_event );
m_lastMouse = obj;
child_event.SetEventType( wxEVT_ENTER_WINDOW );
child_event.SetEventObject( m_lastMouse );
- child_event.m_x = x + m_lastMouse->GetX();
- child_event.m_y = y + m_lastMouse->GetY();
+ child_event.m_x = x - m_lastMouse->GetX();
+ child_event.m_y = y - m_lastMouse->GetY();
m_lastMouse->ProcessEvent( child_event );
child_event.SetEventType( wxEVT_MOTION );
{
wxMouseEvent child_event( wxEVT_LEAVE_WINDOW );
child_event.SetEventObject( m_lastMouse );
- child_event.m_x = x + m_lastMouse->GetX();
- child_event.m_y = y + m_lastMouse->GetY();
+ child_event.m_x = x - m_lastMouse->GetX();
+ child_event.m_y = y - m_lastMouse->GetY();
child_event.m_leftDown = event.m_leftDown;
child_event.m_rightDown = event.m_rightDown;
child_event.m_middleDown = event.m_middleDown;
bool wxCanvasModule::OnInit()
{
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
int error = FT_Init_FreeType( &g_freetypeLibrary );
if (error) return FALSE;
#endif
void wxCanvasModule::OnExit()
{
-#if USE_FREETYPE
+#if wxUSE_FREETYPE
FT_Done_FreeType( g_freetypeLibrary );
#endif
}