Added mising AddBitmapList in wxBitmap

Added missing deletion of wxFrame's toolbar
  Removed a few superfluous ; (sorry)
  Mentioned dmalloc in INSTALL


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-08-16 19:39:29 +00:00
parent 11026f7b59
commit ff7b1510ea
40 changed files with 786 additions and 779 deletions

View File

@@ -133,14 +133,17 @@ The following options handle the kind of library you want to build.
--without-optimise Do not optimise the code. --without-optimise Do not optimise the code.
--with-profile Add profiling info to the --with-profile Add profiling info to the object
object files. Currently files. Currently broken, I think.
broken.
--with-mem_tracing Add built-in memory tracing. --with-mem_tracing Add built-in memory tracing.
This doesn't work well with gcc.
--with-debug_info Add debug info to object --with-dmalloc Use the dmalloc memory debugger.
files. Read more at www.letters.com/dmalloc/
--with-debug_info Add debug info to object files and
executables.
--with-debug_flag Define __DEBUG__ and __WXDEBUG__ when --with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
compiling. compiling.

View File

@@ -30,9 +30,8 @@
#include "bitmaps/save.xpm" #include "bitmaps/save.xpm"
#include "bitmaps/copy.xpm" #include "bitmaps/copy.xpm"
#include "bitmaps/cut.xpm" #include "bitmaps/cut.xpm"
// #include "bitmaps/paste.xpm" #include "bitmaps/paste.xpm"
#include "bitmaps/print.xpm" #include "bitmaps/print.xpm"
#include "bitmaps/preview.xpm"
#include "bitmaps/help.xpm" #include "bitmaps/help.xpm"
#endif #endif
@@ -322,8 +321,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
bitmaps[2] = new wxBitmap( save_xpm ); bitmaps[2] = new wxBitmap( save_xpm );
bitmaps[3] = new wxBitmap( copy_xpm ); bitmaps[3] = new wxBitmap( copy_xpm );
bitmaps[4] = new wxBitmap( cut_xpm ); bitmaps[4] = new wxBitmap( cut_xpm );
// bitmaps[5] = new wxBitmap( paste_xpm ); bitmaps[5] = new wxBitmap( paste_xpm );
bitmaps[5] = new wxBitmap( preview_xpm );
bitmaps[6] = new wxBitmap( print_xpm ); bitmaps[6] = new wxBitmap( print_xpm );
bitmaps[7] = new wxBitmap( help_xpm ); bitmaps[7] = new wxBitmap( help_xpm );
#endif #endif
@@ -335,7 +333,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
#endif #endif
int currentX = 5; int currentX = 5;
toolBar->AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file"); toolBar->AddTool(0, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
currentX += width + 5; currentX += width + 5;
toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file"); toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file");
currentX += width + 5; currentX += width + 5;

View File

@@ -52,13 +52,13 @@ extern void wxFlushResources(void);
void wxExit(void) void wxExit(void)
{ {
gtk_main_quit(); gtk_main_quit();
}; }
bool wxYield(void) bool wxYield(void)
{ {
while (gtk_events_pending() > 0) gtk_main_iteration(); while (gtk_events_pending() > 0) gtk_main_iteration();
return TRUE; return TRUE;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxApp // wxApp
@@ -72,38 +72,38 @@ END_EVENT_TABLE()
gint wxapp_idle_callback( gpointer WXUNUSED(data) ) gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{ {
if (wxTheApp) while (wxTheApp->ProcessIdle()) {}; if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
usleep( 10000 ); usleep( 10000 );
return TRUE; return TRUE;
}; }
wxApp::wxApp() wxApp::wxApp()
{ {
m_idleTag = 0; m_idleTag = 0;
m_topWindow = NULL; m_topWindow = NULL;
m_exitOnFrameDelete = TRUE; m_exitOnFrameDelete = TRUE;
}; }
wxApp::~wxApp(void) wxApp::~wxApp(void)
{ {
gtk_idle_remove( m_idleTag ); gtk_idle_remove( m_idleTag );
}; }
bool wxApp::OnInit(void) bool wxApp::OnInit(void)
{ {
return TRUE; return TRUE;
}; }
bool wxApp::OnInitGui(void) bool wxApp::OnInitGui(void)
{ {
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL ); m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE; return TRUE;
}; }
int wxApp::OnRun(void) int wxApp::OnRun(void)
{ {
return MainLoop(); return MainLoop();
}; }
bool wxApp::ProcessIdle(void) bool wxApp::ProcessIdle(void)
{ {
@@ -112,7 +112,7 @@ bool wxApp::ProcessIdle(void)
ProcessEvent( event ); ProcessEvent( event );
return event.MoreRequested(); return event.MoreRequested();
}; }
void wxApp::OnIdle( wxIdleEvent &event ) void wxApp::OnIdle( wxIdleEvent &event )
{ {
@@ -139,7 +139,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
event.RequestMore(TRUE); event.RequestMore(TRUE);
inOnIdle = FALSE; inOnIdle = FALSE;
}; }
bool wxApp::SendIdleEvents(void) bool wxApp::SendIdleEvents(void)
{ {
@@ -154,7 +154,7 @@ bool wxApp::SendIdleEvents(void)
node = node->Next(); node = node->Next();
} }
return needMore; return needMore;
}; }
bool wxApp::SendIdleEvents( wxWindow* win ) bool wxApp::SendIdleEvents( wxWindow* win )
{ {
@@ -177,37 +177,37 @@ bool wxApp::SendIdleEvents( wxWindow* win )
node = node->Next(); node = node->Next();
} }
return needMore ; return needMore ;
}; }
int wxApp::OnExit(void) int wxApp::OnExit(void)
{ {
return 0; return 0;
}; }
int wxApp::MainLoop(void) int wxApp::MainLoop(void)
{ {
gtk_main(); gtk_main();
return 0; return 0;
}; }
void wxApp::ExitMainLoop(void) void wxApp::ExitMainLoop(void)
{ {
gtk_main_quit(); gtk_main_quit();
}; }
bool wxApp::Initialized(void) bool wxApp::Initialized(void)
{ {
return m_initialized; return m_initialized;
}; }
bool wxApp::Pending(void) bool wxApp::Pending(void)
{ {
return FALSE; return FALSE;
}; }
void wxApp::Dispatch(void) void wxApp::Dispatch(void)
{ {
}; }
void wxApp::DeletePendingObjects(void) void wxApp::DeletePendingObjects(void)
{ {
@@ -222,8 +222,8 @@ void wxApp::DeletePendingObjects(void)
delete node; delete node;
node = wxPendingDelete.First(); node = wxPendingDelete.First();
}; }
}; }
wxWindow *wxApp::GetTopWindow(void) wxWindow *wxApp::GetTopWindow(void)
{ {
@@ -231,12 +231,12 @@ wxWindow *wxApp::GetTopWindow(void)
wxNode *node = wxTopLevelWindows.First(); wxNode *node = wxTopLevelWindows.First();
if (!node) return NULL; if (!node) return NULL;
return (wxWindow*)node->Data(); return (wxWindow*)node->Data();
}; }
void wxApp::SetTopWindow( wxWindow *win ) void wxApp::SetTopWindow( wxWindow *win )
{ {
m_topWindow = win; m_topWindow = win;
}; }
void wxApp::CommonInit(void) void wxApp::CommonInit(void)
{ {
@@ -273,7 +273,7 @@ void wxApp::CommonInit(void)
g_globalCursor = new wxCursor; g_globalCursor = new wxCursor;
*/ */
}; }
void wxApp::CommonCleanUp(void) void wxApp::CommonCleanUp(void)
{ {
@@ -292,7 +292,7 @@ void wxApp::CommonCleanUp(void)
wxCleanUpResourceSystem(); wxCleanUpResourceSystem();
wxSystemSettings::Done(); wxSystemSettings::Done();
}; }
wxLog *wxApp::CreateLogTarget() wxLog *wxApp::CreateLogTarget()
{ {
@@ -327,20 +327,20 @@ int wxEntry( int argc, char *argv[] )
{ {
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0; return 0;
}; }
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction(); wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini(); wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app; wxTheApp = (wxApp*) test_app;
}; }
if (!wxTheApp) if (!wxTheApp)
{ {
printf( _("wxWindows error: wxTheApp == NULL\n") ); printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0; return 0;
}; }
wxTheApp->argc = argc; wxTheApp->argc = argc;
wxTheApp->argv = argv; wxTheApp->argv = argv;
@@ -396,7 +396,7 @@ int wxEntry( int argc, char *argv[] )
#endif #endif
return retValue; return retValue;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// main() // main()

View File

@@ -28,19 +28,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxMask,wxObject)
wxMask::wxMask(void) wxMask::wxMask(void)
{ {
m_bitmap = NULL; m_bitmap = NULL;
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) )
{ {
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) )
{ {
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
{ {
}; }
wxMask::~wxMask(void) wxMask::~wxMask(void)
{ {
@@ -49,12 +49,12 @@ wxMask::~wxMask(void)
#else #else
if (m_bitmap) gdk_bitmap_unref( m_bitmap ); if (m_bitmap) gdk_bitmap_unref( m_bitmap );
#endif #endif
}; }
GdkBitmap *wxMask::GetBitmap(void) const GdkBitmap *wxMask::GetBitmap(void) const
{ {
return m_bitmap; return m_bitmap;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxBitmap // wxBitmap
@@ -92,7 +92,7 @@ wxBitmapRefData::wxBitmapRefData(void)
#ifdef USE_GDK_IMLIB #ifdef USE_GDK_IMLIB
m_image = NULL; m_image = NULL;
#endif #endif
}; }
wxBitmapRefData::~wxBitmapRefData(void) wxBitmapRefData::~wxBitmapRefData(void)
{ {
@@ -105,7 +105,7 @@ wxBitmapRefData::~wxBitmapRefData(void)
if (m_bitmap) gdk_bitmap_unref( m_bitmap ); if (m_bitmap) gdk_bitmap_unref( m_bitmap );
if (m_mask) delete m_mask; if (m_mask) delete m_mask;
if (m_palette) delete m_palette; if (m_palette) delete m_palette;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -116,7 +116,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxBitmap::wxBitmap(void) wxBitmap::wxBitmap(void)
{ {
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( int width, int height, int depth )
{ {
@@ -129,7 +129,7 @@ wxBitmap::wxBitmap( int width, int height, int depth )
M_BMPDATA->m_bpp = depth; M_BMPDATA->m_bpp = depth;
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( char **bits ) wxBitmap::wxBitmap( char **bits )
{ {
@@ -146,7 +146,7 @@ wxBitmap::wxBitmap( char **bits )
{ {
M_BMPDATA->m_mask = new wxMask(); M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask; M_BMPDATA->m_mask->m_bitmap = mask;
}; }
gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) ); gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
@@ -160,26 +160,28 @@ wxBitmap::wxBitmap( char **bits )
M_BMPDATA->m_bpp = 24; // ? M_BMPDATA->m_bpp = 24; // ?
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxBitmap& bmp ) wxBitmap::wxBitmap( const wxBitmap& bmp )
{ {
Ref( bmp ); Ref( bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxBitmap* bmp ) wxBitmap::wxBitmap( const wxBitmap* bmp )
{ {
if (bmp) Ref( *bmp ); if (bmp) Ref( *bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxString &filename, int type ) wxBitmap::wxBitmap( const wxString &filename, int type )
{ {
LoadFile( filename, type ); LoadFile( filename, type );
};
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
// CMB 15/5/98: add constructor for xbm bitmaps // CMB 15/5/98: add constructor for xbm bitmaps
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth)) wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
@@ -199,72 +201,72 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth
wxBitmap::~wxBitmap(void) wxBitmap::~wxBitmap(void)
{ {
if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this); if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
}; }
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp ) wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{ {
if (*this == bmp) return (*this); if (*this == bmp) return (*this);
Ref( bmp ); Ref( bmp );
return *this; return *this;
}; }
bool wxBitmap::operator == ( const wxBitmap& bmp ) bool wxBitmap::operator == ( const wxBitmap& bmp )
{ {
return m_refData == bmp.m_refData; return m_refData == bmp.m_refData;
}; }
bool wxBitmap::operator != ( const wxBitmap& bmp ) bool wxBitmap::operator != ( const wxBitmap& bmp )
{ {
return m_refData != bmp.m_refData; return m_refData != bmp.m_refData;
}; }
bool wxBitmap::Ok(void) const bool wxBitmap::Ok(void) const
{ {
return m_refData != NULL; return m_refData != NULL;
}; }
int wxBitmap::GetHeight(void) const int wxBitmap::GetHeight(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_height; return M_BMPDATA->m_height;
}; }
int wxBitmap::GetWidth(void) const int wxBitmap::GetWidth(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_width; return M_BMPDATA->m_width;
}; }
int wxBitmap::GetDepth(void) const int wxBitmap::GetDepth(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_bpp; return M_BMPDATA->m_bpp;
}; }
void wxBitmap::SetHeight( int height ) void wxBitmap::SetHeight( int height )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_height = height; M_BMPDATA->m_height = height;
}; }
void wxBitmap::SetWidth( int width ) void wxBitmap::SetWidth( int width )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_width = width; M_BMPDATA->m_width = width;
}; }
void wxBitmap::SetDepth( int depth ) void wxBitmap::SetDepth( int depth )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_bpp = depth; M_BMPDATA->m_bpp = depth;
}; }
wxMask *wxBitmap::GetMask(void) const wxMask *wxBitmap::GetMask(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_mask; return M_BMPDATA->m_mask;
}; }
void wxBitmap::SetMask( wxMask *mask ) void wxBitmap::SetMask( wxMask *mask )
{ {
@@ -272,7 +274,7 @@ void wxBitmap::SetMask( wxMask *mask )
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
M_BMPDATA->m_mask = mask; M_BMPDATA->m_mask = mask;
}; }
void wxBitmap::Resize( int height, int width ) void wxBitmap::Resize( int height, int width )
{ {
@@ -296,7 +298,7 @@ void wxBitmap::Resize( int height, int width )
Render(); Render();
#endif #endif
}; }
bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type), bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
wxPalette *WXUNUSED(palette) ) wxPalette *WXUNUSED(palette) )
@@ -312,7 +314,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
#endif #endif
return FALSE; return FALSE;
}; }
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) ) bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{ {
@@ -327,7 +329,7 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{ {
UnRef(); UnRef();
return FALSE; return FALSE;
}; }
Render(); Render();
@@ -338,26 +340,26 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
#endif #endif
return FALSE; return FALSE;
}; }
wxPalette *wxBitmap::GetPalette(void) const wxPalette *wxBitmap::GetPalette(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_palette; return M_BMPDATA->m_palette;
}; }
GdkPixmap *wxBitmap::GetPixmap(void) const GdkPixmap *wxBitmap::GetPixmap(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_pixmap; return M_BMPDATA->m_pixmap;
}; }
GdkBitmap *wxBitmap::GetBitmap(void) const GdkBitmap *wxBitmap::GetBitmap(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_bitmap; return M_BMPDATA->m_bitmap;
}; }
void wxBitmap::DestroyImage(void) void wxBitmap::DestroyImage(void)
{ {
@@ -367,12 +369,12 @@ void wxBitmap::DestroyImage(void)
{ {
gdk_imlib_destroy_image( M_BMPDATA->m_image ); gdk_imlib_destroy_image( M_BMPDATA->m_image );
M_BMPDATA->m_image = NULL; M_BMPDATA->m_image = NULL;
}; }
}; }
void wxBitmap::RecreateImage(void) void wxBitmap::RecreateImage(void)
{ {
}; }
void wxBitmap::Render(void) void wxBitmap::Render(void)
{ {
@@ -389,9 +391,9 @@ void wxBitmap::Render(void)
{ {
M_BMPDATA->m_mask = new wxMask(); M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask; M_BMPDATA->m_mask->m_bitmap = mask;
}; }
#endif #endif
}; }

View File

@@ -32,7 +32,7 @@ class wxBrushRefData: public wxObjectRefData
wxBrushRefData::wxBrushRefData(void) wxBrushRefData::wxBrushRefData(void)
{ {
m_style = 0; m_style = 0;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -43,7 +43,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
wxBrush::wxBrush(void) wxBrush::wxBrush(void)
{ {
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxColour &colour, int style ) wxBrush::wxBrush( const wxColour &colour, int style )
{ {
@@ -52,7 +52,7 @@ wxBrush::wxBrush( const wxColour &colour, int style )
M_BRUSHDATA->m_colour = colour; M_BRUSHDATA->m_colour = colour;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxString &colourName, int style ) wxBrush::wxBrush( const wxString &colourName, int style )
{ {
@@ -61,7 +61,7 @@ wxBrush::wxBrush( const wxString &colourName, int style )
M_BRUSHDATA->m_colour = colourName; M_BRUSHDATA->m_colour = colourName;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBitmap &stippleBitmap ) wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{ {
@@ -71,62 +71,62 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
M_BRUSHDATA->m_stipple = stippleBitmap; M_BRUSHDATA->m_stipple = stippleBitmap;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBrush &brush ) wxBrush::wxBrush( const wxBrush &brush )
{ {
Ref( brush ); Ref( brush );
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBrush *brush ) wxBrush::wxBrush( const wxBrush *brush )
{ {
if (brush) Ref( *brush ); if (brush) Ref( *brush );
if (wxTheBrushList) wxTheBrushList->Append( this ); if (wxTheBrushList) wxTheBrushList->Append( this );
}; }
wxBrush::~wxBrush(void) wxBrush::~wxBrush(void)
{ {
if (wxTheBrushList) wxTheBrushList->RemoveBrush( this ); if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
}; }
wxBrush& wxBrush::operator = ( const wxBrush& brush ) wxBrush& wxBrush::operator = ( const wxBrush& brush )
{ {
if (*this == brush) return (*this); if (*this == brush) return (*this);
Ref( brush ); Ref( brush );
return *this; return *this;
}; }
bool wxBrush::operator == ( const wxBrush& brush ) bool wxBrush::operator == ( const wxBrush& brush )
{ {
return m_refData == brush.m_refData; return m_refData == brush.m_refData;
}; }
bool wxBrush::operator != ( const wxBrush& brush ) bool wxBrush::operator != ( const wxBrush& brush )
{ {
return m_refData != brush.m_refData; return m_refData != brush.m_refData;
}; }
bool wxBrush::Ok(void) const bool wxBrush::Ok(void) const
{ {
return ((m_refData) && M_BRUSHDATA->m_colour.Ok()); return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
}; }
int wxBrush::GetStyle(void) const int wxBrush::GetStyle(void) const
{ {
return M_BRUSHDATA->m_style; return M_BRUSHDATA->m_style;
}; }
wxColour &wxBrush::GetColour(void) const wxColour &wxBrush::GetColour(void) const
{ {
return M_BRUSHDATA->m_colour; return M_BRUSHDATA->m_colour;
}; }
wxBitmap *wxBrush::GetStipple(void) const wxBitmap *wxBrush::GetStipple(void) const
{ {
return &M_BRUSHDATA->m_stipple; return &M_BRUSHDATA->m_stipple;
}; }

View File

@@ -46,17 +46,17 @@ wxColourRefData::wxColourRefData(void)
m_color.pixel = 0; m_color.pixel = 0;
m_colormap = NULL; m_colormap = NULL;
m_hasPixel = FALSE; m_hasPixel = FALSE;
}; }
wxColourRefData::~wxColourRefData(void) wxColourRefData::~wxColourRefData(void)
{ {
FreeColour(); FreeColour();
}; }
void wxColourRefData::FreeColour(void) void wxColourRefData::FreeColour(void)
{ {
// if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 ); // if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -68,7 +68,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
wxColour::wxColour(void) wxColour::wxColour(void)
{ {
}; }
wxColour::wxColour( char red, char green, char blue ) wxColour::wxColour( char red, char green, char blue )
{ {
@@ -77,7 +77,7 @@ wxColour::wxColour( char red, char green, char blue )
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT; M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT; M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0; M_COLDATA->m_color.pixel = 0;
}; }
wxColour::wxColour( const wxString &colourName ) wxColour::wxColour( const wxString &colourName )
{ {
@@ -96,30 +96,30 @@ wxColour::wxColour( const wxString &colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" ); wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData; delete m_refData;
m_refData = NULL; m_refData = NULL;
}; }
}; }
}; }
wxColour::wxColour( const wxColour& col ) wxColour::wxColour( const wxColour& col )
{ {
Ref( col ); Ref( col );
}; }
wxColour::wxColour( const wxColour* col ) wxColour::wxColour( const wxColour* col )
{ {
if (col) Ref( *col ); if (col) Ref( *col );
}; }
wxColour::~wxColour(void) wxColour::~wxColour(void)
{ {
}; }
wxColour& wxColour::operator = ( const wxColour& col ) wxColour& wxColour::operator = ( const wxColour& col )
{ {
if (*this == col) return (*this); if (*this == col) return (*this);
Ref( col ); Ref( col );
return *this; return *this;
}; }
wxColour& wxColour::operator = ( const wxString& colourName ) wxColour& wxColour::operator = ( const wxString& colourName )
{ {
@@ -138,20 +138,20 @@ wxColour& wxColour::operator = ( const wxString& colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" ); wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData; delete m_refData;
m_refData = NULL; m_refData = NULL;
}; }
}; }
return *this; return *this;
}; }
bool wxColour::operator == ( const wxColour& col ) bool wxColour::operator == ( const wxColour& col )
{ {
return m_refData == col.m_refData; return m_refData == col.m_refData;
}; }
bool wxColour::operator != ( const wxColour& col) bool wxColour::operator != ( const wxColour& col)
{ {
return m_refData != col.m_refData; return m_refData != col.m_refData;
}; }
void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue ) void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue )
{ {
@@ -161,30 +161,30 @@ void wxColour::Set( const unsigned char red, const unsigned char green, const un
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT; M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT; M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0; M_COLDATA->m_color.pixel = 0;
}; }
unsigned char wxColour::Red(void) const unsigned char wxColour::Red(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}; }
unsigned char wxColour::Green(void) const unsigned char wxColour::Green(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}; }
unsigned char wxColour::Blue(void) const unsigned char wxColour::Blue(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}; }
bool wxColour::Ok(void) const bool wxColour::Ok(void) const
{ {
return (m_refData); return (m_refData);
}; }
void wxColour::CalcPixel( GdkColormap *cmap ) void wxColour::CalcPixel( GdkColormap *cmap )
{ {
@@ -208,20 +208,20 @@ void wxColour::CalcPixel( GdkColormap *cmap )
#endif #endif
M_COLDATA->m_colormap = cmap; M_COLDATA->m_colormap = cmap;
}; }
int wxColour::GetPixel(void) int wxColour::GetPixel(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_COLDATA->m_color.pixel; return M_COLDATA->m_color.pixel;
}; }
GdkColor *wxColour::GetColor(void) GdkColor *wxColour::GetColor(void)
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
}; }

