replaced by stubs files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-08-12 09:16:21 +00:00
parent 0acb94947f
commit 01b2eeec59
85 changed files with 9910 additions and 7156 deletions

View File

@@ -1,163 +1,373 @@
/////////////////////////////////////////////////////////////////////////////
// Name: region.cpp
// Purpose:
// Author: Robert Roebling
// Created: 01/02/98
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
// File: region.cpp
// Purpose: Region class
// Author: Markus Holzem/Julian Smart/AUTHOR
// Created: Fri Oct 24 10:46:34 MET 1997
// RCS-ID: $Id$
// Copyright: (c) 1997 Markus Holzem/Julian Smart/AUTHOR
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "region.h"
#endif
#include "wx/region.h"
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/msw/region.h"
#include "wx/gdicmn.h"
#include <windows.h>
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
#endif
//-----------------------------------------------------------------------------
// wxRegionRefData implementation
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxRegionRefData : public wxGDIRefData {
public:
wxRegionRefData()
{
}
wxRegionRefData(const wxRegionRefData& data)
{
// TODO
}
~wxRegionRefData()
{
// TODO
}
HRGN m_region;
};
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegionRefData: public wxObjectRefData
/*!
* Create an empty region.
*/
wxRegion::wxRegion()
{
public:
wxRegionRefData(void);
~wxRegionRefData(void);
public:
m_refData = new wxRegionRefData;
// TODO create empty region
}
};
wxRegionRefData::wxRegionRefData(void)
wxRegion::wxRegion(long x, long y, long w, long h)
{
};
m_refData = new wxRegionRefData;
// TODO create rect region
}
wxRegionRefData::~wxRegionRefData(void)
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
{
};
m_refData = new wxRegionRefData;
// TODO create rect region
}
wxRegion::wxRegion(const wxRect& rect)
{
m_refData = new wxRegionRefData;
// TODO create rect region
}
/*!
* Destroy the region.
*/
wxRegion::~wxRegion()
{
// m_refData unrefed in ~wxObject
}
//-----------------------------------------------------------------------------
//# Modify region
//-----------------------------------------------------------------------------
#define M_REGIONDATA ((wxRegionRefData *)m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxRegion,wxGDIObject);
wxRegion::wxRegion( long x, long y, long w, long h )
//! Clear current region
void wxRegion::Clear()
{
m_refData = new wxRegionRefData();
};
UnRef();
}
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
//! Combine rectangle (x, y, w, h) with this.
bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op)
{
m_refData = new wxRegionRefData();
};
// Don't change shared data
if (!m_refData) {
m_refData = new wxRegionRefData();
} else if (m_refData->GetRefCount() > 1) {
wxRegionRefData* ref = (wxRegionRefData*)m_refData;
UnRef();
m_refData = new wxRegionRefData(*ref);
}
// If ref count is 1, that means it's 'ours' anyway so no action.
wxRegion::wxRegion( const wxRect& rect )
// TODO create rect region
int mode = 0; // TODO platform-specific code
switch (op)
{
case wxRGN_AND:
// TODO
break ;
case wxRGN_OR:
// TODO
break ;
case wxRGN_XOR:
// TODO
break ;
case wxRGN_DIFF:
// TODO
break ;
case wxRGN_COPY:
default:
// TODO
break ;
}
// TODO do combine region
return FALSE;
}
//! Union /e region with this.
bool wxRegion::Combine(const wxRegion& region, wxRegionOp op)
{
m_refData = new wxRegionRefData();
};
if (region.Empty())
return FALSE;
wxRegion::wxRegion(void)
// Don't change shared data
if (!m_refData) {
m_refData = new wxRegionRefData();
} else if (m_refData->GetRefCount() > 1) {
wxRegionRefData* ref = (wxRegionRefData*)m_refData;
UnRef();
m_refData = new wxRegionRefData(*ref);
}
int mode = 0; // TODO platform-specific code
switch (op)
{
case wxRGN_AND:
// TODO
break ;
case wxRGN_OR:
// TODO
break ;
case wxRGN_XOR:
// TODO
break ;
case wxRGN_DIFF:
// TODO
break ;
case wxRGN_COPY:
default:
// TODO
break ;
}
// TODO combine region
return FALSE;
}
bool wxRegion::Combine(const wxRect& rect, wxRegionOp op)
{
m_refData = new wxRegionRefData();
};
return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op);
}
wxRegion::~wxRegion(void)
//-----------------------------------------------------------------------------
//# Information on region
//-----------------------------------------------------------------------------
// Outer bounds of region
void wxRegion::GetBox(long& x, long& y, long&w, long &h) const
{
};
if (m_refData) {
// TODO get box
} else {
x = y = w = h = 0;
}
}
void wxRegion::Clear(void)
wxRect wxRegion::GetBox() const
{
UnRef();
m_refData = new wxRegionRefData();
};
long x, y, w, h;
GetBox(x, y, w, h);
return wxRect(x, y, w, h);
}
bool wxRegion::Union( long x, long y, long width, long height )
// Is region empty?
bool wxRegion::Empty() const
{
return TRUE;
};
// TODO
return FALSE;
}
bool wxRegion::Union( const wxRect& rect )
//-----------------------------------------------------------------------------
//# Tests
//-----------------------------------------------------------------------------
// Does the region contain the point (x,y)?
wxRegionContain wxRegion::Contains(long x, long y) const
{
return TRUE;
};
if (!m_refData)
return wxOutRegion;
bool wxRegion::Union( const wxRegion& region )
// TODO. Return wxInRegion if within region.
if (0)
return wxInRegion;
return wxOutRegion;
}
// Does the region contain the point pt?
wxRegionContain wxRegion::Contains(const wxPoint& pt) const
{
return TRUE;
};
if (!m_refData)
return wxOutRegion;
bool wxRegion::Intersect( long x, long y, long width, long height )
// TODO. Return wxInRegion if within region.
if (0)
return wxInRegion;
else
return wxOutRegion;
}
// Does the region contain the rectangle (x, y, w, h)?
wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const
{
return TRUE;
};
if (!m_refData)
return wxOutRegion;
bool wxRegion::Intersect( const wxRect& rect )
// TODO. Return wxInRegion if within region.
if (0)
return wxInRegion;
else
return wxOutRegion;
}
// Does the region contain the rectangle rect
wxRegionContain wxRegion::Contains(const wxRect& rect) const
{
return TRUE;
};
if (!m_refData)
return wxOutRegion;
bool wxRegion::Intersect( const wxRegion& region )
long x, y, w, h;
x = rect.x;
y = rect.y;
w = rect.GetWidth();
h = rect.GetHeight();
return Contains(x, y, w, h);
}
///////////////////////////////////////////////////////////////////////////////
// //
// wxRegionIterator //
// //
///////////////////////////////////////////////////////////////////////////////
/*!
* Initialize empty iterator
*/
wxRegionIterator::wxRegionIterator() : m_current(0), m_numRects(0), m_rects(NULL)
{
return TRUE;
};
}
bool wxRegion::Subtract( long x, long y, long width, long height )
wxRegionIterator::~wxRegionIterator()
{
return TRUE;
};
if (m_rects)
delete[] m_rects;
}
bool wxRegion::Subtract( const wxRect& rect )
/*!
* Initialize iterator for region
*/
wxRegionIterator::wxRegionIterator(const wxRegion& region)
{
return TRUE;
};
m_rects = NULL;
bool wxRegion::Subtract( const wxRegion& region )
Reset(region);
}
/*!
* Reset iterator for a new /e region.
*/
void wxRegionIterator::Reset(const wxRegion& region)
{
return TRUE;
};
m_current = 0;
m_region = region;
bool wxRegion::Xor( long x, long y, long width, long height )
if (m_rects)
delete[] m_rects;
m_rects = NULL;
if (m_region.Empty())
m_numRects = 0;
else
{
// TODO create m_rects and fill with rectangles for this region
m_numRects = 0;
}
}
/*!
* Increment iterator. The rectangle returned is the one after the
* incrementation.
*/
void wxRegionIterator::operator ++ ()
{
return TRUE;
};
if (m_current < m_numRects)
++m_current;
}
bool wxRegion::Xor( const wxRect& rect )
/*!
* Increment iterator. The rectangle returned is the one before the
* incrementation.
*/
void wxRegionIterator::operator ++ (int)
{
return TRUE;
};
if (m_current < m_numRects)
++m_current;
}
bool wxRegion::Xor( const wxRegion& region )
long wxRegionIterator::GetX() const
{
return TRUE;
};
if (m_current < m_numRects)
return m_rects[m_current].x;
return 0;
}
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
long wxRegionIterator::GetY() const
{
x = 0;
y = 0;
w = -1;
h = -1;
};
if (m_current < m_numRects)
return m_rects[m_current].y;
return 0;
}
wxRect wxRegion::GetBox(void) const
long wxRegionIterator::GetW() const
{
return wxRect( 0, 0, -1, -1 );
};
if (m_current < m_numRects)
return m_rects[m_current].width ;
return 0;
}
bool wxRegion::Empty(void) const
long wxRegionIterator::GetH() const
{
};
wxRegionContain wxRegion::Contains( long x, long y ) const
{
return wxOutRegion;
};
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
{
return wxOutRegion;
};
if (m_current < m_numRects)
return m_rects[m_current].height;
return 0;
}