View File

@@ -32,12 +32,12 @@ class wxCursorRefData: public wxObjectRefData
wxCursorRefData::wxCursorRefData(void) wxCursorRefData::wxCursorRefData(void)
{ {
m_cursor = NULL; m_cursor = NULL;
}; }
wxCursorRefData::~wxCursorRefData(void) wxCursorRefData::~wxCursorRefData(void)
{ {
if (m_cursor) gdk_cursor_destroy( m_cursor ); if (m_cursor) gdk_cursor_destroy( m_cursor );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -47,7 +47,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject)
wxCursor::wxCursor(void) wxCursor::wxCursor(void)
{ {
}; }
wxCursor::wxCursor( int cursorId ) wxCursor::wxCursor( int cursorId )
{ {
@@ -67,7 +67,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break; case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break;
case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break; case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break;
case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break; case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break;
}; }
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur ); M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
@@ -97,49 +97,49 @@ wxCursor::wxCursor( int cursorId )
wxCURSOR_BASED_ARROW_DOWN wxCURSOR_BASED_ARROW_DOWN
*/ */
}; }
wxCursor::wxCursor( const wxCursor &cursor ) wxCursor::wxCursor( const wxCursor &cursor )
{ {
Ref( cursor ); Ref( cursor );
}; }
wxCursor::wxCursor( const wxCursor *cursor ) wxCursor::wxCursor( const wxCursor *cursor )
{ {
UnRef(); UnRef();
if (cursor) Ref( *cursor ); if (cursor) Ref( *cursor );
}; }
wxCursor::~wxCursor(void) wxCursor::~wxCursor(void)
{ {
}; }
wxCursor& wxCursor::operator = ( const wxCursor& cursor ) wxCursor& wxCursor::operator = ( const wxCursor& cursor )
{ {
if (*this == cursor) return (*this); if (*this == cursor) return (*this);
Ref( cursor ); Ref( cursor );
return *this; return *this;
}; }
bool wxCursor::operator == ( const wxCursor& cursor ) bool wxCursor::operator == ( const wxCursor& cursor )
{ {
return m_refData == cursor.m_refData; return m_refData == cursor.m_refData;
}; }
bool wxCursor::operator != ( const wxCursor& cursor ) bool wxCursor::operator != ( const wxCursor& cursor )
{ {
return m_refData != cursor.m_refData; return m_refData != cursor.m_refData;
}; }
bool wxCursor::Ok(void) const bool wxCursor::Ok(void) const
{ {
return TRUE; return TRUE;
}; }
GdkCursor *wxCursor::GetCursor(void) const GdkCursor *wxCursor::GetCursor(void) const
{ {
return M_CURSORDATA->m_cursor; return M_CURSORDATA->m_cursor;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// busy cursor routines // busy cursor routines
@@ -150,24 +150,24 @@ bool g_isBusy = FALSE;
void wxEndBusyCursor(void) void wxEndBusyCursor(void)
{ {
g_isBusy = FALSE; g_isBusy = FALSE;
}; }
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
{ {
g_isBusy = TRUE; g_isBusy = TRUE;
}; }
bool wxIsBusy(void) bool wxIsBusy(void)
{ {
return g_isBusy; return g_isBusy;
}; }
void wxSetCursor( const wxCursor& cursor ) void wxSetCursor( const wxCursor& cursor )
{ {
extern wxCursor *g_globalCursor; extern wxCursor *g_globalCursor;
if (g_globalCursor) (*g_globalCursor) = cursor; if (g_globalCursor) (*g_globalCursor) = cursor;
if (cursor.Ok()) {}; if (cursor.Ok()) {}
}; }

View File

@@ -77,25 +77,25 @@ wxDC::wxDC(void)
m_backgroundBrush = *wxWHITE_BRUSH; m_backgroundBrush = *wxWHITE_BRUSH;
// m_palette = wxAPP_COLOURMAP; // m_palette = wxAPP_COLOURMAP;
}; }
wxDC::~wxDC(void) wxDC::~wxDC(void)
{ {
}; }
void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2), void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2),
double WXUNUSED(xc), double WXUNUSED(yc) ) double WXUNUSED(xc), double WXUNUSED(yc) )
{ {
}; }
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) ) void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
{ {
}; }
void wxDC::DrawPoint( wxPoint& point ) void wxDC::DrawPoint( wxPoint& point )
{ {
DrawPoint( point.x, point.y ); DrawPoint( point.x, point.y );
}; }
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle ) void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
{ {
@@ -108,10 +108,10 @@ void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x; points[i].x = point->x;
points[i++].y = point->y; points[i++].y = point->y;
}; }
DrawPolygon( n, points, xoffset, yoffset, fillStyle ); DrawPolygon( n, points, xoffset, yoffset, fillStyle );
delete[] points; delete[] points;
}; }
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset ) void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
{ {
@@ -124,10 +124,10 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x; points[i].x = point->x;
points[i++].y = point->y; points[i++].y = point->y;
}; }
DrawLines( n, points, xoffset, yoffset ); DrawLines( n, points, xoffset, yoffset );
delete []points; delete []points;
}; }
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ) void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
{ {
@@ -142,20 +142,20 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
wxPoint *p = (wxPoint*)node->Data(); wxPoint *p = (wxPoint*)node->Data();
delete p; delete p;
node = node->Next(); node = node->Next();
}; }
}; }
void wxDC::DrawSpline( wxList *points ) void wxDC::DrawSpline( wxList *points )
{ {
DrawOpenSpline( points ); DrawOpenSpline( points );
}; }
void wxDC::DrawSpline( int n, wxPoint points[] ) void wxDC::DrawSpline( int n, wxPoint points[] )
{ {
wxList list; wxList list;
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] ); for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
DrawSpline( &list ); DrawSpline( &list );
}; }
void wxDC::SetClippingRegion( long x, long y, long width, long height ) void wxDC::SetClippingRegion( long x, long y, long width, long height )
{ {
@@ -164,12 +164,12 @@ void wxDC::SetClippingRegion( long x, long y, long width, long height )
m_clipY1 = y; m_clipY1 = y;
m_clipX2 = x + width; m_clipX2 = x + width;
m_clipY2 = y + height; m_clipY2 = y + height;
}; }
void wxDC::DestroyClippingRegion(void) void wxDC::DestroyClippingRegion(void)
{ {
m_clipping = FALSE; m_clipping = FALSE;
}; }
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
{ {
@@ -182,13 +182,13 @@ void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
} }
else else
*x = *y = *width = *height = 0; *x = *y = *width = *height = 0;
}; }
void wxDC::GetSize( int* width, int* height ) const void wxDC::GetSize( int* width, int* height ) const
{ {
*width = m_maxX-m_minX; *width = m_maxX-m_minX;
*height = m_maxY-m_minY; *height = m_maxY-m_minY;
}; }
void wxDC::GetSizeMM( long* width, long* height ) const void wxDC::GetSizeMM( long* width, long* height ) const
{ {
@@ -197,19 +197,19 @@ void wxDC::GetSizeMM( long* width, long* height ) const
GetSize( &w, &h ); GetSize( &w, &h );
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) ); *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) ); *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
}; }
void wxDC::SetTextForeground( const wxColour &col ) void wxDC::SetTextForeground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
m_textForegroundColour = col; m_textForegroundColour = col;
}; }
void wxDC::SetTextBackground( const wxColour &col ) void wxDC::SetTextBackground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
m_textBackgroundColour = col; m_textBackgroundColour = col;
}; }
void wxDC::SetMapMode( int mode ) void wxDC::SetMapMode( int mode )
{ {
@@ -231,13 +231,13 @@ void wxDC::SetMapMode( int mode )
case MM_TEXT: case MM_TEXT:
SetLogicalScale( 1.0, 1.0 ); SetLogicalScale( 1.0, 1.0 );
break; break;
}; }
if (mode != MM_TEXT) if (mode != MM_TEXT)
{ {
m_needComputeScaleX = TRUE; m_needComputeScaleX = TRUE;
m_needComputeScaleY = TRUE; m_needComputeScaleY = TRUE;
}; }
}; }
void wxDC::SetUserScale( double x, double y ) void wxDC::SetUserScale( double x, double y )
{ {
@@ -245,13 +245,13 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleX = x; m_userScaleX = x;
m_userScaleY = y; m_userScaleY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetUserScale( double *x, double *y ) void wxDC::GetUserScale( double *x, double *y )
{ {
if (x) *x = m_userScaleX; if (x) *x = m_userScaleX;
if (y) *y = m_userScaleY; if (y) *y = m_userScaleY;
}; }
void wxDC::SetLogicalScale( double x, double y ) void wxDC::SetLogicalScale( double x, double y )
{ {
@@ -259,86 +259,86 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleX = x; m_logicalScaleX = x;
m_logicalScaleY = y; m_logicalScaleY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetLogicalScale( double *x, double *y ) void wxDC::GetLogicalScale( double *x, double *y )
{ {
if (x) *x = m_logicalScaleX; if (x) *x = m_logicalScaleX;
if (y) *y = m_logicalScaleY; if (y) *y = m_logicalScaleY;
}; }
void wxDC::SetLogicalOrigin( long x, long y ) void wxDC::SetLogicalOrigin( long x, long y )
{ {
m_logicalOriginX = x * m_signX; // is this still correct ? m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY; m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetLogicalOrigin( long *x, long *y ) void wxDC::GetLogicalOrigin( long *x, long *y )
{ {
if (x) *x = m_logicalOriginX; if (x) *x = m_logicalOriginX;
if (y) *y = m_logicalOriginY; if (y) *y = m_logicalOriginY;
}; }
void wxDC::SetDeviceOrigin( long x, long y ) void wxDC::SetDeviceOrigin( long x, long y )
{ {
m_deviceOriginX = x; m_deviceOriginX = x;
m_deviceOriginY = y; m_deviceOriginY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetDeviceOrigin( long *x, long *y ) void wxDC::GetDeviceOrigin( long *x, long *y )
{ {
if (x) *x = m_deviceOriginX; if (x) *x = m_deviceOriginX;
if (y) *y = m_deviceOriginY; if (y) *y = m_deviceOriginY;
}; }
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{ {
m_signX = (xLeftRight ? 1 : -1); m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1); m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
long wxDC::DeviceToLogicalX(long x) const long wxDC::DeviceToLogicalX(long x) const
{ {
return XDEV2LOG(x); return XDEV2LOG(x);
}; }
long wxDC::DeviceToLogicalY(long y) const long wxDC::DeviceToLogicalY(long y) const
{ {
return YDEV2LOG(y); return YDEV2LOG(y);
}; }
long wxDC::DeviceToLogicalXRel(long x) const long wxDC::DeviceToLogicalXRel(long x) const
{ {
return XDEV2LOGREL(x); return XDEV2LOGREL(x);
}; }
long wxDC::DeviceToLogicalYRel(long y) const long wxDC::DeviceToLogicalYRel(long y) const
{ {
return YDEV2LOGREL(y); return YDEV2LOGREL(y);
}; }
long wxDC::LogicalToDeviceX(long x) const long wxDC::LogicalToDeviceX(long x) const
{ {
return XLOG2DEV(x); return XLOG2DEV(x);
}; }
long wxDC::LogicalToDeviceY(long y) const long wxDC::LogicalToDeviceY(long y) const
{ {
return YLOG2DEV(y); return YLOG2DEV(y);
}; }
long wxDC::LogicalToDeviceXRel(long x) const long wxDC::LogicalToDeviceXRel(long x) const
{ {
return XLOG2DEVREL(x); return XLOG2DEVREL(x);
}; }
long wxDC::LogicalToDeviceYRel(long y) const long wxDC::LogicalToDeviceYRel(long y) const
{ {
return YLOG2DEVREL(y); return YLOG2DEVREL(y);
}; }
void wxDC::CalcBoundingBox( long x, long y ) void wxDC::CalcBoundingBox( long x, long y )
{ {
@@ -346,7 +346,7 @@ void wxDC::CalcBoundingBox( long x, long y )
if (y < m_minY) m_minY = y; if (y < m_minY) m_minY = y;
if (x > m_maxX) m_maxX = x; if (x > m_maxX) m_maxX = x;
if (y > m_maxY) m_maxY = y; if (y > m_maxY) m_maxY = y;
}; }
void wxDC::ComputeScaleAndOrigin(void) void wxDC::ComputeScaleAndOrigin(void)
{ {
@@ -367,5 +367,5 @@ void wxDC::ComputeScaleAndOrigin(void)
m_pen = tempPen; m_pen = tempPen;
SetPen(pen); SetPen(pen);
} }
}; }

View File

@@ -24,17 +24,17 @@ wxMemoryDC::wxMemoryDC(void)
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gdk_colormap_get_system(); m_cmap = gdk_colormap_get_system();
}; }
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gdk_colormap_get_system(); m_cmap = gdk_colormap_get_system();
}; }
wxMemoryDC::~wxMemoryDC(void) wxMemoryDC::~wxMemoryDC(void)
{ {
}; }
void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{ {
@@ -58,8 +58,8 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{ {
m_ok = FALSE; m_ok = FALSE;
m_window = NULL; m_window = NULL;
}; }
}; }
void wxMemoryDC::GetSize( int *width, int *height ) const void wxMemoryDC::GetSize( int *width, int *height ) const
{ {
@@ -72,7 +72,7 @@ void wxMemoryDC::GetSize( int *width, int *height ) const
{ {
if (width) (*width) = 0; if (width) (*width) = 0;
if (height) (*height) = 0; if (height) (*height) = 0;
}; }
}; }

View File

@@ -36,12 +36,12 @@ wxScreenDC::wxScreenDC(void)
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}; }
wxScreenDC::~wxScreenDC(void) wxScreenDC::~wxScreenDC(void)
{ {
EndDrawingOnTop(); EndDrawingOnTop();
}; }
bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) ) bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{ {
@@ -51,7 +51,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{ {
StartDrawingOnTop(); StartDrawingOnTop();
return; return;
}; }
wxRectangle rect; wxRectangle rect;
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
@@ -63,7 +63,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
StartDrawingOnTop( &rect ); StartDrawingOnTop( &rect );
return TRUE; return TRUE;
*/ */
}; }
bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) ) bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
{ {
@@ -79,7 +79,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
y = rect->y; y = rect->y;
width = rect->width; width = rect->width;
height = rect->height; height = rect->height;
}; }
GTK cannot set transparent backgrounds. :-( GTK cannot set transparent backgrounds. :-(
@@ -107,7 +107,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
return TRUE; return TRUE;
*/ */
}; }
bool wxScreenDC::EndDrawingOnTop(void) bool wxScreenDC::EndDrawingOnTop(void)
{ {
@@ -118,4 +118,5 @@ bool wxScreenDC::EndDrawingOnTop(void)
m_isOk = FALSE; m_isOk = FALSE;
return TRUE; return TRUE;
*/ */
}; }

View File

@@ -32,25 +32,25 @@ extern bool g_blockEventsOnDrag;
wxDropTarget::wxDropTarget() wxDropTarget::wxDropTarget()
{ {
}; }
wxDropTarget::~wxDropTarget() wxDropTarget::~wxDropTarget()
{ {
}; }
void wxDropTarget::Drop( GdkEvent *event, int x, int y ) void wxDropTarget::Drop( GdkEvent *event, int x, int y )
{ {
printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type ); printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type );
OnDrop( x, y, (char *)event->dropdataavailable.data); OnDrop( x, y, (char *)event->dropdataavailable.data);
}; }
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{ {
if (!widget) return; if (!widget) return;
gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE ); gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE );
}; }
void wxDropTarget::RegisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget )
{ {
@@ -74,13 +74,13 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
break; break;
default: default:
break; break;
}; }
} }
char *str = WXSTRINGCAST formats; char *str = WXSTRINGCAST formats;
gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE ); gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE );
}; }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxTextDropTarget // wxTextDropTarget
@@ -90,14 +90,14 @@ bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
{ {
OnDropText( x, y, (const char*)pData ); OnDropText( x, y, (const char*)pData );
return TRUE; return TRUE;
}; }
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz ) bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{ {
printf( "Got dropped text: %s.\n", psz ); printf( "Got dropped text: %s.\n", psz );
printf( "At x: %d, y: %d.\n", (int)x, (int)y ); printf( "At x: %d, y: %d.\n", (int)x, (int)y );
return TRUE; return TRUE;
}; }
size_t wxTextDropTarget::GetFormatCount() const size_t wxTextDropTarget::GetFormatCount() const
{ {
@@ -159,7 +159,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
delete ptr; delete ptr;
source->m_retValue = wxDropSource::Copy; source->m_retValue = wxDropSource::Copy;
}; }
wxDropSource::wxDropSource( wxWindow *win ) wxDropSource::wxDropSource( wxWindow *win )
{ {
@@ -174,7 +174,7 @@ wxDropSource::wxDropSource( wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND ); m_goaheadCursor = wxCursor( wxCURSOR_HAND );
}; }
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win ) wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{ {
@@ -189,19 +189,19 @@ wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND ); m_goaheadCursor = wxCursor( wxCURSOR_HAND );
}; }
void wxDropSource::SetData( wxDataObject &data ) void wxDropSource::SetData( wxDataObject &data )
{ {
m_data = &data; m_data = &data;
}; }
wxDropSource::~wxDropSource(void) wxDropSource::~wxDropSource(void)
{ {
// if (m_data) delete m_data; // if (m_data) delete m_data;
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = FALSE;
}; }
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{ {
@@ -227,7 +227,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{ {
g_free( gdk_dnd.drag_startwindows ); g_free( gdk_dnd.drag_startwindows );
gdk_dnd.drag_startwindows = NULL; gdk_dnd.drag_startwindows = NULL;
}; }
gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0; gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0;
XWindowAttributes dnd_winattr; XWindowAttributes dnd_winattr;
@@ -266,7 +266,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = FALSE;
return m_retValue; return m_retValue;
}; }
void wxDropSource::RegisterWindow(void) void wxDropSource::RegisterWindow(void)
{ {
@@ -294,7 +294,7 @@ void wxDropSource::RegisterWindow(void)
gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event", gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event",
GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this );
}; }
void wxDropSource::UnregisterWindow(void) void wxDropSource::UnregisterWindow(void)
{ {
@@ -303,4 +303,4 @@ void wxDropSource::UnregisterWindow(void)
gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 ); gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 );
gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this ); gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this );
}; }

View File

@@ -37,14 +37,14 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
} }
dialog->OnOK( event ); dialog->OnOK( event );
}; }
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data ) void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data )
{ {
wxFileDialog *dialog = (wxFileDialog*)data; wxFileDialog *dialog = (wxFileDialog*)data;
wxCommandEvent event(wxEVT_NULL); wxCommandEvent event(wxEVT_NULL);
dialog->OnCancel( event ); dialog->OnCancel( event );
}; }
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
@@ -83,7 +83,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked", gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
}; }
int wxFileDialog::ShowModal(void) int wxFileDialog::ShowModal(void)
{ {
@@ -93,9 +93,9 @@ int wxFileDialog::ShowModal(void)
{ {
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) ); m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) ); m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
}; }
return ret; return ret;
}; }
char *wxFileSelector(const char *title, char *wxFileSelector(const char *title,
@@ -131,7 +131,7 @@ char *wxFileSelector(const char *title,
} }
else else
return NULL; return NULL;
}; }
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name, char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent ) wxWindow *parent )
@@ -147,7 +147,7 @@ char* wxLoadFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext); sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent); return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}; }
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name, char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent ) wxWindow *parent )
@@ -163,5 +163,5 @@ char* wxSaveFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext); sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent); return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}; }

View File

@@ -24,9 +24,11 @@ static char *wx_font_family [] = {
"wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT", "wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
"wxSWISS", "wxTELETYPE", "wxSWISS", "wxTELETYPE",
}; };
static char *wx_font_style [] = { static char *wx_font_style [] = {
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC", "wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
}; };
static char *wx_font_weight [] = { static char *wx_font_weight [] = {
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT", "wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
}; };
@@ -68,7 +70,7 @@ wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER)
m_fontId = 0; m_fontId = 0;
m_faceName = NULL; m_faceName = NULL;
m_font = NULL; m_font = NULL;
}; }
wxFontRefData::~wxFontRefData(void) wxFontRefData::~wxFontRefData(void)
{ {
@@ -79,14 +81,14 @@ wxFontRefData::~wxFontRefData(void)
wxNode *next = node->Next(); wxNode *next = node->Next();
gdk_font_unref( font ); gdk_font_unref( font );
node = next; node = next;
}; }
if (m_faceName) if (m_faceName)
{ {
delete m_faceName; delete m_faceName;
m_faceName = NULL; m_faceName = NULL;
}; }
if (m_font) gdk_font_unref( m_font ); if (m_font) gdk_font_unref( m_font );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -97,7 +99,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
wxFont::wxFont(void) wxFont::wxFont(void)
{ {
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont( char *xFontName ) wxFont::wxFont( char *xFontName )
{ {
@@ -107,7 +109,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_byXFontName = TRUE; M_FONTDATA->m_byXFontName = TRUE;
M_FONTDATA->m_font = gdk_font_load( xFontName ); M_FONTDATA->m_font = gdk_font_load( xFontName );
}; }
wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight, wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
bool Underlined, const char* Face) bool Underlined, const char* Face)
@@ -123,14 +125,14 @@ wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
{ {
M_FONTDATA->m_fontId = FontIdOrFamily; M_FONTDATA->m_fontId = FontIdOrFamily;
M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily ); M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily );
}; }
M_FONTDATA->m_style = Style; M_FONTDATA->m_style = Style;
M_FONTDATA->m_weight = Weight; M_FONTDATA->m_weight = Weight;
M_FONTDATA->m_pointSize = PointSize; M_FONTDATA->m_pointSize = PointSize;
M_FONTDATA->m_underlined = Underlined; M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont(int PointSize, const char *Face, int Family, int Style, wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
int Weight, bool Underlined) int Weight, bool Underlined)
@@ -146,105 +148,105 @@ wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
M_FONTDATA->m_underlined = Underlined; M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont( const wxFont& font ) wxFont::wxFont( const wxFont& font )
{ {
Ref( font ); Ref( font );
}; }
wxFont::wxFont( const wxFont* font ) wxFont::wxFont( const wxFont* font )
{ {
UnRef(); UnRef();
if (font) Ref( *font ); if (font) Ref( *font );
}; }
wxFont::~wxFont(void) wxFont::~wxFont(void)
{ {
if (wxTheFontList) wxTheFontList->DeleteObject( this ); if (wxTheFontList) wxTheFontList->DeleteObject( this );
}; }
wxFont& wxFont::operator = ( const wxFont& font ) wxFont& wxFont::operator = ( const wxFont& font )
{ {
if (*this == font) return (*this); if (*this == font) return (*this);
Ref( font ); Ref( font );
return *this; return *this;
}; }
bool wxFont::operator == ( const wxFont& font ) bool wxFont::operator == ( const wxFont& font )
{ {
return m_refData == font.m_refData; return m_refData == font.m_refData;
}; }
bool wxFont::operator != ( const wxFont& font ) bool wxFont::operator != ( const wxFont& font )
{ {
return m_refData != font.m_refData; return m_refData != font.m_refData;
}; }
bool wxFont::Ok() bool wxFont::Ok()
{ {
return (m_refData != NULL); return (m_refData != NULL);
}; }
int wxFont::GetPointSize(void) const int wxFont::GetPointSize(void) const
{ {
return M_FONTDATA->m_pointSize; return M_FONTDATA->m_pointSize;
}; }
wxString wxFont::GetFaceString(void) const wxString wxFont::GetFaceString(void) const
{ {
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId ); wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s; return s;
}; }
wxString wxFont::GetFaceName(void) const wxString wxFont::GetFaceName(void) const
{ {
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId ); wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s; return s;
}; }
int wxFont::GetFamily(void) const int wxFont::GetFamily(void) const
{ {
return M_FONTDATA->m_family; return M_FONTDATA->m_family;
}; }
wxString wxFont::GetFamilyString(void) const wxString wxFont::GetFamilyString(void) const
{ {
wxString s = wx_font_family[M_FONTDATA->m_family]; wxString s = wx_font_family[M_FONTDATA->m_family];
return s; return s;
}; }
int wxFont::GetFontId(void) const int wxFont::GetFontId(void) const
{ {
return M_FONTDATA->m_fontId; // stub return M_FONTDATA->m_fontId; // stub
}; }
int wxFont::GetStyle(void) const int wxFont::GetStyle(void) const
{ {
return M_FONTDATA->m_style; return M_FONTDATA->m_style;
}; }
wxString wxFont::GetStyleString(void) const wxString wxFont::GetStyleString(void) const
{ {
wxString s = wx_font_style[M_FONTDATA->m_style]; wxString s = wx_font_style[M_FONTDATA->m_style];
return s; return s;
}; }
int wxFont::GetWeight(void) const int wxFont::GetWeight(void) const
{ {
return M_FONTDATA->m_weight; return M_FONTDATA->m_weight;
}; }
wxString wxFont::GetWeightString(void) const wxString wxFont::GetWeightString(void) const
{ {
wxString s = wx_font_weight[M_FONTDATA->m_weight]; wxString s = wx_font_weight[M_FONTDATA->m_weight];
return s; return s;
}; }
bool wxFont::GetUnderlined(void) const bool wxFont::GetUnderlined(void) const
{ {
return M_FONTDATA->m_underlined; return M_FONTDATA->m_underlined;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// get internal representation of font // get internal representation of font
@@ -273,12 +275,12 @@ GdkFont *wxFont::GetInternalFont(float scale) const
font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style, font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
M_FONTDATA->m_weight, M_FONTDATA->m_underlined ); M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font ); M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
}; }
if (!font) if (!font)
printf("could not load any font"); printf("could not load any font");
// wxError("could not load any font", "wxFont"); // wxError("could not load any font", "wxFont");
return font; return font;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// local utilities to find a X font // local utilities to find a X font
@@ -448,7 +450,7 @@ static int WCoordinate(int w)
case wxNORMAL: case wxNORMAL:
default: return wxWEIGHT_NORMAL; default: return wxWEIGHT_NORMAL;
} }
} };
static int SCoordinate(int s) static int SCoordinate(int s)
{ {
@@ -458,7 +460,7 @@ static int SCoordinate(int s)
case wxNORMAL: case wxNORMAL:
default: return wxSTYLE_NORMAL; default: return wxSTYLE_NORMAL;
} }
} };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSuffixMap // wxSuffixMap

View File

@@ -171,6 +171,7 @@ wxFrame::~wxFrame()
{ {
if (m_frameMenuBar) delete m_frameMenuBar; if (m_frameMenuBar) delete m_frameMenuBar;
if (m_frameStatusBar) delete m_frameStatusBar; if (m_frameStatusBar) delete m_frameStatusBar;
if (m_frameToolBar) delete m_frameToolBar;
// if (m_mainWindow) gtk_widget_destroy( m_mainWindow ); // if (m_mainWindow) gtk_widget_destroy( m_mainWindow );

View File

@@ -23,5 +23,5 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) : wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
wxBitmap( bits ) wxBitmap( bits )
{ {
}; }

View File

@@ -34,10 +34,10 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height)) (win->m_height == alloc->height))
{ {
return; return;
}; }
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
}; }
// page change callback // page change callback
static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget), static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
@@ -55,7 +55,7 @@ static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
mdi_frame->m_currentChild = child_frame; mdi_frame->m_currentChild = child_frame;
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar ); mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
return; return;
}; }
node = node->Next(); node = node->Next();
} }
} }
@@ -72,7 +72,7 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
}; }
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -83,11 +83,11 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
}; }
wxMDIParentFrame::~wxMDIParentFrame(void) wxMDIParentFrame::~wxMDIParentFrame(void)
{ {
}; }
bool wxMDIParentFrame::Create( wxWindow *parent, bool wxMDIParentFrame::Create( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -99,7 +99,7 @@ bool wxMDIParentFrame::Create( wxWindow *parent,
OnCreateClient(); OnCreateClient();
return TRUE; return TRUE;
}; }
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height ) void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
{ {
@@ -112,7 +112,7 @@ void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GetClientSize( &x, &y ); GetClientSize( &x, &y );
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 ); m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
} }
}; }
void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar ) void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
{ {
@@ -126,48 +126,48 @@ void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 ); m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
m_mdiMenuBar->Show( TRUE ); m_mdiMenuBar->Show( TRUE );
} }
}; }
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
{ {
wxFrame::GetClientSize( width, height ); wxFrame::GetClientSize( width, height );
}; }
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{ {
return m_currentChild; return m_currentChild;
}; }
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
{ {
return m_clientWindow; return m_clientWindow;
}; }
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void) wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
{ {
m_clientWindow = new wxMDIClientWindow( this ); m_clientWindow = new wxMDIClientWindow( this );
return m_clientWindow; return m_clientWindow;
}; }
void wxMDIParentFrame::ActivateNext(void) void wxMDIParentFrame::ActivateNext(void)
{ {
if (m_clientWindow) if (m_clientWindow)
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) ); gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
}; }
void wxMDIParentFrame::ActivatePrevious(void) void wxMDIParentFrame::ActivatePrevious(void)
{ {
if (m_clientWindow) if (m_clientWindow)
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) ); gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
}; }
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) ) void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
{ {
}; }
void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) ) void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) )
{ {
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIChildFrame // wxMDIChildFrame
@@ -183,7 +183,7 @@ wxMDIChildFrame::wxMDIChildFrame(void)
{ {
m_menuBar = NULL; m_menuBar = NULL;
m_page = NULL; m_page = NULL;
}; }
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent, wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -193,7 +193,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
m_menuBar = NULL; m_menuBar = NULL;
m_page = NULL; m_page = NULL;
Create( parent, id, title, wxDefaultPosition, size, style, name ); Create( parent, id, title, wxDefaultPosition, size, style, name );
}; }
wxMDIChildFrame::~wxMDIChildFrame(void) wxMDIChildFrame::~wxMDIChildFrame(void)
{ {
@@ -204,10 +204,10 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
{ {
mdi_frame->SetMDIMenuBar( NULL ); mdi_frame->SetMDIMenuBar( NULL );
mdi_frame->m_currentChild = NULL; mdi_frame->m_currentChild = NULL;
}; }
delete m_menuBar; delete m_menuBar;
} }
}; }
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent, bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -216,7 +216,7 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
{ {
m_title = title; m_title = title;
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name ); return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
}; }
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{ {
@@ -238,8 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
if (menuitem->IsSubMenu()) if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win ); SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next(); node = node->Next();
}; }
}; }
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar ) void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{ {
@@ -257,7 +257,7 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
wxMenu *menu = (wxMenu*)node->Data(); wxMenu *menu = (wxMenu*)node->Data();
SetInvokingWindow( menu, this ); SetInvokingWindow( menu, this );
node = node->Next(); node = node->Next();
}; }
m_menuBar->m_parent = mdi_frame; m_menuBar->m_parent = mdi_frame;
} }
@@ -266,20 +266,20 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow), gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow),
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y ); m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
} }
}; }
wxMenuBar *wxMDIChildFrame::GetMenuBar() wxMenuBar *wxMDIChildFrame::GetMenuBar()
{ {
return m_menuBar; return m_menuBar;
}; }
void wxMDIChildFrame::Activate(void) void wxMDIChildFrame::Activate(void)
{ {
}; }
void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) ) void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
{ {
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIClientWindow // wxMDIClientWindow
@@ -289,16 +289,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
wxMDIClientWindow::wxMDIClientWindow(void) wxMDIClientWindow::wxMDIClientWindow(void)
{ {
}; }
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style ) wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
{ {
CreateClient( parent, style ); CreateClient( parent, style );
}; }
wxMDIClientWindow::~wxMDIClientWindow(void) wxMDIClientWindow::~wxMDIClientWindow(void)
{ {
}; }
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{ {
@@ -318,7 +318,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
}; }
void wxMDIClientWindow::AddChild( wxWindow *child ) void wxMDIClientWindow::AddChild( wxWindow *child )
{ {
@@ -326,7 +326,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
{ {
wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame"); wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame");
return; return;
}; }
m_children.Append( child ); m_children.Append( child );
@@ -349,6 +349,6 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 ); gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 );
gtk_page_change_callback( NULL, mdi_child->m_page, 0, this ); gtk_page_change_callback( NULL, mdi_child->m_page, 0, this );
}; }

View File

@@ -34,7 +34,7 @@ public:
m_page = NULL; m_page = NULL;
m_client = NULL; m_client = NULL;
m_parent = NULL; m_parent = NULL;
}; }
//private: //private:
int m_id; int m_id;
@@ -80,7 +80,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height)) (win->m_height == alloc->height))
{ {
return; return;
}; }
/* /*
printf( "OnResize from " ); printf( "OnResize from " );
@@ -104,7 +104,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
printf( " W: %d H: %d ", win->m_width, win->m_height ); printf( " W: %d H: %d ", win->m_width, win->m_height );
printf( " .\n" ); printf( " .\n" );
*/ */
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxNotebook // wxNotebook
@@ -122,7 +122,7 @@ void wxNotebook::Init()
wxNotebook::wxNotebook() wxNotebook::wxNotebook()
{ {
Init(); Init();
}; }
wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id, wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
@@ -130,7 +130,7 @@ wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
{ {
Init(); Init();
Create( parent, id, pos, size, style, name ); Create( parent, id, pos, size, style, name );
}; }
wxNotebook::~wxNotebook() wxNotebook::~wxNotebook()
{ {
@@ -139,7 +139,7 @@ wxNotebook::~wxNotebook()
gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler); gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler);
DeleteAllPages(); DeleteAllPages();
}; }
bool wxNotebook::Create(wxWindow *parent, wxWindowID id, bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
@@ -165,7 +165,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
}; }
int wxNotebook::GetSelection() const int wxNotebook::GetSelection() const
{ {
@@ -183,22 +183,22 @@ int wxNotebook::GetSelection() const
if (page->m_page == g_page) if (page->m_page == g_page)
break; break;
node = node->Next(); node = node->Next();
}; }
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" ); wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
return page->m_id; return page->m_id;
}; }
int wxNotebook::GetPageCount() const int wxNotebook::GetPageCount() const
{ {
return m_pages.Number(); return m_pages.Number();
}; }
int wxNotebook::GetRowCount() const int wxNotebook::GetRowCount() const
{ {
return 1; return 1;
}; }
wxString wxNotebook::GetPageText( int page ) const wxString wxNotebook::GetPageText( int page ) const
{ {
@@ -207,7 +207,7 @@ wxString wxNotebook::GetPageText( int page ) const
return nb_page->m_text; return nb_page->m_text;
else else
return ""; return "";
}; }
int wxNotebook::GetPageImage( int page ) const int wxNotebook::GetPageImage( int page ) const
{ {
@@ -216,7 +216,7 @@ int wxNotebook::GetPageImage( int page ) const
return nb_page->m_image; return nb_page->m_image;
else else
return 0; return 0;
}; }
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{ {
@@ -229,12 +229,12 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
if (nb_page->m_id == page) if (nb_page->m_id == page)
return nb_page; return nb_page;
node = node->Next(); node = node->Next();
}; }
wxLogDebug( "Notebook page %d not found!", page ); wxLogDebug( "Notebook page %d not found!", page );
return NULL; return NULL;
}; }
int wxNotebook::SetSelection( int page ) int wxNotebook::SetSelection( int page )
{ {
@@ -251,14 +251,14 @@ int wxNotebook::SetSelection( int page )
break; break;
page_num++; page_num++;
child = child->next; child = child->next;
}; }
if (!child) return -1; if (!child) return -1;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num ); gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
return selOld; return selOld;
}; }
void wxNotebook::AdvanceSelection(bool bForward) void wxNotebook::AdvanceSelection(bool bForward)
{ {
@@ -276,7 +276,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
void wxNotebook::SetImageList( wxImageList* imageList ) void wxNotebook::SetImageList( wxImageList* imageList )
{ {
m_imageList = imageList; m_imageList = imageList;
}; }
bool wxNotebook::SetPageText( int page, const wxString &text ) bool wxNotebook::SetPageText( int page, const wxString &text )
{ {
@@ -287,7 +287,7 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
nb_page->m_text = text; nb_page->m_text = text;
return TRUE; return TRUE;
}; }
bool wxNotebook::SetPageImage( int page, int image ) bool wxNotebook::SetPageImage( int page, int image )
{ {
@@ -298,17 +298,17 @@ bool wxNotebook::SetPageImage( int page, int image )
nb_page->m_image = image; nb_page->m_image = image;
return TRUE; return TRUE;
}; }
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) ) void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{ {
wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented")); wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented"));
}; }
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) ) void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{ {
wxFAIL_MSG(_("wxNotebook::SetPadding not implemented")); wxFAIL_MSG(_("wxNotebook::SetPadding not implemented"));
}; }
bool wxNotebook::DeleteAllPages() bool wxNotebook::DeleteAllPages()
{ {
@@ -320,10 +320,10 @@ bool wxNotebook::DeleteAllPages()
DeletePage( page->m_id ); DeletePage( page->m_id );
page_node = m_pages.First(); page_node = m_pages.First();
}; }
return TRUE; return TRUE;
}; }
bool wxNotebook::DeletePage( int page ) bool wxNotebook::DeletePage( int page )
{ {
@@ -337,7 +337,7 @@ bool wxNotebook::DeletePage( int page )
if (nb_page->m_page == (GtkNotebookPage*)child->data) break; if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
page_num++; page_num++;
child = child->next; child = child->next;
}; }
wxASSERT( child ); wxASSERT( child );
@@ -349,7 +349,7 @@ bool wxNotebook::DeletePage( int page )
m_pages.DeleteObject( nb_page ); m_pages.DeleteObject( nb_page );
return TRUE; return TRUE;
}; }
bool wxNotebook::AddPage(wxWindow* win, const wxString& text, bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool bSelect, int imageId) bool bSelect, int imageId)
@@ -367,7 +367,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
if ( page->m_client == win ) if ( page->m_client == win )
break; // found break; // found
node = node->Next(); node = node->Next();
}; }
wxCHECK_MSG(page != NULL, FALSE, wxCHECK_MSG(page != NULL, FALSE,
_("Can't add a page whose parent is not the notebook!")); _("Can't add a page whose parent is not the notebook!"));
@@ -384,7 +384,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
} }
return TRUE; return TRUE;
}; }
wxWindow *wxNotebook::GetPage( int page ) const wxWindow *wxNotebook::GetPage( int page ) const
{ {
@@ -393,7 +393,7 @@ wxWindow *wxNotebook::GetPage( int page ) const
return NULL; return NULL;
else else
return nb_page->m_client; return nb_page->m_client;
}; }
void wxNotebook::AddChild( wxWindow *win ) void wxNotebook::AddChild( wxWindow *win )
{ {
@@ -423,7 +423,7 @@ void wxNotebook::AddChild( wxWindow *win )
} }
m_pages.Append( page ); m_pages.Append( page );
}; }
// override these 2 functions to do nothing: everything is done in OnSize // override these 2 functions to do nothing: everything is done in OnSize
void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) ) void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )

View File

@@ -38,7 +38,7 @@ wxPenRefData::wxPenRefData(void)
m_style = wxSOLID; m_style = wxSOLID;
m_joinStyle = wxJOIN_ROUND; m_joinStyle = wxJOIN_ROUND;
m_capStyle = wxCAP_ROUND; m_capStyle = wxCAP_ROUND;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -49,7 +49,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
wxPen::wxPen(void) wxPen::wxPen(void)
{ {
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxColour &colour, int width, int style ) wxPen::wxPen( const wxColour &colour, int width, int style )
{ {
@@ -58,7 +58,7 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
M_PENDATA->m_colour = colour; M_PENDATA->m_colour = colour;
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxString &colourName, int width, int style ) wxPen::wxPen( const wxString &colourName, int width, int style )
{ {
@@ -67,42 +67,42 @@ wxPen::wxPen( const wxString &colourName, int width, int style )
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
M_PENDATA->m_colour = colourName; M_PENDATA->m_colour = colourName;
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxPen& pen ) wxPen::wxPen( const wxPen& pen )
{ {
Ref( pen ); Ref( pen );
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxPen* pen ) wxPen::wxPen( const wxPen* pen )
{ {
UnRef(); UnRef();
if (pen) Ref( *pen ); if (pen) Ref( *pen );
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::~wxPen(void) wxPen::~wxPen(void)
{ {
if (wxThePenList) wxThePenList->RemovePen( this ); if (wxThePenList) wxThePenList->RemovePen( this );
}; }
wxPen& wxPen::operator = ( const wxPen& pen ) wxPen& wxPen::operator = ( const wxPen& pen )
{ {
if (*this == pen) return (*this); if (*this == pen) return (*this);
Ref( pen ); Ref( pen );
return *this; return *this;
}; }
bool wxPen::operator == ( const wxPen& pen ) bool wxPen::operator == ( const wxPen& pen )
{ {
return m_refData == pen.m_refData; return m_refData == pen.m_refData;
}; }
bool wxPen::operator != ( const wxPen& pen ) bool wxPen::operator != ( const wxPen& pen )
{ {
return m_refData != pen.m_refData; return m_refData != pen.m_refData;
}; }
void wxPen::SetColour( const wxColour &colour ) void wxPen::SetColour( const wxColour &colour )
{ {
@@ -110,7 +110,7 @@ void wxPen::SetColour( const wxColour &colour )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour = colour; M_PENDATA->m_colour = colour;
}; }
void wxPen::SetColour( const wxString &colourName ) void wxPen::SetColour( const wxString &colourName )
{ {
@@ -118,7 +118,7 @@ void wxPen::SetColour( const wxString &colourName )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour = colourName; M_PENDATA->m_colour = colourName;
}; }
void wxPen::SetColour( int red, int green, int blue ) void wxPen::SetColour( int red, int green, int blue )
{ {
@@ -126,7 +126,7 @@ void wxPen::SetColour( int red, int green, int blue )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour.Set( red, green, blue ); M_PENDATA->m_colour.Set( red, green, blue );
}; }
void wxPen::SetCap( int capStyle ) void wxPen::SetCap( int capStyle )
{ {
@@ -134,7 +134,7 @@ void wxPen::SetCap( int capStyle )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_capStyle = capStyle; M_PENDATA->m_capStyle = capStyle;
}; }
void wxPen::SetJoin( int joinStyle ) void wxPen::SetJoin( int joinStyle )
{ {
@@ -142,7 +142,7 @@ void wxPen::SetJoin( int joinStyle )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_joinStyle = joinStyle; M_PENDATA->m_joinStyle = joinStyle;
}; }
void wxPen::SetStyle( int style ) void wxPen::SetStyle( int style )
{ {
@@ -150,7 +150,7 @@ void wxPen::SetStyle( int style )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
}; }
void wxPen::SetWidth( int width ) void wxPen::SetWidth( int width )
{ {
@@ -158,12 +158,12 @@ void wxPen::SetWidth( int width )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_width = width; M_PENDATA->m_width = width;
}; }
int wxPen::GetCap(void) const int wxPen::GetCap(void) const
{ {
return M_PENDATA->m_capStyle; return M_PENDATA->m_capStyle;
}; }
int wxPen::GetJoin(void) const int wxPen::GetJoin(void) const
{ {
@@ -171,7 +171,7 @@ int wxPen::GetJoin(void) const
return 0; return 0;
else else
return M_PENDATA->m_joinStyle; return M_PENDATA->m_joinStyle;
}; }
int wxPen::GetStyle(void) const int wxPen::GetStyle(void) const
{ {
@@ -179,7 +179,7 @@ int wxPen::GetStyle(void) const
return 0; return 0;
else else
return M_PENDATA->m_style; return M_PENDATA->m_style;
}; }
int wxPen::GetWidth(void) const int wxPen::GetWidth(void) const
{ {
@@ -187,7 +187,7 @@ int wxPen::GetWidth(void) const
return 0; return 0;
else else
return M_PENDATA->m_width; return M_PENDATA->m_width;
}; }
wxColour &wxPen::GetColour(void) const wxColour &wxPen::GetColour(void) const
{ {
@@ -195,10 +195,10 @@ wxColour &wxPen::GetColour(void) const
return wxNullColour; return wxNullColour;
else else
return M_PENDATA->m_colour; return M_PENDATA->m_colour;
}; }
bool wxPen::Ok(void) const bool wxPen::Ok(void) const
{ {
return (m_refData); return (m_refData);
}; }

View File

@@ -34,12 +34,12 @@ class wxRegionRefData: public wxObjectRefData
wxRegionRefData::wxRegionRefData(void) wxRegionRefData::wxRegionRefData(void)
{ {
m_region = NULL; m_region = NULL;
}; }
wxRegionRefData::~wxRegionRefData(void) wxRegionRefData::~wxRegionRefData(void)
{ {
if (m_region) gdk_region_destroy( m_region ); if (m_region) gdk_region_destroy( m_region );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -58,7 +58,7 @@ wxRegion::wxRegion( long x, long y, long w, long h )
rect.height = h; rect.height = h;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight ) wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
{ {
@@ -71,7 +71,7 @@ wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
rect.height = bottomRight.y - rect.y; rect.height = bottomRight.y - rect.y;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion( const wxRect& rect ) wxRegion::wxRegion( const wxRect& rect )
{ {
@@ -84,24 +84,24 @@ wxRegion::wxRegion( const wxRect& rect )
g_rect.height = rect.height; g_rect.height = rect.height;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion(void) wxRegion::wxRegion(void)
{ {
m_refData = new wxRegionRefData(); m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new(); M_REGIONDATA->m_region = gdk_region_new();
}; }
wxRegion::~wxRegion(void) wxRegion::~wxRegion(void)
{ {
}; }
void wxRegion::Clear(void) void wxRegion::Clear(void)
{ {
UnRef(); UnRef();
m_refData = new wxRegionRefData(); m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new(); M_REGIONDATA->m_region = gdk_region_new();
}; }
bool wxRegion::Union( long x, long y, long width, long height ) bool wxRegion::Union( long x, long y, long width, long height )
{ {
@@ -114,7 +114,7 @@ bool wxRegion::Union( long x, long y, long width, long height )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Union( const wxRect& rect ) bool wxRegion::Union( const wxRect& rect )
{ {
@@ -127,7 +127,7 @@ bool wxRegion::Union( const wxRect& rect )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Union( const wxRegion& region ) bool wxRegion::Union( const wxRegion& region )
{ {
@@ -135,21 +135,21 @@ bool wxRegion::Union( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( long x, long y, long width, long height ) bool wxRegion::Intersect( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Intersect( reg ); Intersect( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( const wxRect& rect ) bool wxRegion::Intersect( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Intersect( reg ); Intersect( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( const wxRegion& region ) bool wxRegion::Intersect( const wxRegion& region )
{ {
@@ -157,21 +157,21 @@ bool wxRegion::Intersect( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( long x, long y, long width, long height ) bool wxRegion::Subtract( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Subtract( reg ); Subtract( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( const wxRect& rect ) bool wxRegion::Subtract( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Subtract( reg ); Subtract( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( const wxRegion& region ) bool wxRegion::Subtract( const wxRegion& region )
{ {
@@ -179,21 +179,21 @@ bool wxRegion::Subtract( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( long x, long y, long width, long height ) bool wxRegion::Xor( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Xor( reg ); Xor( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( const wxRect& rect ) bool wxRegion::Xor( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Xor( reg ); Xor( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( const wxRegion& region ) bool wxRegion::Xor( const wxRegion& region )
{ {
@@ -201,7 +201,7 @@ bool wxRegion::Xor( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
{ {
@@ -209,17 +209,17 @@ void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
y = 0; y = 0;
w = -1; w = -1;
h = -1; h = -1;
}; }
wxRect wxRegion::GetBox(void) const wxRect wxRegion::GetBox(void) const
{ {
return wxRect( 0, 0, -1, -1 ); return wxRect( 0, 0, -1, -1 );
}; }
bool wxRegion::Empty(void) const bool wxRegion::Empty(void) const
{ {
return gdk_region_empty( M_REGIONDATA->m_region ); return gdk_region_empty( M_REGIONDATA->m_region );
}; }
wxRegionContain wxRegion::Contains( long x, long y ) const wxRegionContain wxRegion::Contains( long x, long y ) const
{ {
@@ -227,7 +227,7 @@ wxRegionContain wxRegion::Contains( long x, long y ) const
return wxInRegion; return wxInRegion;
else else
return wxOutRegion; return wxOutRegion;
}; }
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
{ {
@@ -242,12 +242,12 @@ wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion; case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion;
case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion; case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion;
case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion; case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion;
}; }
return wxOutRegion; return wxOutRegion;
}; }
GdkRegion *wxRegion::GetRegion(void) const GdkRegion *wxRegion::GetRegion(void) const
{ {
return M_REGIONDATA->m_region; return M_REGIONDATA->m_region;
}; }

View File

@@ -90,9 +90,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[0].red >> SHIFT, new wxColour( style->bg[0].red >> SHIFT,
style->bg[0].green >> SHIFT, style->bg[0].green >> SHIFT,
style->bg[0].blue >> SHIFT ); style->bg[0].blue >> SHIFT );
}; }
return *g_systemBtnFaceColour; return *g_systemBtnFaceColour;
}; }
case wxSYS_COLOUR_BTNSHADOW: case wxSYS_COLOUR_BTNSHADOW:
{ {
GtkStyle *style = gtk_widget_get_default_style(); GtkStyle *style = gtk_widget_get_default_style();
@@ -102,9 +102,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->dark[0].red >> SHIFT, new wxColour( style->dark[0].red >> SHIFT,
style->dark[0].green >> SHIFT, style->dark[0].green >> SHIFT,
style->dark[0].blue >> SHIFT ); style->dark[0].blue >> SHIFT );
}; }
return *g_systemBtnShadowColour; return *g_systemBtnShadowColour;
}; }
case wxSYS_COLOUR_GRAYTEXT: case wxSYS_COLOUR_GRAYTEXT:
case wxSYS_COLOUR_BTNHIGHLIGHT: case wxSYS_COLOUR_BTNHIGHLIGHT:
{ {
@@ -115,9 +115,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->light[0].red >> SHIFT, new wxColour( style->light[0].red >> SHIFT,
style->light[0].green >> SHIFT, style->light[0].green >> SHIFT,
style->light[0].blue >> SHIFT ); style->light[0].blue >> SHIFT );
}; }
return *g_systemBtnHighlightColour; return *g_systemBtnHighlightColour;
}; }
case wxSYS_COLOUR_HIGHLIGHT: case wxSYS_COLOUR_HIGHLIGHT:
{ {
GtkStyle *style = gtk_widget_get_default_style(); GtkStyle *style = gtk_widget_get_default_style();
@@ -127,9 +127,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT, new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT,
style->bg[GTK_STATE_SELECTED].green >> SHIFT, style->bg[GTK_STATE_SELECTED].green >> SHIFT,
style->bg[GTK_STATE_SELECTED].blue >> SHIFT ); style->bg[GTK_STATE_SELECTED].blue >> SHIFT );
}; }
return *g_systemHighlightColour; return *g_systemHighlightColour;
}; }
case wxSYS_COLOUR_MENUTEXT: case wxSYS_COLOUR_MENUTEXT:
case wxSYS_COLOUR_WINDOWTEXT: case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_CAPTIONTEXT: case wxSYS_COLOUR_CAPTIONTEXT:
@@ -137,19 +137,19 @@ wxColour wxSystemSettings::GetSystemColour( int index )
case wxSYS_COLOUR_INFOTEXT: case wxSYS_COLOUR_INFOTEXT:
{ {
return *wxBLACK; return *wxBLACK;
}; }
case wxSYS_COLOUR_HIGHLIGHTTEXT: case wxSYS_COLOUR_HIGHLIGHTTEXT:
{ {
return *wxWHITE; return *wxWHITE;
}; }
case wxSYS_COLOUR_INFOBK: case wxSYS_COLOUR_INFOBK:
case wxSYS_COLOUR_APPWORKSPACE: case wxSYS_COLOUR_APPWORKSPACE:
{ {
return *wxWHITE; // ? return *wxWHITE; // ?
}; }
}; }
return *wxWHITE; return *wxWHITE;
}; }
wxFont wxSystemSettings::GetSystemFont( int index ) wxFont wxSystemSettings::GetSystemFont( int index )
{ {
@@ -160,7 +160,7 @@ wxFont wxSystemSettings::GetSystemFont( int index )
case wxSYS_SYSTEM_FIXED_FONT: case wxSYS_SYSTEM_FIXED_FONT:
{ {
return *wxNORMAL_FONT; return *wxNORMAL_FONT;
}; }
case wxSYS_ANSI_VAR_FONT: case wxSYS_ANSI_VAR_FONT:
case wxSYS_SYSTEM_FONT: case wxSYS_SYSTEM_FONT:
case wxSYS_DEVICE_DEFAULT_FONT: case wxSYS_DEVICE_DEFAULT_FONT:
@@ -169,12 +169,11 @@ wxFont wxSystemSettings::GetSystemFont( int index )
if (!g_systemFont) if (!g_systemFont)
g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" ); g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
return *g_systemFont; return *g_systemFont;
}; }
}; }
return wxNullFont; return wxNullFont;
} }
;
int wxSystemSettings::GetSystemMetric( int index ) int wxSystemSettings::GetSystemMetric( int index )
{ {
@@ -184,8 +183,6 @@ int wxSystemSettings::GetSystemMetric( int index )
return gdk_screen_width(); return gdk_screen_width();
case wxSYS_SCREEN_Y: case wxSYS_SCREEN_Y:
return gdk_screen_height(); return gdk_screen_height();
}; }
return 0; return 0;
} }
;

View File

@@ -27,45 +27,45 @@ gint timeout_callback( gpointer data )
timer->Notify(); timer->Notify();
if (timer->OneShot()) timer->Stop(); if (timer->OneShot()) timer->Stop();
return TRUE; return TRUE;
}; }
wxTimer::wxTimer(void) wxTimer::wxTimer(void)
{ {
m_tag = -1; m_tag = -1;
m_time = 1000; m_time = 1000;
m_oneShot = FALSE; m_oneShot = FALSE;
}; }
wxTimer::~wxTimer(void) wxTimer::~wxTimer(void)
{ {
Stop(); Stop();
}; }
int wxTimer::Interval(void) int wxTimer::Interval(void)
{ {
return m_time; return m_time;
}; }
bool wxTimer::OneShot(void) bool wxTimer::OneShot(void)
{ {
return m_oneShot; return m_oneShot;
}; }
void wxTimer::Notify(void) void wxTimer::Notify(void)
{ {
}; }
void wxTimer::Start( int millisecs, bool oneShot ) void wxTimer::Start( int millisecs, bool oneShot )
{ {
if (millisecs != -1) m_time = millisecs; if (millisecs != -1) m_time = millisecs;
m_oneShot = oneShot; m_oneShot = oneShot;
m_tag = gtk_timeout_add( millisecs, timeout_callback, this ); m_tag = gtk_timeout_add( millisecs, timeout_callback, this );
}; }
void wxTimer::Stop(void) void wxTimer::Stop(void)
{ {
if (m_tag != -1) if (m_tag != -1)
gtk_timeout_remove( m_tag ); gtk_timeout_remove( m_tag );
m_tag = -1; m_tag = -1;
}; }

View File

@@ -52,13 +52,13 @@ extern void wxFlushResources(void);
void wxExit(void) void wxExit(void)
{ {
gtk_main_quit(); gtk_main_quit();
}; }
bool wxYield(void) bool wxYield(void)
{ {
while (gtk_events_pending() > 0) gtk_main_iteration(); while (gtk_events_pending() > 0) gtk_main_iteration();
return TRUE; return TRUE;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxApp // wxApp
@@ -72,38 +72,38 @@ END_EVENT_TABLE()
gint wxapp_idle_callback( gpointer WXUNUSED(data) ) gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{ {
if (wxTheApp) while (wxTheApp->ProcessIdle()) {}; if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
usleep( 10000 ); usleep( 10000 );
return TRUE; return TRUE;
}; }
wxApp::wxApp() wxApp::wxApp()
{ {
m_idleTag = 0; m_idleTag = 0;
m_topWindow = NULL; m_topWindow = NULL;
m_exitOnFrameDelete = TRUE; m_exitOnFrameDelete = TRUE;
}; }
wxApp::~wxApp(void) wxApp::~wxApp(void)
{ {
gtk_idle_remove( m_idleTag ); gtk_idle_remove( m_idleTag );
}; }
bool wxApp::OnInit(void) bool wxApp::OnInit(void)
{ {
return TRUE; return TRUE;
}; }
bool wxApp::OnInitGui(void) bool wxApp::OnInitGui(void)
{ {
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL ); m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE; return TRUE;
}; }
int wxApp::OnRun(void) int wxApp::OnRun(void)
{ {
return MainLoop(); return MainLoop();
}; }
bool wxApp::ProcessIdle(void) bool wxApp::ProcessIdle(void)
{ {
@@ -112,7 +112,7 @@ bool wxApp::ProcessIdle(void)
ProcessEvent( event ); ProcessEvent( event );
return event.MoreRequested(); return event.MoreRequested();
}; }
void wxApp::OnIdle( wxIdleEvent &event ) void wxApp::OnIdle( wxIdleEvent &event )
{ {
@@ -139,7 +139,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
event.RequestMore(TRUE); event.RequestMore(TRUE);
inOnIdle = FALSE; inOnIdle = FALSE;
}; }
bool wxApp::SendIdleEvents(void) bool wxApp::SendIdleEvents(void)
{ {
@@ -154,7 +154,7 @@ bool wxApp::SendIdleEvents(void)
node = node->Next(); node = node->Next();
} }
return needMore; return needMore;
}; }
bool wxApp::SendIdleEvents( wxWindow* win ) bool wxApp::SendIdleEvents( wxWindow* win )
{ {
@@ -177,37 +177,37 @@ bool wxApp::SendIdleEvents( wxWindow* win )
node = node->Next(); node = node->Next();
} }
return needMore ; return needMore ;
}; }
int wxApp::OnExit(void) int wxApp::OnExit(void)
{ {
return 0; return 0;
}; }
int wxApp::MainLoop(void) int wxApp::MainLoop(void)
{ {
gtk_main(); gtk_main();
return 0; return 0;
}; }
void wxApp::ExitMainLoop(void) void wxApp::ExitMainLoop(void)
{ {
gtk_main_quit(); gtk_main_quit();
}; }
bool wxApp::Initialized(void) bool wxApp::Initialized(void)
{ {
return m_initialized; return m_initialized;
}; }
bool wxApp::Pending(void) bool wxApp::Pending(void)
{ {
return FALSE; return FALSE;
}; }
void wxApp::Dispatch(void) void wxApp::Dispatch(void)
{ {
}; }
void wxApp::DeletePendingObjects(void) void wxApp::DeletePendingObjects(void)
{ {
@@ -222,8 +222,8 @@ void wxApp::DeletePendingObjects(void)
delete node; delete node;
node = wxPendingDelete.First(); node = wxPendingDelete.First();
}; }
}; }
wxWindow *wxApp::GetTopWindow(void) wxWindow *wxApp::GetTopWindow(void)
{ {
@@ -231,12 +231,12 @@ wxWindow *wxApp::GetTopWindow(void)
wxNode *node = wxTopLevelWindows.First(); wxNode *node = wxTopLevelWindows.First();
if (!node) return NULL; if (!node) return NULL;
return (wxWindow*)node->Data(); return (wxWindow*)node->Data();
}; }
void wxApp::SetTopWindow( wxWindow *win ) void wxApp::SetTopWindow( wxWindow *win )
{ {
m_topWindow = win; m_topWindow = win;
}; }
void wxApp::CommonInit(void) void wxApp::CommonInit(void)
{ {
@@ -273,7 +273,7 @@ void wxApp::CommonInit(void)
g_globalCursor = new wxCursor; g_globalCursor = new wxCursor;
*/ */
}; }
void wxApp::CommonCleanUp(void) void wxApp::CommonCleanUp(void)
{ {
@@ -292,7 +292,7 @@ void wxApp::CommonCleanUp(void)
wxCleanUpResourceSystem(); wxCleanUpResourceSystem();
wxSystemSettings::Done(); wxSystemSettings::Done();
}; }
wxLog *wxApp::CreateLogTarget() wxLog *wxApp::CreateLogTarget()
{ {
@@ -327,20 +327,20 @@ int wxEntry( int argc, char *argv[] )
{ {
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0; return 0;
}; }
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction(); wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini(); wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app; wxTheApp = (wxApp*) test_app;
}; }
if (!wxTheApp) if (!wxTheApp)
{ {
printf( _("wxWindows error: wxTheApp == NULL\n") ); printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0; return 0;
}; }
wxTheApp->argc = argc; wxTheApp->argc = argc;
wxTheApp->argv = argv; wxTheApp->argv = argv;
@@ -396,7 +396,7 @@ int wxEntry( int argc, char *argv[] )
#endif #endif
return retValue; return retValue;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// main() // main()

View File

@@ -28,19 +28,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxMask,wxObject)
wxMask::wxMask(void) wxMask::wxMask(void)
{ {
m_bitmap = NULL; m_bitmap = NULL;
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) )
{ {
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) )
{ {
}; }
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) ) wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
{ {
}; }
wxMask::~wxMask(void) wxMask::~wxMask(void)
{ {
@@ -49,12 +49,12 @@ wxMask::~wxMask(void)
#else #else
if (m_bitmap) gdk_bitmap_unref( m_bitmap ); if (m_bitmap) gdk_bitmap_unref( m_bitmap );
#endif #endif
}; }
GdkBitmap *wxMask::GetBitmap(void) const GdkBitmap *wxMask::GetBitmap(void) const
{ {
return m_bitmap; return m_bitmap;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxBitmap // wxBitmap
@@ -92,7 +92,7 @@ wxBitmapRefData::wxBitmapRefData(void)
#ifdef USE_GDK_IMLIB #ifdef USE_GDK_IMLIB
m_image = NULL; m_image = NULL;
#endif #endif
}; }
wxBitmapRefData::~wxBitmapRefData(void) wxBitmapRefData::~wxBitmapRefData(void)
{ {
@@ -105,7 +105,7 @@ wxBitmapRefData::~wxBitmapRefData(void)
if (m_bitmap) gdk_bitmap_unref( m_bitmap ); if (m_bitmap) gdk_bitmap_unref( m_bitmap );
if (m_mask) delete m_mask; if (m_mask) delete m_mask;
if (m_palette) delete m_palette; if (m_palette) delete m_palette;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -116,7 +116,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxBitmap::wxBitmap(void) wxBitmap::wxBitmap(void)
{ {
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( int width, int height, int depth )
{ {
@@ -129,7 +129,7 @@ wxBitmap::wxBitmap( int width, int height, int depth )
M_BMPDATA->m_bpp = depth; M_BMPDATA->m_bpp = depth;
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( char **bits ) wxBitmap::wxBitmap( char **bits )
{ {
@@ -146,7 +146,7 @@ wxBitmap::wxBitmap( char **bits )
{ {
M_BMPDATA->m_mask = new wxMask(); M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask; M_BMPDATA->m_mask->m_bitmap = mask;
}; }
gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) ); gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
@@ -160,26 +160,28 @@ wxBitmap::wxBitmap( char **bits )
M_BMPDATA->m_bpp = 24; // ? M_BMPDATA->m_bpp = 24; // ?
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxBitmap& bmp ) wxBitmap::wxBitmap( const wxBitmap& bmp )
{ {
Ref( bmp ); Ref( bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxBitmap* bmp ) wxBitmap::wxBitmap( const wxBitmap* bmp )
{ {
if (bmp) Ref( *bmp ); if (bmp) Ref( *bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}; }
wxBitmap::wxBitmap( const wxString &filename, int type ) wxBitmap::wxBitmap( const wxString &filename, int type )
{ {
LoadFile( filename, type ); LoadFile( filename, type );
};
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
// CMB 15/5/98: add constructor for xbm bitmaps // CMB 15/5/98: add constructor for xbm bitmaps
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth)) wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
@@ -199,72 +201,72 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth
wxBitmap::~wxBitmap(void) wxBitmap::~wxBitmap(void)
{ {
if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this); if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
}; }
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp ) wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{ {
if (*this == bmp) return (*this); if (*this == bmp) return (*this);
Ref( bmp ); Ref( bmp );
return *this; return *this;
}; }
bool wxBitmap::operator == ( const wxBitmap& bmp ) bool wxBitmap::operator == ( const wxBitmap& bmp )
{ {
return m_refData == bmp.m_refData; return m_refData == bmp.m_refData;
}; }
bool wxBitmap::operator != ( const wxBitmap& bmp ) bool wxBitmap::operator != ( const wxBitmap& bmp )
{ {
return m_refData != bmp.m_refData; return m_refData != bmp.m_refData;
}; }
bool wxBitmap::Ok(void) const bool wxBitmap::Ok(void) const
{ {
return m_refData != NULL; return m_refData != NULL;
}; }
int wxBitmap::GetHeight(void) const int wxBitmap::GetHeight(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_height; return M_BMPDATA->m_height;
}; }
int wxBitmap::GetWidth(void) const int wxBitmap::GetWidth(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_width; return M_BMPDATA->m_width;
}; }
int wxBitmap::GetDepth(void) const int wxBitmap::GetDepth(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_BMPDATA->m_bpp; return M_BMPDATA->m_bpp;
}; }
void wxBitmap::SetHeight( int height ) void wxBitmap::SetHeight( int height )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_height = height; M_BMPDATA->m_height = height;
}; }
void wxBitmap::SetWidth( int width ) void wxBitmap::SetWidth( int width )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_width = width; M_BMPDATA->m_width = width;
}; }
void wxBitmap::SetDepth( int depth ) void wxBitmap::SetDepth( int depth )
{ {
if (!Ok()) return; if (!Ok()) return;
M_BMPDATA->m_bpp = depth; M_BMPDATA->m_bpp = depth;
}; }
wxMask *wxBitmap::GetMask(void) const wxMask *wxBitmap::GetMask(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_mask; return M_BMPDATA->m_mask;
}; }
void wxBitmap::SetMask( wxMask *mask ) void wxBitmap::SetMask( wxMask *mask )
{ {
@@ -272,7 +274,7 @@ void wxBitmap::SetMask( wxMask *mask )
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
M_BMPDATA->m_mask = mask; M_BMPDATA->m_mask = mask;
}; }
void wxBitmap::Resize( int height, int width ) void wxBitmap::Resize( int height, int width )
{ {
@@ -296,7 +298,7 @@ void wxBitmap::Resize( int height, int width )
Render(); Render();
#endif #endif
}; }
bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type), bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
wxPalette *WXUNUSED(palette) ) wxPalette *WXUNUSED(palette) )
@@ -312,7 +314,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
#endif #endif
return FALSE; return FALSE;
}; }
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) ) bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{ {
@@ -327,7 +329,7 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{ {
UnRef(); UnRef();
return FALSE; return FALSE;
}; }
Render(); Render();
@@ -338,26 +340,26 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
#endif #endif
return FALSE; return FALSE;
}; }
wxPalette *wxBitmap::GetPalette(void) const wxPalette *wxBitmap::GetPalette(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_palette; return M_BMPDATA->m_palette;
}; }
GdkPixmap *wxBitmap::GetPixmap(void) const GdkPixmap *wxBitmap::GetPixmap(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_pixmap; return M_BMPDATA->m_pixmap;
}; }
GdkBitmap *wxBitmap::GetBitmap(void) const GdkBitmap *wxBitmap::GetBitmap(void) const
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return M_BMPDATA->m_bitmap; return M_BMPDATA->m_bitmap;
}; }
void wxBitmap::DestroyImage(void) void wxBitmap::DestroyImage(void)
{ {
@@ -367,12 +369,12 @@ void wxBitmap::DestroyImage(void)
{ {
gdk_imlib_destroy_image( M_BMPDATA->m_image ); gdk_imlib_destroy_image( M_BMPDATA->m_image );
M_BMPDATA->m_image = NULL; M_BMPDATA->m_image = NULL;
}; }
}; }
void wxBitmap::RecreateImage(void) void wxBitmap::RecreateImage(void)
{ {
}; }
void wxBitmap::Render(void) void wxBitmap::Render(void)
{ {
@@ -389,9 +391,9 @@ void wxBitmap::Render(void)
{ {
M_BMPDATA->m_mask = new wxMask(); M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask; M_BMPDATA->m_mask->m_bitmap = mask;
}; }
#endif #endif
}; }

View File

@@ -32,7 +32,7 @@ class wxBrushRefData: public wxObjectRefData
wxBrushRefData::wxBrushRefData(void) wxBrushRefData::wxBrushRefData(void)
{ {
m_style = 0; m_style = 0;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -43,7 +43,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
wxBrush::wxBrush(void) wxBrush::wxBrush(void)
{ {
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxColour &colour, int style ) wxBrush::wxBrush( const wxColour &colour, int style )
{ {
@@ -52,7 +52,7 @@ wxBrush::wxBrush( const wxColour &colour, int style )
M_BRUSHDATA->m_colour = colour; M_BRUSHDATA->m_colour = colour;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxString &colourName, int style ) wxBrush::wxBrush( const wxString &colourName, int style )
{ {
@@ -61,7 +61,7 @@ wxBrush::wxBrush( const wxString &colourName, int style )
M_BRUSHDATA->m_colour = colourName; M_BRUSHDATA->m_colour = colourName;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBitmap &stippleBitmap ) wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{ {
@@ -71,62 +71,62 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
M_BRUSHDATA->m_stipple = stippleBitmap; M_BRUSHDATA->m_stipple = stippleBitmap;
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBrush &brush ) wxBrush::wxBrush( const wxBrush &brush )
{ {
Ref( brush ); Ref( brush );
if (wxTheBrushList) wxTheBrushList->AddBrush( this ); if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}; }
wxBrush::wxBrush( const wxBrush *brush ) wxBrush::wxBrush( const wxBrush *brush )
{ {
if (brush) Ref( *brush ); if (brush) Ref( *brush );
if (wxTheBrushList) wxTheBrushList->Append( this ); if (wxTheBrushList) wxTheBrushList->Append( this );
}; }
wxBrush::~wxBrush(void) wxBrush::~wxBrush(void)
{ {
if (wxTheBrushList) wxTheBrushList->RemoveBrush( this ); if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
}; }
wxBrush& wxBrush::operator = ( const wxBrush& brush ) wxBrush& wxBrush::operator = ( const wxBrush& brush )
{ {
if (*this == brush) return (*this); if (*this == brush) return (*this);
Ref( brush ); Ref( brush );
return *this; return *this;
}; }
bool wxBrush::operator == ( const wxBrush& brush ) bool wxBrush::operator == ( const wxBrush& brush )
{ {
return m_refData == brush.m_refData; return m_refData == brush.m_refData;
}; }
bool wxBrush::operator != ( const wxBrush& brush ) bool wxBrush::operator != ( const wxBrush& brush )
{ {
return m_refData != brush.m_refData; return m_refData != brush.m_refData;
}; }
bool wxBrush::Ok(void) const bool wxBrush::Ok(void) const
{ {
return ((m_refData) && M_BRUSHDATA->m_colour.Ok()); return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
}; }
int wxBrush::GetStyle(void) const int wxBrush::GetStyle(void) const
{ {
return M_BRUSHDATA->m_style; return M_BRUSHDATA->m_style;
}; }
wxColour &wxBrush::GetColour(void) const wxColour &wxBrush::GetColour(void) const
{ {
return M_BRUSHDATA->m_colour; return M_BRUSHDATA->m_colour;
}; }
wxBitmap *wxBrush::GetStipple(void) const wxBitmap *wxBrush::GetStipple(void) const
{ {
return &M_BRUSHDATA->m_stipple; return &M_BRUSHDATA->m_stipple;
}; }

View File

@@ -46,17 +46,17 @@ wxColourRefData::wxColourRefData(void)
m_color.pixel = 0; m_color.pixel = 0;
m_colormap = NULL; m_colormap = NULL;
m_hasPixel = FALSE; m_hasPixel = FALSE;
}; }
wxColourRefData::~wxColourRefData(void) wxColourRefData::~wxColourRefData(void)
{ {
FreeColour(); FreeColour();
}; }
void wxColourRefData::FreeColour(void) void wxColourRefData::FreeColour(void)
{ {
// if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 ); // if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -68,7 +68,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
wxColour::wxColour(void) wxColour::wxColour(void)
{ {
}; }
wxColour::wxColour( char red, char green, char blue ) wxColour::wxColour( char red, char green, char blue )
{ {
@@ -77,7 +77,7 @@ wxColour::wxColour( char red, char green, char blue )
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT; M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT; M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0; M_COLDATA->m_color.pixel = 0;
}; }
wxColour::wxColour( const wxString &colourName ) wxColour::wxColour( const wxString &colourName )
{ {
@@ -96,30 +96,30 @@ wxColour::wxColour( const wxString &colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" ); wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData; delete m_refData;
m_refData = NULL; m_refData = NULL;
}; }
}; }
}; }
wxColour::wxColour( const wxColour& col ) wxColour::wxColour( const wxColour& col )
{ {
Ref( col ); Ref( col );
}; }
wxColour::wxColour( const wxColour* col ) wxColour::wxColour( const wxColour* col )
{ {
if (col) Ref( *col ); if (col) Ref( *col );
}; }
wxColour::~wxColour(void) wxColour::~wxColour(void)
{ {
}; }
wxColour& wxColour::operator = ( const wxColour& col ) wxColour& wxColour::operator = ( const wxColour& col )
{ {
if (*this == col) return (*this); if (*this == col) return (*this);
Ref( col ); Ref( col );
return *this; return *this;
}; }
wxColour& wxColour::operator = ( const wxString& colourName ) wxColour& wxColour::operator = ( const wxString& colourName )
{ {
@@ -138,20 +138,20 @@ wxColour& wxColour::operator = ( const wxString& colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" ); wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData; delete m_refData;
m_refData = NULL; m_refData = NULL;
}; }
}; }
return *this; return *this;
}; }
bool wxColour::operator == ( const wxColour& col ) bool wxColour::operator == ( const wxColour& col )
{ {
return m_refData == col.m_refData; return m_refData == col.m_refData;
}; }
bool wxColour::operator != ( const wxColour& col) bool wxColour::operator != ( const wxColour& col)
{ {
return m_refData != col.m_refData; return m_refData != col.m_refData;
}; }
void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue ) void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue )
{ {
@@ -161,30 +161,30 @@ void wxColour::Set( const unsigned char red, const unsigned char green, const un
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT; M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT; M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0; M_COLDATA->m_color.pixel = 0;
}; }
unsigned char wxColour::Red(void) const unsigned char wxColour::Red(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}; }
unsigned char wxColour::Green(void) const unsigned char wxColour::Green(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}; }
unsigned char wxColour::Blue(void) const unsigned char wxColour::Blue(void) const
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}; }
bool wxColour::Ok(void) const bool wxColour::Ok(void) const
{ {
return (m_refData); return (m_refData);
}; }
void wxColour::CalcPixel( GdkColormap *cmap ) void wxColour::CalcPixel( GdkColormap *cmap )
{ {
@@ -208,20 +208,20 @@ void wxColour::CalcPixel( GdkColormap *cmap )
#endif #endif
M_COLDATA->m_colormap = cmap; M_COLDATA->m_colormap = cmap;
}; }
int wxColour::GetPixel(void) int wxColour::GetPixel(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
return M_COLDATA->m_color.pixel; return M_COLDATA->m_color.pixel;
}; }
GdkColor *wxColour::GetColor(void) GdkColor *wxColour::GetColor(void)
{ {
if (!Ok()) return NULL; if (!Ok()) return NULL;
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
}; }

View File

@@ -32,12 +32,12 @@ class wxCursorRefData: public wxObjectRefData
wxCursorRefData::wxCursorRefData(void) wxCursorRefData::wxCursorRefData(void)
{ {
m_cursor = NULL; m_cursor = NULL;
}; }
wxCursorRefData::~wxCursorRefData(void) wxCursorRefData::~wxCursorRefData(void)
{ {
if (m_cursor) gdk_cursor_destroy( m_cursor ); if (m_cursor) gdk_cursor_destroy( m_cursor );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -47,7 +47,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject)
wxCursor::wxCursor(void) wxCursor::wxCursor(void)
{ {
}; }
wxCursor::wxCursor( int cursorId ) wxCursor::wxCursor( int cursorId )
{ {
@@ -67,7 +67,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break; case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break;
case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break; case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break;
case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break; case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break;
}; }
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur ); M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
@@ -97,49 +97,49 @@ wxCursor::wxCursor( int cursorId )
wxCURSOR_BASED_ARROW_DOWN wxCURSOR_BASED_ARROW_DOWN
*/ */
}; }
wxCursor::wxCursor( const wxCursor &cursor ) wxCursor::wxCursor( const wxCursor &cursor )
{ {
Ref( cursor ); Ref( cursor );
}; }
wxCursor::wxCursor( const wxCursor *cursor ) wxCursor::wxCursor( const wxCursor *cursor )
{ {
UnRef(); UnRef();
if (cursor) Ref( *cursor ); if (cursor) Ref( *cursor );
}; }
wxCursor::~wxCursor(void) wxCursor::~wxCursor(void)
{ {
}; }
wxCursor& wxCursor::operator = ( const wxCursor& cursor ) wxCursor& wxCursor::operator = ( const wxCursor& cursor )
{ {
if (*this == cursor) return (*this); if (*this == cursor) return (*this);
Ref( cursor ); Ref( cursor );
return *this; return *this;
}; }
bool wxCursor::operator == ( const wxCursor& cursor ) bool wxCursor::operator == ( const wxCursor& cursor )
{ {
return m_refData == cursor.m_refData; return m_refData == cursor.m_refData;
}; }
bool wxCursor::operator != ( const wxCursor& cursor ) bool wxCursor::operator != ( const wxCursor& cursor )
{ {
return m_refData != cursor.m_refData; return m_refData != cursor.m_refData;
}; }
bool wxCursor::Ok(void) const bool wxCursor::Ok(void) const
{ {
return TRUE; return TRUE;
}; }
GdkCursor *wxCursor::GetCursor(void) const GdkCursor *wxCursor::GetCursor(void) const
{ {
return M_CURSORDATA->m_cursor; return M_CURSORDATA->m_cursor;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// busy cursor routines // busy cursor routines
@@ -150,24 +150,24 @@ bool g_isBusy = FALSE;
void wxEndBusyCursor(void) void wxEndBusyCursor(void)
{ {
g_isBusy = FALSE; g_isBusy = FALSE;
}; }
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
{ {
g_isBusy = TRUE; g_isBusy = TRUE;
}; }
bool wxIsBusy(void) bool wxIsBusy(void)
{ {
return g_isBusy; return g_isBusy;
}; }
void wxSetCursor( const wxCursor& cursor ) void wxSetCursor( const wxCursor& cursor )
{ {
extern wxCursor *g_globalCursor; extern wxCursor *g_globalCursor;
if (g_globalCursor) (*g_globalCursor) = cursor; if (g_globalCursor) (*g_globalCursor) = cursor;
if (cursor.Ok()) {}; if (cursor.Ok()) {}
}; }

View File

@@ -77,25 +77,25 @@ wxDC::wxDC(void)
m_backgroundBrush = *wxWHITE_BRUSH; m_backgroundBrush = *wxWHITE_BRUSH;
// m_palette = wxAPP_COLOURMAP; // m_palette = wxAPP_COLOURMAP;
}; }
wxDC::~wxDC(void) wxDC::~wxDC(void)
{ {
}; }
void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2), void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2),
double WXUNUSED(xc), double WXUNUSED(yc) ) double WXUNUSED(xc), double WXUNUSED(yc) )
{ {
}; }
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) ) void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
{ {
}; }
void wxDC::DrawPoint( wxPoint& point ) void wxDC::DrawPoint( wxPoint& point )
{ {
DrawPoint( point.x, point.y ); DrawPoint( point.x, point.y );
}; }
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle ) void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
{ {
@@ -108,10 +108,10 @@ void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x; points[i].x = point->x;
points[i++].y = point->y; points[i++].y = point->y;
}; }
DrawPolygon( n, points, xoffset, yoffset, fillStyle ); DrawPolygon( n, points, xoffset, yoffset, fillStyle );
delete[] points; delete[] points;
}; }
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset ) void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
{ {
@@ -124,10 +124,10 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x; points[i].x = point->x;
points[i++].y = point->y; points[i++].y = point->y;
}; }
DrawLines( n, points, xoffset, yoffset ); DrawLines( n, points, xoffset, yoffset );
delete []points; delete []points;
}; }
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ) void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
{ {
@@ -142,20 +142,20 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
wxPoint *p = (wxPoint*)node->Data(); wxPoint *p = (wxPoint*)node->Data();
delete p; delete p;
node = node->Next(); node = node->Next();
}; }
}; }
void wxDC::DrawSpline( wxList *points ) void wxDC::DrawSpline( wxList *points )
{ {
DrawOpenSpline( points ); DrawOpenSpline( points );
}; }
void wxDC::DrawSpline( int n, wxPoint points[] ) void wxDC::DrawSpline( int n, wxPoint points[] )
{ {
wxList list; wxList list;
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] ); for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
DrawSpline( &list ); DrawSpline( &list );
}; }
void wxDC::SetClippingRegion( long x, long y, long width, long height ) void wxDC::SetClippingRegion( long x, long y, long width, long height )
{ {
@@ -164,12 +164,12 @@ void wxDC::SetClippingRegion( long x, long y, long width, long height )
m_clipY1 = y; m_clipY1 = y;
m_clipX2 = x + width; m_clipX2 = x + width;
m_clipY2 = y + height; m_clipY2 = y + height;
}; }
void wxDC::DestroyClippingRegion(void) void wxDC::DestroyClippingRegion(void)
{ {
m_clipping = FALSE; m_clipping = FALSE;
}; }
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
{ {
@@ -182,13 +182,13 @@ void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
} }
else else
*x = *y = *width = *height = 0; *x = *y = *width = *height = 0;
}; }
void wxDC::GetSize( int* width, int* height ) const void wxDC::GetSize( int* width, int* height ) const
{ {
*width = m_maxX-m_minX; *width = m_maxX-m_minX;
*height = m_maxY-m_minY; *height = m_maxY-m_minY;
}; }
void wxDC::GetSizeMM( long* width, long* height ) const void wxDC::GetSizeMM( long* width, long* height ) const
{ {
@@ -197,19 +197,19 @@ void wxDC::GetSizeMM( long* width, long* height ) const
GetSize( &w, &h ); GetSize( &w, &h );
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) ); *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) ); *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
}; }
void wxDC::SetTextForeground( const wxColour &col ) void wxDC::SetTextForeground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
m_textForegroundColour = col; m_textForegroundColour = col;
}; }
void wxDC::SetTextBackground( const wxColour &col ) void wxDC::SetTextBackground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
m_textBackgroundColour = col; m_textBackgroundColour = col;
}; }
void wxDC::SetMapMode( int mode ) void wxDC::SetMapMode( int mode )
{ {
@@ -231,13 +231,13 @@ void wxDC::SetMapMode( int mode )
case MM_TEXT: case MM_TEXT:
SetLogicalScale( 1.0, 1.0 ); SetLogicalScale( 1.0, 1.0 );
break; break;
}; }
if (mode != MM_TEXT) if (mode != MM_TEXT)
{ {
m_needComputeScaleX = TRUE; m_needComputeScaleX = TRUE;
m_needComputeScaleY = TRUE; m_needComputeScaleY = TRUE;
}; }
}; }
void wxDC::SetUserScale( double x, double y ) void wxDC::SetUserScale( double x, double y )
{ {
@@ -245,13 +245,13 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleX = x; m_userScaleX = x;
m_userScaleY = y; m_userScaleY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetUserScale( double *x, double *y ) void wxDC::GetUserScale( double *x, double *y )
{ {
if (x) *x = m_userScaleX; if (x) *x = m_userScaleX;
if (y) *y = m_userScaleY; if (y) *y = m_userScaleY;
}; }
void wxDC::SetLogicalScale( double x, double y ) void wxDC::SetLogicalScale( double x, double y )
{ {
@@ -259,86 +259,86 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleX = x; m_logicalScaleX = x;
m_logicalScaleY = y; m_logicalScaleY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetLogicalScale( double *x, double *y ) void wxDC::GetLogicalScale( double *x, double *y )
{ {
if (x) *x = m_logicalScaleX; if (x) *x = m_logicalScaleX;
if (y) *y = m_logicalScaleY; if (y) *y = m_logicalScaleY;
}; }
void wxDC::SetLogicalOrigin( long x, long y ) void wxDC::SetLogicalOrigin( long x, long y )
{ {
m_logicalOriginX = x * m_signX; // is this still correct ? m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY; m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetLogicalOrigin( long *x, long *y ) void wxDC::GetLogicalOrigin( long *x, long *y )
{ {
if (x) *x = m_logicalOriginX; if (x) *x = m_logicalOriginX;
if (y) *y = m_logicalOriginY; if (y) *y = m_logicalOriginY;
}; }
void wxDC::SetDeviceOrigin( long x, long y ) void wxDC::SetDeviceOrigin( long x, long y )
{ {
m_deviceOriginX = x; m_deviceOriginX = x;
m_deviceOriginY = y; m_deviceOriginY = y;
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
void wxDC::GetDeviceOrigin( long *x, long *y ) void wxDC::GetDeviceOrigin( long *x, long *y )
{ {
if (x) *x = m_deviceOriginX; if (x) *x = m_deviceOriginX;
if (y) *y = m_deviceOriginY; if (y) *y = m_deviceOriginY;
}; }
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{ {
m_signX = (xLeftRight ? 1 : -1); m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1); m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin(); ComputeScaleAndOrigin();
}; }
long wxDC::DeviceToLogicalX(long x) const long wxDC::DeviceToLogicalX(long x) const
{ {
return XDEV2LOG(x); return XDEV2LOG(x);
}; }
long wxDC::DeviceToLogicalY(long y) const long wxDC::DeviceToLogicalY(long y) const
{ {
return YDEV2LOG(y); return YDEV2LOG(y);
}; }
long wxDC::DeviceToLogicalXRel(long x) const long wxDC::DeviceToLogicalXRel(long x) const
{ {
return XDEV2LOGREL(x); return XDEV2LOGREL(x);
}; }
long wxDC::DeviceToLogicalYRel(long y) const long wxDC::DeviceToLogicalYRel(long y) const
{ {
return YDEV2LOGREL(y); return YDEV2LOGREL(y);
}; }
long wxDC::LogicalToDeviceX(long x) const long wxDC::LogicalToDeviceX(long x) const
{ {
return XLOG2DEV(x); return XLOG2DEV(x);
}; }
long wxDC::LogicalToDeviceY(long y) const long wxDC::LogicalToDeviceY(long y) const
{ {
return YLOG2DEV(y); return YLOG2DEV(y);
}; }
long wxDC::LogicalToDeviceXRel(long x) const long wxDC::LogicalToDeviceXRel(long x) const
{ {
return XLOG2DEVREL(x); return XLOG2DEVREL(x);
}; }
long wxDC::LogicalToDeviceYRel(long y) const long wxDC::LogicalToDeviceYRel(long y) const
{ {
return YLOG2DEVREL(y); return YLOG2DEVREL(y);
}; }
void wxDC::CalcBoundingBox( long x, long y ) void wxDC::CalcBoundingBox( long x, long y )
{ {
@@ -346,7 +346,7 @@ void wxDC::CalcBoundingBox( long x, long y )
if (y < m_minY) m_minY = y; if (y < m_minY) m_minY = y;
if (x > m_maxX) m_maxX = x; if (x > m_maxX) m_maxX = x;
if (y > m_maxY) m_maxY = y; if (y > m_maxY) m_maxY = y;
}; }
void wxDC::ComputeScaleAndOrigin(void) void wxDC::ComputeScaleAndOrigin(void)
{ {
@@ -367,5 +367,5 @@ void wxDC::ComputeScaleAndOrigin(void)
m_pen = tempPen; m_pen = tempPen;
SetPen(pen); SetPen(pen);
} }
}; }

View File

@@ -24,17 +24,17 @@ wxMemoryDC::wxMemoryDC(void)
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gdk_colormap_get_system(); m_cmap = gdk_colormap_get_system();
}; }
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gdk_colormap_get_system(); m_cmap = gdk_colormap_get_system();
}; }
wxMemoryDC::~wxMemoryDC(void) wxMemoryDC::~wxMemoryDC(void)
{ {
}; }
void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{ {
@@ -58,8 +58,8 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{ {
m_ok = FALSE; m_ok = FALSE;
m_window = NULL; m_window = NULL;
}; }
}; }
void wxMemoryDC::GetSize( int *width, int *height ) const void wxMemoryDC::GetSize( int *width, int *height ) const
{ {
@@ -72,7 +72,7 @@ void wxMemoryDC::GetSize( int *width, int *height ) const
{ {
if (width) (*width) = 0; if (width) (*width) = 0;
if (height) (*height) = 0; if (height) (*height) = 0;
}; }
}; }

View File

@@ -36,12 +36,12 @@ wxScreenDC::wxScreenDC(void)
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}; }
wxScreenDC::~wxScreenDC(void) wxScreenDC::~wxScreenDC(void)
{ {
EndDrawingOnTop(); EndDrawingOnTop();
}; }
bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) ) bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{ {
@@ -51,7 +51,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{ {
StartDrawingOnTop(); StartDrawingOnTop();
return; return;
}; }
wxRectangle rect; wxRectangle rect;
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
@@ -63,7 +63,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
StartDrawingOnTop( &rect ); StartDrawingOnTop( &rect );
return TRUE; return TRUE;
*/ */
}; }
bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) ) bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
{ {
@@ -79,7 +79,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
y = rect->y; y = rect->y;
width = rect->width; width = rect->width;
height = rect->height; height = rect->height;
}; }
GTK cannot set transparent backgrounds. :-( GTK cannot set transparent backgrounds. :-(
@@ -107,7 +107,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
return TRUE; return TRUE;
*/ */
}; }
bool wxScreenDC::EndDrawingOnTop(void) bool wxScreenDC::EndDrawingOnTop(void)
{ {
@@ -118,4 +118,5 @@ bool wxScreenDC::EndDrawingOnTop(void)
m_isOk = FALSE; m_isOk = FALSE;
return TRUE; return TRUE;
*/ */
}; }

View File

@@ -32,25 +32,25 @@ extern bool g_blockEventsOnDrag;
wxDropTarget::wxDropTarget() wxDropTarget::wxDropTarget()
{ {
}; }
wxDropTarget::~wxDropTarget() wxDropTarget::~wxDropTarget()
{ {
}; }
void wxDropTarget::Drop( GdkEvent *event, int x, int y ) void wxDropTarget::Drop( GdkEvent *event, int x, int y )
{ {
printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type ); printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type );
OnDrop( x, y, (char *)event->dropdataavailable.data); OnDrop( x, y, (char *)event->dropdataavailable.data);
}; }
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{ {
if (!widget) return; if (!widget) return;
gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE ); gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE );
}; }
void wxDropTarget::RegisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget )
{ {
@@ -74,13 +74,13 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
break; break;
default: default:
break; break;
}; }
} }
char *str = WXSTRINGCAST formats; char *str = WXSTRINGCAST formats;
gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE ); gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE );
}; }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxTextDropTarget // wxTextDropTarget
@@ -90,14 +90,14 @@ bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
{ {
OnDropText( x, y, (const char*)pData ); OnDropText( x, y, (const char*)pData );
return TRUE; return TRUE;
}; }
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz ) bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{ {
printf( "Got dropped text: %s.\n", psz ); printf( "Got dropped text: %s.\n", psz );
printf( "At x: %d, y: %d.\n", (int)x, (int)y ); printf( "At x: %d, y: %d.\n", (int)x, (int)y );
return TRUE; return TRUE;
}; }
size_t wxTextDropTarget::GetFormatCount() const size_t wxTextDropTarget::GetFormatCount() const
{ {
@@ -159,7 +159,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
delete ptr; delete ptr;
source->m_retValue = wxDropSource::Copy; source->m_retValue = wxDropSource::Copy;
}; }
wxDropSource::wxDropSource( wxWindow *win ) wxDropSource::wxDropSource( wxWindow *win )
{ {
@@ -174,7 +174,7 @@ wxDropSource::wxDropSource( wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND ); m_goaheadCursor = wxCursor( wxCURSOR_HAND );
}; }
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win ) wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{ {
@@ -189,19 +189,19 @@ wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY ); m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND ); m_goaheadCursor = wxCursor( wxCURSOR_HAND );
}; }
void wxDropSource::SetData( wxDataObject &data ) void wxDropSource::SetData( wxDataObject &data )
{ {
m_data = &data; m_data = &data;
}; }
wxDropSource::~wxDropSource(void) wxDropSource::~wxDropSource(void)
{ {
// if (m_data) delete m_data; // if (m_data) delete m_data;
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = FALSE;
}; }
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{ {
@@ -227,7 +227,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{ {
g_free( gdk_dnd.drag_startwindows ); g_free( gdk_dnd.drag_startwindows );
gdk_dnd.drag_startwindows = NULL; gdk_dnd.drag_startwindows = NULL;
}; }
gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0; gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0;
XWindowAttributes dnd_winattr; XWindowAttributes dnd_winattr;
@@ -266,7 +266,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
g_blockEventsOnDrag = FALSE; g_blockEventsOnDrag = FALSE;
return m_retValue; return m_retValue;
}; }
void wxDropSource::RegisterWindow(void) void wxDropSource::RegisterWindow(void)
{ {
@@ -294,7 +294,7 @@ void wxDropSource::RegisterWindow(void)
gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event", gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event",
GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this );
}; }
void wxDropSource::UnregisterWindow(void) void wxDropSource::UnregisterWindow(void)
{ {
@@ -303,4 +303,4 @@ void wxDropSource::UnregisterWindow(void)
gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 ); gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 );
gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this ); gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this );
}; }

View File

@@ -37,14 +37,14 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
} }
dialog->OnOK( event ); dialog->OnOK( event );
}; }
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data ) void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data )
{ {
wxFileDialog *dialog = (wxFileDialog*)data; wxFileDialog *dialog = (wxFileDialog*)data;
wxCommandEvent event(wxEVT_NULL); wxCommandEvent event(wxEVT_NULL);
dialog->OnCancel( event ); dialog->OnCancel( event );
}; }
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
@@ -83,7 +83,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked", gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
}; }
int wxFileDialog::ShowModal(void) int wxFileDialog::ShowModal(void)
{ {
@@ -93,9 +93,9 @@ int wxFileDialog::ShowModal(void)
{ {
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) ); m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) ); m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
}; }
return ret; return ret;
}; }
char *wxFileSelector(const char *title, char *wxFileSelector(const char *title,
@@ -131,7 +131,7 @@ char *wxFileSelector(const char *title,
} }
else else
return NULL; return NULL;
}; }
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name, char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent ) wxWindow *parent )
@@ -147,7 +147,7 @@ char* wxLoadFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext); sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent); return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}; }
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name, char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent ) wxWindow *parent )
@@ -163,5 +163,5 @@ char* wxSaveFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext); sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent); return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}; }

View File

@@ -24,9 +24,11 @@ static char *wx_font_family [] = {
"wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT", "wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
"wxSWISS", "wxTELETYPE", "wxSWISS", "wxTELETYPE",
}; };
static char *wx_font_style [] = { static char *wx_font_style [] = {
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC", "wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
}; };
static char *wx_font_weight [] = { static char *wx_font_weight [] = {
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT", "wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
}; };
@@ -68,7 +70,7 @@ wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER)
m_fontId = 0; m_fontId = 0;
m_faceName = NULL; m_faceName = NULL;
m_font = NULL; m_font = NULL;
}; }
wxFontRefData::~wxFontRefData(void) wxFontRefData::~wxFontRefData(void)
{ {
@@ -79,14 +81,14 @@ wxFontRefData::~wxFontRefData(void)
wxNode *next = node->Next(); wxNode *next = node->Next();
gdk_font_unref( font ); gdk_font_unref( font );
node = next; node = next;
}; }
if (m_faceName) if (m_faceName)
{ {
delete m_faceName; delete m_faceName;
m_faceName = NULL; m_faceName = NULL;
}; }
if (m_font) gdk_font_unref( m_font ); if (m_font) gdk_font_unref( m_font );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -97,7 +99,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
wxFont::wxFont(void) wxFont::wxFont(void)
{ {
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont( char *xFontName ) wxFont::wxFont( char *xFontName )
{ {
@@ -107,7 +109,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_byXFontName = TRUE; M_FONTDATA->m_byXFontName = TRUE;
M_FONTDATA->m_font = gdk_font_load( xFontName ); M_FONTDATA->m_font = gdk_font_load( xFontName );
}; }
wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight, wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
bool Underlined, const char* Face) bool Underlined, const char* Face)
@@ -123,14 +125,14 @@ wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
{ {
M_FONTDATA->m_fontId = FontIdOrFamily; M_FONTDATA->m_fontId = FontIdOrFamily;
M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily ); M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily );
}; }
M_FONTDATA->m_style = Style; M_FONTDATA->m_style = Style;
M_FONTDATA->m_weight = Weight; M_FONTDATA->m_weight = Weight;
M_FONTDATA->m_pointSize = PointSize; M_FONTDATA->m_pointSize = PointSize;
M_FONTDATA->m_underlined = Underlined; M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont(int PointSize, const char *Face, int Family, int Style, wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
int Weight, bool Underlined) int Weight, bool Underlined)
@@ -146,105 +148,105 @@ wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
M_FONTDATA->m_underlined = Underlined; M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this ); if (wxTheFontList) wxTheFontList->Append( this );
}; }
wxFont::wxFont( const wxFont& font ) wxFont::wxFont( const wxFont& font )
{ {
Ref( font ); Ref( font );
}; }
wxFont::wxFont( const wxFont* font ) wxFont::wxFont( const wxFont* font )
{ {
UnRef(); UnRef();
if (font) Ref( *font ); if (font) Ref( *font );
}; }
wxFont::~wxFont(void) wxFont::~wxFont(void)
{ {
if (wxTheFontList) wxTheFontList->DeleteObject( this ); if (wxTheFontList) wxTheFontList->DeleteObject( this );
}; }
wxFont& wxFont::operator = ( const wxFont& font ) wxFont& wxFont::operator = ( const wxFont& font )
{ {
if (*this == font) return (*this); if (*this == font) return (*this);
Ref( font ); Ref( font );
return *this; return *this;
}; }
bool wxFont::operator == ( const wxFont& font ) bool wxFont::operator == ( const wxFont& font )
{ {
return m_refData == font.m_refData; return m_refData == font.m_refData;
}; }
bool wxFont::operator != ( const wxFont& font ) bool wxFont::operator != ( const wxFont& font )
{ {
return m_refData != font.m_refData; return m_refData != font.m_refData;
}; }
bool wxFont::Ok() bool wxFont::Ok()
{ {
return (m_refData != NULL); return (m_refData != NULL);
}; }
int wxFont::GetPointSize(void) const int wxFont::GetPointSize(void) const
{ {
return M_FONTDATA->m_pointSize; return M_FONTDATA->m_pointSize;
}; }
wxString wxFont::GetFaceString(void) const wxString wxFont::GetFaceString(void) const
{ {
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId ); wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s; return s;
}; }
wxString wxFont::GetFaceName(void) const wxString wxFont::GetFaceName(void) const
{ {
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId ); wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s; return s;
}; }
int wxFont::GetFamily(void) const int wxFont::GetFamily(void) const
{ {
return M_FONTDATA->m_family; return M_FONTDATA->m_family;
}; }
wxString wxFont::GetFamilyString(void) const wxString wxFont::GetFamilyString(void) const
{ {
wxString s = wx_font_family[M_FONTDATA->m_family]; wxString s = wx_font_family[M_FONTDATA->m_family];
return s; return s;
}; }
int wxFont::GetFontId(void) const int wxFont::GetFontId(void) const
{ {
return M_FONTDATA->m_fontId; // stub return M_FONTDATA->m_fontId; // stub
}; }
int wxFont::GetStyle(void) const int wxFont::GetStyle(void) const
{ {
return M_FONTDATA->m_style; return M_FONTDATA->m_style;
}; }
wxString wxFont::GetStyleString(void) const wxString wxFont::GetStyleString(void) const
{ {
wxString s = wx_font_style[M_FONTDATA->m_style]; wxString s = wx_font_style[M_FONTDATA->m_style];
return s; return s;
}; }
int wxFont::GetWeight(void) const int wxFont::GetWeight(void) const
{ {
return M_FONTDATA->m_weight; return M_FONTDATA->m_weight;
}; }
wxString wxFont::GetWeightString(void) const wxString wxFont::GetWeightString(void) const
{ {
wxString s = wx_font_weight[M_FONTDATA->m_weight]; wxString s = wx_font_weight[M_FONTDATA->m_weight];
return s; return s;
}; }
bool wxFont::GetUnderlined(void) const bool wxFont::GetUnderlined(void) const
{ {
return M_FONTDATA->m_underlined; return M_FONTDATA->m_underlined;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// get internal representation of font // get internal representation of font
@@ -273,12 +275,12 @@ GdkFont *wxFont::GetInternalFont(float scale) const
font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style, font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
M_FONTDATA->m_weight, M_FONTDATA->m_underlined ); M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font ); M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
}; }
if (!font) if (!font)
printf("could not load any font"); printf("could not load any font");
// wxError("could not load any font", "wxFont"); // wxError("could not load any font", "wxFont");
return font; return font;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// local utilities to find a X font // local utilities to find a X font
@@ -448,7 +450,7 @@ static int WCoordinate(int w)
case wxNORMAL: case wxNORMAL:
default: return wxWEIGHT_NORMAL; default: return wxWEIGHT_NORMAL;
} }
} };
static int SCoordinate(int s) static int SCoordinate(int s)
{ {
@@ -458,7 +460,7 @@ static int SCoordinate(int s)
case wxNORMAL: case wxNORMAL:
default: return wxSTYLE_NORMAL; default: return wxSTYLE_NORMAL;
} }
} };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSuffixMap // wxSuffixMap

View File

@@ -171,6 +171,7 @@ wxFrame::~wxFrame()
{ {
if (m_frameMenuBar) delete m_frameMenuBar; if (m_frameMenuBar) delete m_frameMenuBar;
if (m_frameStatusBar) delete m_frameStatusBar; if (m_frameStatusBar) delete m_frameStatusBar;
if (m_frameToolBar) delete m_frameToolBar;
// if (m_mainWindow) gtk_widget_destroy( m_mainWindow ); // if (m_mainWindow) gtk_widget_destroy( m_mainWindow );

View File

@@ -23,5 +23,5 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) : wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
wxBitmap( bits ) wxBitmap( bits )
{ {
}; }

View File

@@ -34,10 +34,10 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height)) (win->m_height == alloc->height))
{ {
return; return;
}; }
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
}; }
// page change callback // page change callback
static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget), static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
@@ -55,7 +55,7 @@ static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
mdi_frame->m_currentChild = child_frame; mdi_frame->m_currentChild = child_frame;
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar ); mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
return; return;
}; }
node = node->Next(); node = node->Next();
} }
} }
@@ -72,7 +72,7 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
}; }
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -83,11 +83,11 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
}; }
wxMDIParentFrame::~wxMDIParentFrame(void) wxMDIParentFrame::~wxMDIParentFrame(void)
{ {
}; }
bool wxMDIParentFrame::Create( wxWindow *parent, bool wxMDIParentFrame::Create( wxWindow *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -99,7 +99,7 @@ bool wxMDIParentFrame::Create( wxWindow *parent,
OnCreateClient(); OnCreateClient();
return TRUE; return TRUE;
}; }
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height ) void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
{ {
@@ -112,7 +112,7 @@ void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GetClientSize( &x, &y ); GetClientSize( &x, &y );
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 ); m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
} }
}; }
void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar ) void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
{ {
@@ -126,48 +126,48 @@ void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 ); m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
m_mdiMenuBar->Show( TRUE ); m_mdiMenuBar->Show( TRUE );
} }
}; }
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
{ {
wxFrame::GetClientSize( width, height ); wxFrame::GetClientSize( width, height );
}; }
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{ {
return m_currentChild; return m_currentChild;
}; }
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
{ {
return m_clientWindow; return m_clientWindow;
}; }
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void) wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
{ {
m_clientWindow = new wxMDIClientWindow( this ); m_clientWindow = new wxMDIClientWindow( this );
return m_clientWindow; return m_clientWindow;
}; }
void wxMDIParentFrame::ActivateNext(void) void wxMDIParentFrame::ActivateNext(void)
{ {
if (m_clientWindow) if (m_clientWindow)
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) ); gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
}; }
void wxMDIParentFrame::ActivatePrevious(void) void wxMDIParentFrame::ActivatePrevious(void)
{ {
if (m_clientWindow) if (m_clientWindow)
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) ); gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
}; }
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) ) void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
{ {
}; }
void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) ) void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) )
{ {
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIChildFrame // wxMDIChildFrame
@@ -183,7 +183,7 @@ wxMDIChildFrame::wxMDIChildFrame(void)
{ {
m_menuBar = NULL; m_menuBar = NULL;
m_page = NULL; m_page = NULL;
}; }
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent, wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -193,7 +193,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
m_menuBar = NULL; m_menuBar = NULL;
m_page = NULL; m_page = NULL;
Create( parent, id, title, wxDefaultPosition, size, style, name ); Create( parent, id, title, wxDefaultPosition, size, style, name );
}; }
wxMDIChildFrame::~wxMDIChildFrame(void) wxMDIChildFrame::~wxMDIChildFrame(void)
{ {
@@ -204,10 +204,10 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
{ {
mdi_frame->SetMDIMenuBar( NULL ); mdi_frame->SetMDIMenuBar( NULL );
mdi_frame->m_currentChild = NULL; mdi_frame->m_currentChild = NULL;
}; }
delete m_menuBar; delete m_menuBar;
} }
}; }
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent, bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title, wxWindowID id, const wxString& title,
@@ -216,7 +216,7 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
{ {
m_title = title; m_title = title;
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name ); return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
}; }
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{ {
@@ -238,8 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
if (menuitem->IsSubMenu()) if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win ); SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next(); node = node->Next();
}; }
}; }
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar ) void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{ {
@@ -257,7 +257,7 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
wxMenu *menu = (wxMenu*)node->Data(); wxMenu *menu = (wxMenu*)node->Data();
SetInvokingWindow( menu, this ); SetInvokingWindow( menu, this );
node = node->Next(); node = node->Next();
}; }
m_menuBar->m_parent = mdi_frame; m_menuBar->m_parent = mdi_frame;
} }
@@ -266,20 +266,20 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow), gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow),
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y ); m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
} }
}; }
wxMenuBar *wxMDIChildFrame::GetMenuBar() wxMenuBar *wxMDIChildFrame::GetMenuBar()
{ {
return m_menuBar; return m_menuBar;
}; }
void wxMDIChildFrame::Activate(void) void wxMDIChildFrame::Activate(void)
{ {
}; }
void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) ) void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
{ {
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIClientWindow // wxMDIClientWindow
@@ -289,16 +289,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
wxMDIClientWindow::wxMDIClientWindow(void) wxMDIClientWindow::wxMDIClientWindow(void)
{ {
}; }
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style ) wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
{ {
CreateClient( parent, style ); CreateClient( parent, style );
}; }
wxMDIClientWindow::~wxMDIClientWindow(void) wxMDIClientWindow::~wxMDIClientWindow(void)
{ {
}; }
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{ {
@@ -318,7 +318,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
}; }
void wxMDIClientWindow::AddChild( wxWindow *child ) void wxMDIClientWindow::AddChild( wxWindow *child )
{ {
@@ -326,7 +326,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
{ {
wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame"); wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame");
return; return;
}; }
m_children.Append( child ); m_children.Append( child );
@@ -349,6 +349,6 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 ); gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 );
gtk_page_change_callback( NULL, mdi_child->m_page, 0, this ); gtk_page_change_callback( NULL, mdi_child->m_page, 0, this );
}; }

View File

@@ -34,7 +34,7 @@ public:
m_page = NULL; m_page = NULL;
m_client = NULL; m_client = NULL;
m_parent = NULL; m_parent = NULL;
}; }
//private: //private:
int m_id; int m_id;
@@ -80,7 +80,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height)) (win->m_height == alloc->height))
{ {
return; return;
}; }
/* /*
printf( "OnResize from " ); printf( "OnResize from " );
@@ -104,7 +104,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
printf( " W: %d H: %d ", win->m_width, win->m_height ); printf( " W: %d H: %d ", win->m_width, win->m_height );
printf( " .\n" ); printf( " .\n" );
*/ */
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxNotebook // wxNotebook
@@ -122,7 +122,7 @@ void wxNotebook::Init()
wxNotebook::wxNotebook() wxNotebook::wxNotebook()
{ {
Init(); Init();
}; }
wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id, wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
@@ -130,7 +130,7 @@ wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
{ {
Init(); Init();
Create( parent, id, pos, size, style, name ); Create( parent, id, pos, size, style, name );
}; }
wxNotebook::~wxNotebook() wxNotebook::~wxNotebook()
{ {
@@ -139,7 +139,7 @@ wxNotebook::~wxNotebook()
gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler); gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler);
DeleteAllPages(); DeleteAllPages();
}; }
bool wxNotebook::Create(wxWindow *parent, wxWindowID id, bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
@@ -165,7 +165,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
Show( TRUE ); Show( TRUE );
return TRUE; return TRUE;
}; }
int wxNotebook::GetSelection() const int wxNotebook::GetSelection() const
{ {
@@ -183,22 +183,22 @@ int wxNotebook::GetSelection() const
if (page->m_page == g_page) if (page->m_page == g_page)
break; break;
node = node->Next(); node = node->Next();
}; }
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" ); wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
return page->m_id; return page->m_id;
}; }
int wxNotebook::GetPageCount() const int wxNotebook::GetPageCount() const
{ {
return m_pages.Number(); return m_pages.Number();
}; }
int wxNotebook::GetRowCount() const int wxNotebook::GetRowCount() const
{ {
return 1; return 1;
}; }
wxString wxNotebook::GetPageText( int page ) const wxString wxNotebook::GetPageText( int page ) const
{ {
@@ -207,7 +207,7 @@ wxString wxNotebook::GetPageText( int page ) const
return nb_page->m_text; return nb_page->m_text;
else else
return ""; return "";
}; }
int wxNotebook::GetPageImage( int page ) const int wxNotebook::GetPageImage( int page ) const
{ {
@@ -216,7 +216,7 @@ int wxNotebook::GetPageImage( int page ) const
return nb_page->m_image; return nb_page->m_image;
else else
return 0; return 0;
}; }
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{ {
@@ -229,12 +229,12 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
if (nb_page->m_id == page) if (nb_page->m_id == page)
return nb_page; return nb_page;
node = node->Next(); node = node->Next();
}; }
wxLogDebug( "Notebook page %d not found!", page ); wxLogDebug( "Notebook page %d not found!", page );
return NULL; return NULL;
}; }
int wxNotebook::SetSelection( int page ) int wxNotebook::SetSelection( int page )
{ {
@@ -251,14 +251,14 @@ int wxNotebook::SetSelection( int page )
break; break;
page_num++; page_num++;
child = child->next; child = child->next;
}; }
if (!child) return -1; if (!child) return -1;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num ); gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
return selOld; return selOld;
}; }
void wxNotebook::AdvanceSelection(bool bForward) void wxNotebook::AdvanceSelection(bool bForward)
{ {
@@ -276,7 +276,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
void wxNotebook::SetImageList( wxImageList* imageList ) void wxNotebook::SetImageList( wxImageList* imageList )
{ {
m_imageList = imageList; m_imageList = imageList;
}; }
bool wxNotebook::SetPageText( int page, const wxString &text ) bool wxNotebook::SetPageText( int page, const wxString &text )
{ {
@@ -287,7 +287,7 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
nb_page->m_text = text; nb_page->m_text = text;
return TRUE; return TRUE;
}; }
bool wxNotebook::SetPageImage( int page, int image ) bool wxNotebook::SetPageImage( int page, int image )
{ {
@@ -298,17 +298,17 @@ bool wxNotebook::SetPageImage( int page, int image )
nb_page->m_image = image; nb_page->m_image = image;
return TRUE; return TRUE;
}; }
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) ) void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{ {
wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented")); wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented"));
}; }
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) ) void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{ {
wxFAIL_MSG(_("wxNotebook::SetPadding not implemented")); wxFAIL_MSG(_("wxNotebook::SetPadding not implemented"));
}; }
bool wxNotebook::DeleteAllPages() bool wxNotebook::DeleteAllPages()
{ {
@@ -320,10 +320,10 @@ bool wxNotebook::DeleteAllPages()
DeletePage( page->m_id ); DeletePage( page->m_id );
page_node = m_pages.First(); page_node = m_pages.First();
}; }
return TRUE; return TRUE;
}; }
bool wxNotebook::DeletePage( int page ) bool wxNotebook::DeletePage( int page )
{ {
@@ -337,7 +337,7 @@ bool wxNotebook::DeletePage( int page )
if (nb_page->m_page == (GtkNotebookPage*)child->data) break; if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
page_num++; page_num++;
child = child->next; child = child->next;
}; }
wxASSERT( child ); wxASSERT( child );
@@ -349,7 +349,7 @@ bool wxNotebook::DeletePage( int page )
m_pages.DeleteObject( nb_page ); m_pages.DeleteObject( nb_page );
return TRUE; return TRUE;
}; }
bool wxNotebook::AddPage(wxWindow* win, const wxString& text, bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool bSelect, int imageId) bool bSelect, int imageId)
@@ -367,7 +367,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
if ( page->m_client == win ) if ( page->m_client == win )
break; // found break; // found
node = node->Next(); node = node->Next();
}; }
wxCHECK_MSG(page != NULL, FALSE, wxCHECK_MSG(page != NULL, FALSE,
_("Can't add a page whose parent is not the notebook!")); _("Can't add a page whose parent is not the notebook!"));
@@ -384,7 +384,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
} }
return TRUE; return TRUE;
}; }
wxWindow *wxNotebook::GetPage( int page ) const wxWindow *wxNotebook::GetPage( int page ) const
{ {
@@ -393,7 +393,7 @@ wxWindow *wxNotebook::GetPage( int page ) const
return NULL; return NULL;
else else
return nb_page->m_client; return nb_page->m_client;
}; }
void wxNotebook::AddChild( wxWindow *win ) void wxNotebook::AddChild( wxWindow *win )
{ {
@@ -423,7 +423,7 @@ void wxNotebook::AddChild( wxWindow *win )
} }
m_pages.Append( page ); m_pages.Append( page );
}; }
// override these 2 functions to do nothing: everything is done in OnSize // override these 2 functions to do nothing: everything is done in OnSize
void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) ) void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )

View File

@@ -38,7 +38,7 @@ wxPenRefData::wxPenRefData(void)
m_style = wxSOLID; m_style = wxSOLID;
m_joinStyle = wxJOIN_ROUND; m_joinStyle = wxJOIN_ROUND;
m_capStyle = wxCAP_ROUND; m_capStyle = wxCAP_ROUND;
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -49,7 +49,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
wxPen::wxPen(void) wxPen::wxPen(void)
{ {
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxColour &colour, int width, int style ) wxPen::wxPen( const wxColour &colour, int width, int style )
{ {
@@ -58,7 +58,7 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
M_PENDATA->m_colour = colour; M_PENDATA->m_colour = colour;
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxString &colourName, int width, int style ) wxPen::wxPen( const wxString &colourName, int width, int style )
{ {
@@ -67,42 +67,42 @@ wxPen::wxPen( const wxString &colourName, int width, int style )
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
M_PENDATA->m_colour = colourName; M_PENDATA->m_colour = colourName;
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxPen& pen ) wxPen::wxPen( const wxPen& pen )
{ {
Ref( pen ); Ref( pen );
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::wxPen( const wxPen* pen ) wxPen::wxPen( const wxPen* pen )
{ {
UnRef(); UnRef();
if (pen) Ref( *pen ); if (pen) Ref( *pen );
if (wxThePenList) wxThePenList->AddPen( this ); if (wxThePenList) wxThePenList->AddPen( this );
}; }
wxPen::~wxPen(void) wxPen::~wxPen(void)
{ {
if (wxThePenList) wxThePenList->RemovePen( this ); if (wxThePenList) wxThePenList->RemovePen( this );
}; }
wxPen& wxPen::operator = ( const wxPen& pen ) wxPen& wxPen::operator = ( const wxPen& pen )
{ {
if (*this == pen) return (*this); if (*this == pen) return (*this);
Ref( pen ); Ref( pen );
return *this; return *this;
}; }
bool wxPen::operator == ( const wxPen& pen ) bool wxPen::operator == ( const wxPen& pen )
{ {
return m_refData == pen.m_refData; return m_refData == pen.m_refData;
}; }
bool wxPen::operator != ( const wxPen& pen ) bool wxPen::operator != ( const wxPen& pen )
{ {
return m_refData != pen.m_refData; return m_refData != pen.m_refData;
}; }
void wxPen::SetColour( const wxColour &colour ) void wxPen::SetColour( const wxColour &colour )
{ {
@@ -110,7 +110,7 @@ void wxPen::SetColour( const wxColour &colour )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour = colour; M_PENDATA->m_colour = colour;
}; }
void wxPen::SetColour( const wxString &colourName ) void wxPen::SetColour( const wxString &colourName )
{ {
@@ -118,7 +118,7 @@ void wxPen::SetColour( const wxString &colourName )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour = colourName; M_PENDATA->m_colour = colourName;
}; }
void wxPen::SetColour( int red, int green, int blue ) void wxPen::SetColour( int red, int green, int blue )
{ {
@@ -126,7 +126,7 @@ void wxPen::SetColour( int red, int green, int blue )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_colour.Set( red, green, blue ); M_PENDATA->m_colour.Set( red, green, blue );
}; }
void wxPen::SetCap( int capStyle ) void wxPen::SetCap( int capStyle )
{ {
@@ -134,7 +134,7 @@ void wxPen::SetCap( int capStyle )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_capStyle = capStyle; M_PENDATA->m_capStyle = capStyle;
}; }
void wxPen::SetJoin( int joinStyle ) void wxPen::SetJoin( int joinStyle )
{ {
@@ -142,7 +142,7 @@ void wxPen::SetJoin( int joinStyle )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_joinStyle = joinStyle; M_PENDATA->m_joinStyle = joinStyle;
}; }
void wxPen::SetStyle( int style ) void wxPen::SetStyle( int style )
{ {
@@ -150,7 +150,7 @@ void wxPen::SetStyle( int style )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_style = style; M_PENDATA->m_style = style;
}; }
void wxPen::SetWidth( int width ) void wxPen::SetWidth( int width )
{ {
@@ -158,12 +158,12 @@ void wxPen::SetWidth( int width )
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
M_PENDATA->m_width = width; M_PENDATA->m_width = width;
}; }
int wxPen::GetCap(void) const int wxPen::GetCap(void) const
{ {
return M_PENDATA->m_capStyle; return M_PENDATA->m_capStyle;
}; }
int wxPen::GetJoin(void) const int wxPen::GetJoin(void) const
{ {
@@ -171,7 +171,7 @@ int wxPen::GetJoin(void) const
return 0; return 0;
else else
return M_PENDATA->m_joinStyle; return M_PENDATA->m_joinStyle;
}; }
int wxPen::GetStyle(void) const int wxPen::GetStyle(void) const
{ {
@@ -179,7 +179,7 @@ int wxPen::GetStyle(void) const
return 0; return 0;
else else
return M_PENDATA->m_style; return M_PENDATA->m_style;
}; }
int wxPen::GetWidth(void) const int wxPen::GetWidth(void) const
{ {
@@ -187,7 +187,7 @@ int wxPen::GetWidth(void) const
return 0; return 0;
else else
return M_PENDATA->m_width; return M_PENDATA->m_width;
}; }
wxColour &wxPen::GetColour(void) const wxColour &wxPen::GetColour(void) const
{ {
@@ -195,10 +195,10 @@ wxColour &wxPen::GetColour(void) const
return wxNullColour; return wxNullColour;
else else
return M_PENDATA->m_colour; return M_PENDATA->m_colour;
}; }
bool wxPen::Ok(void) const bool wxPen::Ok(void) const
{ {
return (m_refData); return (m_refData);
}; }

View File

@@ -34,12 +34,12 @@ class wxRegionRefData: public wxObjectRefData
wxRegionRefData::wxRegionRefData(void) wxRegionRefData::wxRegionRefData(void)
{ {
m_region = NULL; m_region = NULL;
}; }
wxRegionRefData::~wxRegionRefData(void) wxRegionRefData::~wxRegionRefData(void)
{ {
if (m_region) gdk_region_destroy( m_region ); if (m_region) gdk_region_destroy( m_region );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -58,7 +58,7 @@ wxRegion::wxRegion( long x, long y, long w, long h )
rect.height = h; rect.height = h;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight ) wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
{ {
@@ -71,7 +71,7 @@ wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
rect.height = bottomRight.y - rect.y; rect.height = bottomRight.y - rect.y;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion( const wxRect& rect ) wxRegion::wxRegion( const wxRect& rect )
{ {
@@ -84,24 +84,24 @@ wxRegion::wxRegion( const wxRect& rect )
g_rect.height = rect.height; g_rect.height = rect.height;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect ); M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
gdk_region_destroy( reg ); gdk_region_destroy( reg );
}; }
wxRegion::wxRegion(void) wxRegion::wxRegion(void)
{ {
m_refData = new wxRegionRefData(); m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new(); M_REGIONDATA->m_region = gdk_region_new();
}; }
wxRegion::~wxRegion(void) wxRegion::~wxRegion(void)
{ {
}; }
void wxRegion::Clear(void) void wxRegion::Clear(void)
{ {
UnRef(); UnRef();
m_refData = new wxRegionRefData(); m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new(); M_REGIONDATA->m_region = gdk_region_new();
}; }
bool wxRegion::Union( long x, long y, long width, long height ) bool wxRegion::Union( long x, long y, long width, long height )
{ {
@@ -114,7 +114,7 @@ bool wxRegion::Union( long x, long y, long width, long height )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Union( const wxRect& rect ) bool wxRegion::Union( const wxRect& rect )
{ {
@@ -127,7 +127,7 @@ bool wxRegion::Union( const wxRect& rect )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Union( const wxRegion& region ) bool wxRegion::Union( const wxRegion& region )
{ {
@@ -135,21 +135,21 @@ bool wxRegion::Union( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( long x, long y, long width, long height ) bool wxRegion::Intersect( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Intersect( reg ); Intersect( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( const wxRect& rect ) bool wxRegion::Intersect( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Intersect( reg ); Intersect( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Intersect( const wxRegion& region ) bool wxRegion::Intersect( const wxRegion& region )
{ {
@@ -157,21 +157,21 @@ bool wxRegion::Intersect( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( long x, long y, long width, long height ) bool wxRegion::Subtract( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Subtract( reg ); Subtract( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( const wxRect& rect ) bool wxRegion::Subtract( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Subtract( reg ); Subtract( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Subtract( const wxRegion& region ) bool wxRegion::Subtract( const wxRegion& region )
{ {
@@ -179,21 +179,21 @@ bool wxRegion::Subtract( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( long x, long y, long width, long height ) bool wxRegion::Xor( long x, long y, long width, long height )
{ {
wxRegion reg( x, y, width, height ); wxRegion reg( x, y, width, height );
Xor( reg ); Xor( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( const wxRect& rect ) bool wxRegion::Xor( const wxRect& rect )
{ {
wxRegion reg( rect ); wxRegion reg( rect );
Xor( reg ); Xor( reg );
return TRUE; return TRUE;
}; }
bool wxRegion::Xor( const wxRegion& region ) bool wxRegion::Xor( const wxRegion& region )
{ {
@@ -201,7 +201,7 @@ bool wxRegion::Xor( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region ); gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg; M_REGIONDATA->m_region = reg;
return TRUE; return TRUE;
}; }
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
{ {
@@ -209,17 +209,17 @@ void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
y = 0; y = 0;
w = -1; w = -1;
h = -1; h = -1;
}; }
wxRect wxRegion::GetBox(void) const wxRect wxRegion::GetBox(void) const
{ {
return wxRect( 0, 0, -1, -1 ); return wxRect( 0, 0, -1, -1 );
}; }
bool wxRegion::Empty(void) const bool wxRegion::Empty(void) const
{ {
return gdk_region_empty( M_REGIONDATA->m_region ); return gdk_region_empty( M_REGIONDATA->m_region );
}; }
wxRegionContain wxRegion::Contains( long x, long y ) const wxRegionContain wxRegion::Contains( long x, long y ) const
{ {
@@ -227,7 +227,7 @@ wxRegionContain wxRegion::Contains( long x, long y ) const
return wxInRegion; return wxInRegion;
else else
return wxOutRegion; return wxOutRegion;
}; }
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
{ {
@@ -242,12 +242,12 @@ wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion; case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion;
case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion; case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion;
case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion; case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion;
}; }
return wxOutRegion; return wxOutRegion;
}; }
GdkRegion *wxRegion::GetRegion(void) const GdkRegion *wxRegion::GetRegion(void) const
{ {
return M_REGIONDATA->m_region; return M_REGIONDATA->m_region;
}; }

View File

@@ -90,9 +90,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[0].red >> SHIFT, new wxColour( style->bg[0].red >> SHIFT,
style->bg[0].green >> SHIFT, style->bg[0].green >> SHIFT,
style->bg[0].blue >> SHIFT ); style->bg[0].blue >> SHIFT );
}; }
return *g_systemBtnFaceColour; return *g_systemBtnFaceColour;
}; }
case wxSYS_COLOUR_BTNSHADOW: case wxSYS_COLOUR_BTNSHADOW:
{ {
GtkStyle *style = gtk_widget_get_default_style(); GtkStyle *style = gtk_widget_get_default_style();
@@ -102,9 +102,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->dark[0].red >> SHIFT, new wxColour( style->dark[0].red >> SHIFT,
style->dark[0].green >> SHIFT, style->dark[0].green >> SHIFT,
style->dark[0].blue >> SHIFT ); style->dark[0].blue >> SHIFT );
}; }
return *g_systemBtnShadowColour; return *g_systemBtnShadowColour;
}; }
case wxSYS_COLOUR_GRAYTEXT: case wxSYS_COLOUR_GRAYTEXT:
case wxSYS_COLOUR_BTNHIGHLIGHT: case wxSYS_COLOUR_BTNHIGHLIGHT:
{ {
@@ -115,9 +115,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->light[0].red >> SHIFT, new wxColour( style->light[0].red >> SHIFT,
style->light[0].green >> SHIFT, style->light[0].green >> SHIFT,
style->light[0].blue >> SHIFT ); style->light[0].blue >> SHIFT );
}; }
return *g_systemBtnHighlightColour; return *g_systemBtnHighlightColour;
}; }
case wxSYS_COLOUR_HIGHLIGHT: case wxSYS_COLOUR_HIGHLIGHT:
{ {
GtkStyle *style = gtk_widget_get_default_style(); GtkStyle *style = gtk_widget_get_default_style();
@@ -127,9 +127,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT, new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT,
style->bg[GTK_STATE_SELECTED].green >> SHIFT, style->bg[GTK_STATE_SELECTED].green >> SHIFT,
style->bg[GTK_STATE_SELECTED].blue >> SHIFT ); style->bg[GTK_STATE_SELECTED].blue >> SHIFT );
}; }
return *g_systemHighlightColour; return *g_systemHighlightColour;
}; }
case wxSYS_COLOUR_MENUTEXT: case wxSYS_COLOUR_MENUTEXT:
case wxSYS_COLOUR_WINDOWTEXT: case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_CAPTIONTEXT: case wxSYS_COLOUR_CAPTIONTEXT:
@@ -137,19 +137,19 @@ wxColour wxSystemSettings::GetSystemColour( int index )
case wxSYS_COLOUR_INFOTEXT: case wxSYS_COLOUR_INFOTEXT:
{ {
return *wxBLACK; return *wxBLACK;
}; }
case wxSYS_COLOUR_HIGHLIGHTTEXT: case wxSYS_COLOUR_HIGHLIGHTTEXT:
{ {
return *wxWHITE; return *wxWHITE;
}; }
case wxSYS_COLOUR_INFOBK: case wxSYS_COLOUR_INFOBK:
case wxSYS_COLOUR_APPWORKSPACE: case wxSYS_COLOUR_APPWORKSPACE:
{ {
return *wxWHITE; // ? return *wxWHITE; // ?
}; }
}; }
return *wxWHITE; return *wxWHITE;
}; }
wxFont wxSystemSettings::GetSystemFont( int index ) wxFont wxSystemSettings::GetSystemFont( int index )
{ {
@@ -160,7 +160,7 @@ wxFont wxSystemSettings::GetSystemFont( int index )
case wxSYS_SYSTEM_FIXED_FONT: case wxSYS_SYSTEM_FIXED_FONT:
{ {
return *wxNORMAL_FONT; return *wxNORMAL_FONT;
}; }
case wxSYS_ANSI_VAR_FONT: case wxSYS_ANSI_VAR_FONT:
case wxSYS_SYSTEM_FONT: case wxSYS_SYSTEM_FONT:
case wxSYS_DEVICE_DEFAULT_FONT: case wxSYS_DEVICE_DEFAULT_FONT:
@@ -169,12 +169,11 @@ wxFont wxSystemSettings::GetSystemFont( int index )
if (!g_systemFont) if (!g_systemFont)
g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" ); g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
return *g_systemFont; return *g_systemFont;
}; }
}; }
return wxNullFont; return wxNullFont;
} }
;
int wxSystemSettings::GetSystemMetric( int index ) int wxSystemSettings::GetSystemMetric( int index )
{ {
@@ -184,8 +183,6 @@ int wxSystemSettings::GetSystemMetric( int index )
return gdk_screen_width(); return gdk_screen_width();
case wxSYS_SCREEN_Y: case wxSYS_SCREEN_Y:
return gdk_screen_height(); return gdk_screen_height();
}; }
return 0; return 0;
} }
;

View File

@@ -27,45 +27,45 @@ gint timeout_callback( gpointer data )
timer->Notify(); timer->Notify();
if (timer->OneShot()) timer->Stop(); if (timer->OneShot()) timer->Stop();
return TRUE; return TRUE;
}; }
wxTimer::wxTimer(void) wxTimer::wxTimer(void)
{ {
m_tag = -1; m_tag = -1;
m_time = 1000; m_time = 1000;
m_oneShot = FALSE; m_oneShot = FALSE;
}; }
wxTimer::~wxTimer(void) wxTimer::~wxTimer(void)
{ {
Stop(); Stop();
}; }
int wxTimer::Interval(void) int wxTimer::Interval(void)
{ {
return m_time; return m_time;
}; }
bool wxTimer::OneShot(void) bool wxTimer::OneShot(void)
{ {
return m_oneShot; return m_oneShot;
}; }
void wxTimer::Notify(void) void wxTimer::Notify(void)
{ {
}; }
void wxTimer::Start( int millisecs, bool oneShot ) void wxTimer::Start( int millisecs, bool oneShot )
{ {
if (millisecs != -1) m_time = millisecs; if (millisecs != -1) m_time = millisecs;
m_oneShot = oneShot; m_oneShot = oneShot;
m_tag = gtk_timeout_add( millisecs, timeout_callback, this ); m_tag = gtk_timeout_add( millisecs, timeout_callback, this );
}; }
void wxTimer::Stop(void) void wxTimer::Stop(void)
{ {
if (m_tag != -1) if (m_tag != -1)
gtk_timeout_remove( m_tag ); gtk_timeout_remove( m_tag );
m_tag = -1; m_tag = -1;
}; }