minor Configure / makefiles updates

Removed mor (egcs) warnings
  Updated version to 2.0.1 in version.h
  Several corrections for strict compilers
  OpenGL updates
  new wxApp::InitVisual() for overriding in order to set non-default visual
    (unportable, of course)
  Added makefiles for DialogEd and Tex2Rtf
  made wxGTK compile with Tex2Rtf
  Added BEGIN_DRAG event to tree ctrl
  Added missing #include to lexel.l (unistd.h) (MSW?)
  new wxGTK.spec
  turned one or two more #ifdef into #if


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-08 20:33:18 +00:00
parent ed38ec7e34
commit bbe0af5b15
67 changed files with 1777 additions and 1309 deletions
+1 -2
View File
@@ -976,6 +976,7 @@ typedef void* gpointer;
/* Stand-ins for GDK types */
typedef gulong GdkAtom;
typedef struct _GdkVisual GdkVisual;
typedef struct _GdkColor GdkColor;
typedef struct _GdkColormap GdkColormap;
typedef struct _GdkFont GdkFont;
@@ -994,9 +995,7 @@ typedef struct _GtkList GtkList;
typedef struct _GtkToolbar GtkToolbar;
typedef struct _GtkNotebook GtkNotebook;
typedef struct _GtkNotebookPage GtkNotebookPage;
#endif
#endif
// _WX_DEFS_H_
+1
View File
@@ -456,6 +456,7 @@ protected:
wxBrush *m_hilightBrush;
wxImageList *m_imageListNormal,
*m_imageListState;
int m_dragCount;
// the common part of all ctors
void Init();
+34 -23
View File
@@ -31,6 +31,9 @@ class wxLog;
extern wxApp *wxTheApp;
extern GdkVisual *wxVisualSetByExternal;
extern GdkColormap *wxColormapSetByExternal;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
@@ -55,48 +58,56 @@ class wxApp: public wxEvtHandler
public:
wxApp(void);
~wxApp(void);
wxApp();
~wxApp();
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; }
virtual bool OnInit(void);
virtual bool OnInitGui(void);
virtual int OnRun(void);
virtual int OnExit(void);
/* this may have to be overwritten when special, non-default visuals have
to be set. it is also platform dependent as only X knows about displays
and visuals. by standard, this routine looks at wxVisualSetByExternal
which might have been set in the wxModule code of the OpenGL canvas */
virtual bool InitVisual();
wxWindow *GetTopWindow(void);
virtual bool OnInit();
virtual bool OnInitGui();
virtual int OnRun();
virtual int OnExit();
wxWindow *GetTopWindow();
void SetTopWindow( wxWindow *win );
virtual int MainLoop(void);
void ExitMainLoop(void);
bool Initialized(void);
virtual bool Pending(void);
virtual void Dispatch(void);
virtual int MainLoop();
void ExitMainLoop();
bool Initialized();
virtual bool Pending();
virtual void Dispatch();
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
inline bool GetWantDebugOutput(void) { return m_wantDebugOutput; }
inline bool GetWantDebugOutput() { return m_wantDebugOutput; }
void OnIdle( wxIdleEvent &event );
bool SendIdleEvents(void);
bool SendIdleEvents();
bool SendIdleEvents( wxWindow* win );
inline wxString GetAppName(void) const {
inline wxString GetAppName() const
{
if (m_appName != "")
return m_appName;
else return m_className;
}
inline void SetAppName(const wxString& name) { m_appName = name; };
inline wxString GetClassName(void) const { return m_className; }
inline wxString GetClassName() const { return m_className; }
inline void SetClassName(const wxString& name) { m_className = name; }
const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; }
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
void SetPrintMode(int WXUNUSED(mode) ) {};
int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT; };
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; };
// override this function to create default log target of arbitrary
// user-defined classv (default implementation creates a wxLogGui object)
@@ -104,11 +115,11 @@ class wxApp: public wxEvtHandler
// GTK implementation
static void CommonInit(void);
static void CommonCleanUp(void);
static void CommonInit();
static void CommonCleanUp();
bool ProcessIdle(void);
void DeletePendingObjects(void);
bool ProcessIdle();
void DeletePendingObjects();
bool m_initialized;
bool m_exitOnFrameDelete;
+8 -1
View File
@@ -58,6 +58,13 @@ public:
bool Enabled( int id ) const;
inline bool IsEnabled(int Id) const { return Enabled(Id); };
inline bool IsChecked(int Id) const { return Checked(Id); };
wxString GetLabel( int id ) const;
void SetLabel( int id, const wxString &label );
void EnableTop( int pos, bool flag );
void SetLabelTop( int pos, const wxString& label );
wxString GetLabelTop( int pos ) const;
int GetMenuCount() const { return m_menus.Number(); }
wxMenu *GetMenu(int n) const { return (wxMenu *)m_menus.Nth(n)->Data(); }
@@ -102,7 +109,7 @@ public:
bool IsChecked( int id ) const;
void SetLabel( int id, const wxString &label );
wxString GetLabel(int id) const;
wxString GetLabel( int id ) const;
// helpstring
virtual void SetHelpString(int id, const wxString& helpString);
+16
View File
@@ -24,6 +24,22 @@
class wxTimer;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
/* Timer functions (milliseconds) */
void wxStartTimer();
/* Gets time since last wxStartTimer or wxGetElapsedTime */
long wxGetElapsedTime(bool resetTimer = TRUE);
/* EXPERIMENTAL: comment this out if it doesn't compile. */
bool wxGetLocalTime(long *timeZone, int *dstObserved);
/* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
long wxGetCurrentTime();
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
+6
View File
@@ -32,6 +32,12 @@
extern const char *wxFrameNameStr;
extern wxList wxTopLevelWindows;
//-----------------------------------------------------------------------------
// global function
//-----------------------------------------------------------------------------
wxWindow* wxGetActiveWindow();
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
+34 -23
View File
@@ -31,6 +31,9 @@ class wxLog;
extern wxApp *wxTheApp;
extern GdkVisual *wxVisualSetByExternal;
extern GdkColormap *wxColormapSetByExternal;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
@@ -55,48 +58,56 @@ class wxApp: public wxEvtHandler
public:
wxApp(void);
~wxApp(void);
wxApp();
~wxApp();
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; }
virtual bool OnInit(void);
virtual bool OnInitGui(void);
virtual int OnRun(void);
virtual int OnExit(void);
/* this may have to be overwritten when special, non-default visuals have
to be set. it is also platform dependent as only X knows about displays
and visuals. by standard, this routine looks at wxVisualSetByExternal
which might have been set in the wxModule code of the OpenGL canvas */
virtual bool InitVisual();
wxWindow *GetTopWindow(void);
virtual bool OnInit();
virtual bool OnInitGui();
virtual int OnRun();
virtual int OnExit();
wxWindow *GetTopWindow();
void SetTopWindow( wxWindow *win );
virtual int MainLoop(void);
void ExitMainLoop(void);
bool Initialized(void);
virtual bool Pending(void);
virtual void Dispatch(void);
virtual int MainLoop();
void ExitMainLoop();
bool Initialized();
virtual bool Pending();
virtual void Dispatch();
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
inline bool GetWantDebugOutput(void) { return m_wantDebugOutput; }
inline bool GetWantDebugOutput() { return m_wantDebugOutput; }
void OnIdle( wxIdleEvent &event );
bool SendIdleEvents(void);
bool SendIdleEvents();
bool SendIdleEvents( wxWindow* win );
inline wxString GetAppName(void) const {
inline wxString GetAppName() const
{
if (m_appName != "")
return m_appName;
else return m_className;
}
inline void SetAppName(const wxString& name) { m_appName = name; };
inline wxString GetClassName(void) const { return m_className; }
inline wxString GetClassName() const { return m_className; }
inline void SetClassName(const wxString& name) { m_className = name; }
const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; }
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
void SetPrintMode(int WXUNUSED(mode) ) {};
int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT; };
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; };
// override this function to create default log target of arbitrary
// user-defined classv (default implementation creates a wxLogGui object)
@@ -104,11 +115,11 @@ class wxApp: public wxEvtHandler
// GTK implementation
static void CommonInit(void);
static void CommonCleanUp(void);
static void CommonInit();
static void CommonCleanUp();
bool ProcessIdle(void);
void DeletePendingObjects(void);
bool ProcessIdle();
void DeletePendingObjects();
bool m_initialized;
bool m_exitOnFrameDelete;
+8 -1
View File
@@ -58,6 +58,13 @@ public:
bool Enabled( int id ) const;
inline bool IsEnabled(int Id) const { return Enabled(Id); };
inline bool IsChecked(int Id) const { return Checked(Id); };
wxString GetLabel( int id ) const;
void SetLabel( int id, const wxString &label );
void EnableTop( int pos, bool flag );
void SetLabelTop( int pos, const wxString& label );
wxString GetLabelTop( int pos ) const;
int GetMenuCount() const { return m_menus.Number(); }
wxMenu *GetMenu(int n) const { return (wxMenu *)m_menus.Nth(n)->Data(); }
@@ -102,7 +109,7 @@ public:
bool IsChecked( int id ) const;
void SetLabel( int id, const wxString &label );
wxString GetLabel(int id) const;
wxString GetLabel( int id ) const;
// helpstring
virtual void SetHelpString(int id, const wxString& helpString);
+16
View File
@@ -24,6 +24,22 @@
class wxTimer;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
/* Timer functions (milliseconds) */
void wxStartTimer();
/* Gets time since last wxStartTimer or wxGetElapsedTime */
long wxGetElapsedTime(bool resetTimer = TRUE);
/* EXPERIMENTAL: comment this out if it doesn't compile. */
bool wxGetLocalTime(long *timeZone, int *dstObserved);
/* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
long wxGetCurrentTime();
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
+6
View File
@@ -32,6 +32,12 @@
extern const char *wxFrameNameStr;
extern wxList wxTopLevelWindows;
//-----------------------------------------------------------------------------
// global function
//-----------------------------------------------------------------------------
wxWindow* wxGetActiveWindow();
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
+1 -1
View File
@@ -83,7 +83,7 @@ class WXDLLEXPORT wxDatabase: public wxObject
bool err_occured;
wxList recordSets; // Record sets: Added by JACS
public:
wxDatabase(void);
~wxDatabase(void);
+2 -2
View File
@@ -15,8 +15,8 @@
/* Bump-up with each new version */
#define wxMAJOR_VERSION 2
#define wxMINOR_VERSION 0
#define wxRELEASE_NUMBER 0
#define wxVERSION_STRING "wxWindows 2.0"
#define wxRELEASE_NUMBER 1
#define wxVERSION_STRING "wxWindows 2.0.1"
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
#define wxBETA_NUMBER 17
#define wxVERSION_FLOAT wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)
+4
View File
@@ -40,7 +40,11 @@ enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER};
class CeditorDlg;
class CparameterDlg;
#ifdef __WXGTK__
const char paramFilename[] = "../database.cfg";
#else
const char paramFilename[] = "database.cfg";
#endif
/*
+1 -1
View File
@@ -854,7 +854,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name )
}
/*
* REading the image data
* Reading the image data
*/
fseek(file, offset, SEEK_SET);
data = ptr;
+1
View File
@@ -12,6 +12,7 @@ WORDCHAR [^'\\]
* either lex and flex.
*/
#include <string.h>
#include <unistd.h>
/* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
please check, if this is also TRUE under other UNIXes.
+6 -2
View File
@@ -510,8 +510,12 @@ void wxSocketBase::Discard()
// If what? Who seems to need unsigned int?
// BTW uint isn't even defined on wxMSW for VC++ for some reason. Even if it
// were, getpeername/getsockname don't take unsigned int*, they take int*.
#if 0
#define wxSOCKET_INT unsigned int
//
// Under glibc 2.0.7, socketbits.h declares socklen_t to be unsigned int
// and it uses *socklen_t as the 3rd parameter. Robert.
#ifdef __LINUX__
#define wxSOCKET_INT socklen_t
#else
#define wxSOCKET_INT int
#endif
+5 -2
View File
@@ -157,7 +157,9 @@ char *wxStreamBuffer::AllocSpaceWBack(size_t needed_size)
if (!temp_b)
return NULL;
m_wback = temp_b;
printf("Buffer(0x%x)->Write: 0x%x, %d\n", this, m_wback, m_wbacksize);
/* printf("Buffer(0x%x)->Write: 0x%x, %d\n", this, m_wback, m_wbacksize); */
return (char *)(m_wback+(m_wbacksize-needed_size));
}
@@ -165,7 +167,8 @@ size_t wxStreamBuffer::GetWBack(char *buf, size_t bsize)
{
size_t s_toget = m_wbacksize-m_wbackcur;
printf("Buffer(0x%x): 0x%x, %d\n", this, m_wback, m_wbacksize);
/* printf("Buffer(0x%x): 0x%x, %d\n", this, m_wback, m_wbacksize); */
if (bsize < s_toget)
s_toget = bsize;
+8 -4
View File
@@ -335,16 +335,20 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
{
if (!m_useEvents) return;
int fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
int fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontFamily = 0; /* shut up buggy egcs warnings */
fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
int fontWeight = 0;
fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = 0;
fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontSize = atoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue();
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
if (colourChoice->GetStringSelection() != "")
{
wxColour *col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
wxColour *col = (wxColour*) NULL;
col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
if (col)
{
fontData.fontColour = *col;
+2 -2
View File
@@ -49,7 +49,7 @@ IMPLEMENT_CLASS(wxExtHelpController, wxHelpControllerBase)
wxExtHelpController::wxExtHelpController(void)
{
m_MapList = NULL;
m_MapList = (wxList*) NULL;
m_BrowserName = WXEXTHELP_DEFAULTBROWSER;
m_BrowserIsNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE;
m_NumOfEntries = 0;
@@ -76,7 +76,7 @@ wxExtHelpController::DeleteList(void)
node = m_MapList->First();
}
delete m_MapList;
m_MapList = NULL;
m_MapList = (wxList*) NULL;
}
}
+238 -217
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -15,6 +15,13 @@
#include <ctype.h>
#ifdef __WXDEBUG__
#ifdef NULL
#undef NULL
#endif
#define NULL ((void*)0L)
#endif
//-----------------------------------------------------------------------------
// wxAcceleratorTable
//-----------------------------------------------------------------------------
+64 -33
View File
@@ -44,6 +44,9 @@ wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
extern wxList wxPendingDelete;
extern wxResourceCache *wxTheResourceCache;
GdkVisual *wxVisualSetByExternal = (GdkVisual*) NULL;
GdkColormap *wxColormapSetByExternal = (GdkColormap*) NULL;
unsigned char g_palette[64*3] =
{
0x0, 0x0, 0x0,
@@ -169,14 +172,60 @@ wxApp::~wxApp(void)
gtk_idle_remove( m_idleTag );
}
bool wxApp::OnInit(void)
bool wxApp::InitVisual()
{
if (wxVisualSetByExternal)
{
/* this happens in the wxModule code of the OpenGl canvas.
it chooses the best display for OpenGl and stores it
in wxDisplaySetByExternal. we then have to make it the
default for the system */
gtk_widget_set_default_visual( wxVisualSetByExternal );
}
if (wxColormapSetByExternal)
{
/* OpenGl also gives us a colormap */
gtk_widget_set_default_colormap( wxColormapSetByExternal );
}
else
{
/* this initiates the standard palette as defined by GdkImlib
in the GNOME libraries. it ensures that all GNOME applications
use the same 64 colormap entries on 8-bit displays so you
can use several rather graphics-heavy applications at the
same time */
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
for (int i = 0; i < 64; i++)
{
GdkColor col;
col.red = g_palette[i*3 + 0] << 8;
col.green = g_palette[i*3 + 1] << 8;
col.blue = g_palette[i*3 + 2] << 8;
col.pixel = 0;
gdk_color_alloc( cmap, &col );
}
gtk_widget_set_default_colormap( cmap );
}
return TRUE;
}
bool wxApp::OnInitGui(void)
{
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE;
}
bool wxApp::OnInit(void)
{
return TRUE;
}
@@ -320,12 +369,6 @@ void wxApp::SetTopWindow( wxWindow *win )
void wxApp::CommonInit(void)
{
/*
#if wxUSE_RESOURCES
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
*/
wxSystemSettings::Init();
wxTheFontNameDirectory = new wxFontNameDirectory;
@@ -350,14 +393,19 @@ void wxApp::CommonInit(void)
void wxApp::CommonCleanUp(void)
{
wxDELETE(wxTheColourDatabase);
wxDELETE(wxTheFontNameDirectory);
if (wxTheColourDatabase) delete wxTheColourDatabase;
wxTheColourDatabase = (wxColourDatabase*) NULL;
if (wxTheFontNameDirectory) delete wxTheFontNameDirectory;
wxTheFontNameDirectory = (wxFontNameDirectory*) NULL;
wxDeleteStockObjects();
#if wxUSE_WX_RESOURCES
wxFlushResources();
wxDELETE(wxTheResourceCache);
if (wxTheResourceCache) delete wxTheResourceCache;
wxTheResourceCache = (wxResourceCache*) NULL;
wxCleanUpResourceSystem();
#endif
@@ -419,29 +467,14 @@ int wxEntry( int argc, char *argv[] )
gtk_init( &argc, &argv );
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
for (int i = 0; i < 64; i++)
{
GdkColor col;
col.red = g_palette[i*3 + 0] << 8;
col.green = g_palette[i*3 + 1] << 8;
col.blue = g_palette[i*3 + 2] << 8;
col.pixel = 0;
gdk_color_alloc( cmap, &col );
}
gtk_widget_push_colormap( cmap );
gtk_widget_set_default_colormap( cmap );
wxModule::RegisterModules();
if (!wxModule::InitializeModules()) return FALSE;
if (!wxTheApp->InitVisual()) return 0;
wxApp::CommonInit();
wxModule::RegisterModules();
if (!wxModule::InitializeModules()) return FALSE;
wxTheApp->OnInitGui();
if (!wxTheApp->OnInitGui()) return 0;
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
@@ -481,11 +514,9 @@ int wxEntry( int argc, char *argv[] )
#endif
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
wxLog *oldLog = wxLog::SetActiveTarget( (wxLog*) NULL );
if (oldLog) delete oldLog;
return retValue;
}
//-----------------------------------------------------------------------------
+8 -7
View File
@@ -27,14 +27,15 @@ wxCheckListBox::wxCheckListBox() :
{
m_hasCheckBoxes = TRUE;
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int nStrings = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxPoint& pos,
const wxSize& size,
int nStrings,
const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name )
{
m_hasCheckBoxes = TRUE;
wxListBox::Create( parent, id, pos, size, nStrings, choices, style, validator, name );
+1 -1
View File
@@ -255,7 +255,7 @@ void wxComboBox::Delete( int n )
return;
}
GList *list = g_list_append( NULL, child->data );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( listbox, list );
g_list_free( list );
-1
View File
@@ -14,7 +14,6 @@
#pragma interface
#endif
#include "wx/defs.h"
#if wxUSE_POSTSCRIPT
+5 -4
View File
@@ -733,8 +733,8 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
if (!m_data) return (wxDragResult) wxDragNone;
static GtkWidget *drag_icon = NULL;
static GtkWidget *drop_icon = NULL;
static GtkWidget *drag_icon = (GtkWidget*) NULL;
static GtkWidget *drop_icon = (GtkWidget*) NULL;
GdkPoint hotspot_1 = {0,-5 };
@@ -872,7 +872,7 @@ void wxDropSource::UnregisterWindow(void)
/*
* Shaped Windows
*/
static GdkWindow *root_win = NULL;
static GdkWindow *root_win = (GdkWindow*) NULL;
typedef struct _cursoroffset {gint x,y;} CursorOffset;
@@ -895,7 +895,8 @@ shape_pressed (GtkWidget *widget, GdkEventButton *event)
(GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK),
NULL, NULL, 0);
(GdkWindow*)NULL,
(GdkCursor*) NULL, 0);
}
+1 -1
View File
@@ -423,7 +423,7 @@ void wxListBox::Delete( int n )
wxCHECK_RET( child, "wrong listbox index" );
GList *list = g_list_append( NULL, child->data );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
g_list_free( list );
+26 -2
View File
@@ -155,14 +155,38 @@ bool wxMenuBar::Enabled( int id ) const
return FALSE;
}
wxString wxMenuBar::GetLabel( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->GetText();
return "";
}
void wxMenuBar::SetLabel( int id, const wxString &label )
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->SetText( label );
}
void wxMenuBar::EnableTop( int WXUNUSED(pos), bool WXUNUSED(flag) )
{
}
wxString wxMenuBar::GetLabelTop( int WXUNUSED(pos) ) const
{
return "menu";
}
void wxMenuBar::SetLabelTop( int WXUNUSED(pos), const wxString& WXUNUSED(label) )
{
}
//-----------------------------------------------------------------------------
// "activate"
//-----------------------------------------------------------------------------
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
wxYield();
int id = menu->FindMenuIdByMenuItem(widget);
/* should find it for normal (not popup) menu */
-1
View File
@@ -17,7 +17,6 @@
#include "gtk/gtk.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
// "clicked"
//-----------------------------------------------------------------------------
+1 -1
View File
@@ -429,7 +429,7 @@ bool wxNotebook::SetPageImage( int page, int image )
if (image == -1 && nb_page->m_image == -1)
return TRUE; /* Case 1): Nothing to do. */
GtkWidget *pixmapwid = NULL;
GtkWidget *pixmapwid = (GtkWidget*) NULL;
if (nb_page->m_image != -1)
{
+10 -11
View File
@@ -7,7 +7,6 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "radiobox.h"
#endif
@@ -148,8 +147,8 @@ void wxRadioBox::OnSize( wxSizeEvent &event )
wxSize wxRadioBox::LayoutItems()
{
int x = m_x+7;
int y = m_y+15;
int x = 7;
int y = 15;
int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1;
@@ -160,7 +159,7 @@ wxSize wxRadioBox::LayoutItems()
for (int j = 0; j < m_majorDim; j++)
{
y = m_y+15;
y = 15;
int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_per_major );
@@ -169,10 +168,10 @@ wxSize wxRadioBox::LayoutItems()
GtkWidget *button = GTK_WIDGET( node->Data() );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
int len = 22+gdk_string_measure( font, label->label );
if (len > max_len) max_len = len;
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += 22;
node = node->Next();
@@ -197,8 +196,8 @@ wxSize wxRadioBox::LayoutItems()
x += max_len + 2;
}
res.y -= 3;
res.x = x-2;
res.x = x+4;
res.y += 9;
}
else
{
@@ -211,7 +210,7 @@ wxSize wxRadioBox::LayoutItems()
GtkLabel *label = GTK_LABEL( button->child );
GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
int len = 22+gdk_string_measure( font, label->label );
if (len > max) max = len;
node = node->Next();
@@ -222,13 +221,13 @@ wxSize wxRadioBox::LayoutItems()
{
GtkWidget *button = GTK_WIDGET( node->Data() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
x += max;
gtk_widget_set_usize( button, max, 20 );
node = node->Next();
}
res.x = x-2;
res.x = x+4;
res.y = 42;
}
+216 -210
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -303,7 +303,7 @@ bool wxTextCtrl::LoadFile( const wxString &file )
Clear();
FILE *fp = NULL;
FILE *fp = (FILE*) NULL;
struct stat statb;
if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
@@ -358,7 +358,7 @@ bool wxTextCtrl::SaveFile( const wxString &file )
}
else
{
char *text = NULL;
char *text = (char*) NULL;
gint len = 0;
if (m_windowStyle & wxTE_MULTILINE)
+27 -18
View File
@@ -64,7 +64,7 @@ public:
wxMutex::wxMutex()
{
p_internal = new wxMutexInternal;
pthread_mutex_init(&(p_internal->p_mutex), NULL);
pthread_mutex_init( &(p_internal->p_mutex), (const pthread_mutexattr_t*) NULL );
m_locked = 0;
}
@@ -73,46 +73,54 @@ wxMutex::~wxMutex()
if (m_locked > 0)
wxLogDebug( "wxMutex warning: freeing a locked mutex (%d locks)\n", m_locked );
pthread_mutex_destroy(&(p_internal->p_mutex));
pthread_mutex_destroy( &(p_internal->p_mutex) );
delete p_internal;
}
wxMutexError wxMutex::Lock()
{
int err;
err = pthread_mutex_lock(&(p_internal->p_mutex));
int err = pthread_mutex_lock( &(p_internal->p_mutex) );
if (err == EDEADLK)
{
return wxMUTEX_DEAD_LOCK;
}
m_locked++;
return wxMUTEX_NO_ERROR;
}
wxMutexError wxMutex::TryLock()
{
int err;
if (m_locked)
{
return wxMUTEX_BUSY;
}
err = pthread_mutex_trylock(&(p_internal->p_mutex));
int err = pthread_mutex_trylock( &(p_internal->p_mutex) );
switch (err)
{
case EBUSY: return wxMUTEX_BUSY;
}
m_locked++;
return wxMUTEX_NO_ERROR;
}
wxMutexError wxMutex::Unlock()
{
if (m_locked > 0)
{
m_locked--;
}
else
{
return wxMUTEX_UNLOCKED;
}
pthread_mutex_unlock(&(p_internal->p_mutex));
pthread_mutex_unlock( &(p_internal->p_mutex) );
return wxMUTEX_NO_ERROR;
}
@@ -129,37 +137,38 @@ public:
wxCondition::wxCondition()
{
p_internal = new wxConditionInternal;
pthread_cond_init(&(p_internal->p_condition), NULL);
pthread_cond_init( &(p_internal->p_condition), (const pthread_condattr_t *) NULL );
}
wxCondition::~wxCondition()
{
pthread_cond_destroy(&(p_internal->p_condition));
pthread_cond_destroy( &(p_internal->p_condition) );
delete p_internal;
}
void wxCondition::Wait(wxMutex& mutex)
{
pthread_cond_wait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex));
pthread_cond_wait( &(p_internal->p_condition), &(mutex.p_internal->p_mutex) );
}
bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec)
{
struct timespec tspec;
tspec.tv_sec = time(NULL)+sec;
tspec.tv_sec = time(0L)+sec;
tspec.tv_nsec = nsec;
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
}
void wxCondition::Signal()
{
pthread_cond_signal(&(p_internal->p_condition));
pthread_cond_signal( &(p_internal->p_condition) );
}
void wxCondition::Broadcast()
{
pthread_cond_broadcast(&(p_internal->p_condition));
pthread_cond_broadcast( &(p_internal->p_condition) );
}
//--------------------------------------------------------------------
@@ -183,7 +192,7 @@ void *wxThreadInternal::PthreadStart(void *ptr)
wxThread *thread = (wxThread *)ptr;
/* Call the main entry */
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, (int*) NULL );
void* status = thread->Entry();
thread->Exit(status);
@@ -246,9 +255,9 @@ int wxThread::GetPriority() const
void wxThread::DeferDestroy(bool on)
{
if (on)
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, (int*) NULL);
else
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, (int*) NULL);
}
wxThreadError wxThread::Destroy()
+45
View File
@@ -15,6 +15,51 @@
#include "wx/timer.h"
#include "gtk/gtk.h"
/*
#include "glib.h"
*/
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
/*
static GTimer *g_timer = (GTimer*) NULL;
void wxStartTimer()
{
if (g_timer)
{
g_timer_rest( g_timer );
}
else
{
g_timer = g_timer_new();
g_timer_start( g_timer );
}
}
long wxGetElapsedTime( bool resetTimer )
{
gulong res = 0;
if (g_timer)
{
g_timer_elapsed( g_timer, &res );
if (resetTimer) g_timer_reset( g_timer );
}
return res;
}
bool wxGetLocalTime( long *timeZone, int *dstObserved )
{
}
long wxGetCurrentTime()
{
}
*/
//-----------------------------------------------------------------------------
// wxTimer
+45 -39
View File
@@ -30,13 +30,10 @@
#include <netdb.h>
#include <signal.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include "glib.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
#include "gtk/gtkfeatures.h"
#include "gdk/gdkx.h"
#ifdef __SVR4__
@@ -79,12 +76,7 @@ void wxDisplaySize( int *width, int *height )
void wxGetMousePosition( int* x, int* y )
{
Window dumw;
int dumi;
unsigned int dumu;
XQueryPointer( GDK_DISPLAY(),GDK_ROOT_WINDOW(),
&dumw,&dumw,x,y,&dumi,&dumi,&dumu );
gdk_window_get_pointer( (GdkWindow*) NULL, x, y, (GdkModifierType*) NULL );
}
bool wxColourDisplay(void)
@@ -97,6 +89,14 @@ int wxDisplayDepth(void)
return gdk_window_get_visual( (GdkWindow*) &gdk_root_parent )->depth;
}
int wxGetOsVersion(int *majorVsn, int *minorVsn)
{
if (majorVsn) *majorVsn = GTK_MAJOR_VERSION;
if (minorVsn) *minorVsn = GTK_MINOR_VERSION;
return wxGTK;
}
//------------------------------------------------------------------------
// user and home routines
//------------------------------------------------------------------------
@@ -124,7 +124,8 @@ char *wxGetUserHome( const wxString &user )
{
who = getpwnam(ptr);
}
// We now make sure the the user exists!
/* We now make sure the the user exists! */
if (who == NULL)
{
who = getpwuid(getuid());
@@ -250,37 +251,37 @@ bool wxDirExists( const wxString& dir )
struct wxEndProcessData
{
gint pid, tag;
wxProcess *process;
gint pid, tag;
wxProcess *process;
};
static void GTK_EndProcessDetector(gpointer data, gint source,
GdkInputCondition WXUNUSED(condition) )
{
wxEndProcessData *proc_data = (wxEndProcessData *)data;
int pid;
wxEndProcessData *proc_data = (wxEndProcessData *)data;
int pid;
pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
/* wait4 is not part of any standard, use at own risk
* not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-)
* --- offer@sgi.com */
/* wait4 is not part of any standard, use at own risk
* not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-)
* --- offer@sgi.com */
#if !defined(__sgi)
wait4(proc_data->pid, NULL, 0, NULL);
wait4(proc_data->pid, (int*) NULL, 0, (rusage *) NULL);
#else
wait3((int *) NULL, 0, (rusage *) NULL);
wait3((int *) NULL, 0, (rusage *) NULL);
#endif
close(source);
gdk_input_remove(proc_data->tag);
close(source);
gdk_input_remove(proc_data->tag);
if (proc_data->process)
proc_data->process->OnTerminate(proc_data->pid);
if (proc_data->process)
proc_data->process->OnTerminate(proc_data->pid);
if (proc_data->pid > 0)
delete proc_data;
else
proc_data->pid = 0;
if (proc_data->pid > 0)
delete proc_data;
else
proc_data->pid = 0;
}
long wxExecute( char **argv, bool sync, wxProcess *process )
@@ -291,8 +292,9 @@ long wxExecute( char **argv, bool sync, wxProcess *process )
wxCHECK_MSG( *argv, 0, "can't exec empty command" );
/* Create pipes */
if (pipe(end_proc_detect) == -1) {
wxLogSysError(_("Pipe creation failed"));
if (pipe(end_proc_detect) == -1)
{
wxLogSysError( "Pipe creation failed" );
return 0;
}
@@ -302,12 +304,13 @@ long wxExecute( char **argv, bool sync, wxProcess *process )
#else
pid_t pid = fork();
#endif
if (pid == -1) {
// error
wxLogSysError(_("Fork failed"));
if (pid == -1)
{
wxLogSysError( "Fork failed" );
return 0;
}
else if (pid == 0) {
else if (pid == 0)
{
// we're in child
close(end_proc_detect[0]); // close reading side
// These three lines close the open file descriptors to
@@ -325,20 +328,23 @@ long wxExecute( char **argv, bool sync, wxProcess *process )
execvp (*argv, argv);
#endif
// there is no return after successful exec()
wxLogSysError(_("Can't execute '%s'"), *argv);
wxLogSysError( "Can't execute '%s'", *argv);
_exit(-1);
}
else {
else
{
// we're in parent
close(end_proc_detect[1]); // close writing side
data->tag = gdk_input_add(end_proc_detect[0], GDK_INPUT_READ,
GTK_EndProcessDetector, (gpointer)data);
data->pid = pid;
if (!sync) {
if (!sync)
{
data->process = process;
}
else {
else
{
data->process = (wxProcess *) NULL;
data->pid = -(data->pid);
+6 -2
View File
@@ -255,10 +255,14 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
// home directory instead of current directory -- JACS
(void)GetIniFile(buffer, file);
wxNode *node = wxTheResourceCache->Find(buffer);
wxNode *node = (wxNode*) NULL; /* suppress egcs warning */
node = wxTheResourceCache->Find(buffer);
if (node)
{
database = (XrmDatabase)node->Data();
else {
}
else
{
database = XrmGetFileDatabase(buffer);
wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
+64 -57
View File
@@ -33,6 +33,9 @@
#include "wx/file.h"
#include "wx/wave.h"
//-----------------------------------------------------------------
// wxWave
//-----------------------------------------------------------------
wxWave::wxWave()
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
@@ -42,101 +45,106 @@ wxWave::wxWave()
wxWave::wxWave(const wxString& sFileName, bool isResource)
: m_waveLength(0), m_isResource(isResource), m_waveData(NULL)
{
Create(sFileName, isResource);
Create(sFileName, isResource);
}
wxWave::wxWave(int size, const byte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{
Create(size, data);
Create(size, data);
}
wxWave::~wxWave()
{
Free();
Free();
}
bool wxWave::Create(const wxString& fileName, bool isResource)
{
Free();
Free();
if (isResource)
{
// todo
if (isResource)
{
// todo
return (m_waveData ? TRUE : FALSE);
}
else
{
m_isResource = FALSE;
return (m_waveData ? TRUE : FALSE);
}
else
{
m_isResource = FALSE;
wxFile fileWave;
if (!fileWave.Open(fileName, wxFile::read))
{
return FALSE;
}
wxFile fileWave;
if (!fileWave.Open(fileName, wxFile::read))
return FALSE;
m_waveLength = (int) fileWave.Length();
m_waveLength = (int) fileWave.Length();
m_waveData = new byte[m_waveLength];
if (!m_waveData)
return FALSE;
m_waveData = new byte[m_waveLength];
if (!m_waveData)
{
return FALSE;
}
fileWave.Read(m_waveData, m_waveLength);
fileWave.Read(m_waveData, m_waveLength);
return TRUE;
}
return TRUE;
}
}
bool wxWave::Create(int size, const byte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
m_waveData = new byte[size];
if (!m_waveData)
return FALSE;
Free();
m_isResource = FALSE;
m_waveLength=size;
m_waveData = new byte[size];
if (!m_waveData)
{
return FALSE;
}
for (int i=0; i<size; i++) m_waveData[i] = data[i];
return TRUE;
for (int i=0; i<size; i++) m_waveData[i] = data[i];
return TRUE;
}
bool wxWave::Play(bool async, bool looped)
{
if (!IsOk())
return FALSE;
if (!IsOk()) return FALSE;
int dev=OpenDSP();
if(dev<0)
return FALSE;
int dev = OpenDSP();
if (dev<0) return FALSE;
ioctl(dev,SNDCTL_DSP_SYNC,0);
ioctl(dev,SNDCTL_DSP_SYNC,0);
bool play=TRUE;
int i,l=0;
do
bool play=TRUE;
int i,l=0;
do
{
i= (int)((l+m_DSPblkSize) < m_sizeData ? m_DSPblkSize : (m_sizeData-l));
if ( write(dev,&m_data[l],i) != i )
play=FALSE;
l +=i;
}while(play == TRUE && l<m_sizeData);
i= (int)((l+m_DSPblkSize) < m_sizeData ? m_DSPblkSize : (m_sizeData-l));
if ( write(dev,&m_data[l],i) != i )
{
play=FALSE;
}
l +=i;
} while (play == TRUE && l<m_sizeData);
close(dev);
return TRUE;
close(dev);
return TRUE;
}
bool wxWave::Free()
{
if (m_waveData)
if (m_waveData)
{
delete[] m_waveData;
m_waveData = NULL;
m_waveLength = 0;
return TRUE;
delete[] m_waveData;
m_waveData = NULL;
m_waveLength = 0;
return TRUE;
}
return FALSE;
return FALSE;
}
typedef struct
@@ -148,8 +156,7 @@ typedef struct
unsigned long ulAvgBytesPerSec;
unsigned short uiBlockAlign;
unsigned short uiBitsPerSample;
}WAVEFORMAT;
} WAVEFORMAT;
#define MONO 1 // and stereo is 2 by wav format
#define WAVE_FORMAT_PCM 1
+9
View File
@@ -1106,6 +1106,15 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child )
child->m_height );
}
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
wxWindow* wxGetActiveWindow()
{
return g_focusWindow;
}
//-----------------------------------------------------------------------------
// wxWindow
//-----------------------------------------------------------------------------
+7
View File
@@ -15,6 +15,13 @@
#include <ctype.h>
#ifdef __WXDEBUG__
#ifdef NULL
#undef NULL
#endif
#define NULL ((void*)0L)
#endif
//-----------------------------------------------------------------------------
// wxAcceleratorTable
//-----------------------------------------------------------------------------
+64 -33
View File
@@ -44,6 +44,9 @@ wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
extern wxList wxPendingDelete;
extern wxResourceCache *wxTheResourceCache;
GdkVisual *wxVisualSetByExternal = (GdkVisual*) NULL;
GdkColormap *wxColormapSetByExternal = (GdkColormap*) NULL;
unsigned char g_palette[64*3] =
{
0x0, 0x0, 0x0,
@@ -169,14 +172,60 @@ wxApp::~wxApp(void)
gtk_idle_remove( m_idleTag );
}
bool wxApp::OnInit(void)
bool wxApp::InitVisual()
{
if (wxVisualSetByExternal)
{
/* this happens in the wxModule code of the OpenGl canvas.
it chooses the best display for OpenGl and stores it
in wxDisplaySetByExternal. we then have to make it the
default for the system */
gtk_widget_set_default_visual( wxVisualSetByExternal );
}
if (wxColormapSetByExternal)
{
/* OpenGl also gives us a colormap */
gtk_widget_set_default_colormap( wxColormapSetByExternal );
}
else
{
/* this initiates the standard palette as defined by GdkImlib
in the GNOME libraries. it ensures that all GNOME applications
use the same 64 colormap entries on 8-bit displays so you
can use several rather graphics-heavy applications at the
same time */
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
for (int i = 0; i < 64; i++)
{
GdkColor col;
col.red = g_palette[i*3 + 0] << 8;
col.green = g_palette[i*3 + 1] << 8;
col.blue = g_palette[i*3 + 2] << 8;
col.pixel = 0;
gdk_color_alloc( cmap, &col );
}
gtk_widget_set_default_colormap( cmap );
}
return TRUE;
}
bool wxApp::OnInitGui(void)
{
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE;
}
bool wxApp::OnInit(void)
{
return TRUE;
}
@@ -320,12 +369,6 @@ void wxApp::SetTopWindow( wxWindow *win )
void wxApp::CommonInit(void)
{
/*
#if wxUSE_RESOURCES
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
*/
wxSystemSettings::Init();
wxTheFontNameDirectory = new wxFontNameDirectory;
@@ -350,14 +393,19 @@ void wxApp::CommonInit(void)
void wxApp::CommonCleanUp(void)
{
wxDELETE(wxTheColourDatabase);
wxDELETE(wxTheFontNameDirectory);
if (wxTheColourDatabase) delete wxTheColourDatabase;
wxTheColourDatabase = (wxColourDatabase*) NULL;
if (wxTheFontNameDirectory) delete wxTheFontNameDirectory;
wxTheFontNameDirectory = (wxFontNameDirectory*) NULL;
wxDeleteStockObjects();
#if wxUSE_WX_RESOURCES
wxFlushResources();
wxDELETE(wxTheResourceCache);
if (wxTheResourceCache) delete wxTheResourceCache;
wxTheResourceCache = (wxResourceCache*) NULL;
wxCleanUpResourceSystem();
#endif
@@ -419,29 +467,14 @@ int wxEntry( int argc, char *argv[] )
gtk_init( &argc, &argv );
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
for (int i = 0; i < 64; i++)
{
GdkColor col;
col.red = g_palette[i*3 + 0] << 8;
col.green = g_palette[i*3 + 1] << 8;
col.blue = g_palette[i*3 + 2] << 8;
col.pixel = 0;
gdk_color_alloc( cmap, &col );
}
gtk_widget_push_colormap( cmap );
gtk_widget_set_default_colormap( cmap );
wxModule::RegisterModules();
if (!wxModule::InitializeModules()) return FALSE;
if (!wxTheApp->InitVisual()) return 0;
wxApp::CommonInit();
wxModule::RegisterModules();
if (!wxModule::InitializeModules()) return FALSE;
wxTheApp->OnInitGui();
if (!wxTheApp->OnInitGui()) return 0;
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
@@ -481,11 +514,9 @@ int wxEntry( int argc, char *argv[] )
#endif
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
wxLog *oldLog = wxLog::SetActiveTarget( (wxLog*) NULL );
if (oldLog) delete oldLog;
return retValue;
}
//-----------------------------------------------------------------------------
+8 -7
View File
@@ -27,14 +27,15 @@ wxCheckListBox::wxCheckListBox() :
{
m_hasCheckBoxes = TRUE;
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int nStrings = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxPoint& pos,
const wxSize& size,
int nStrings,
const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name )
{
m_hasCheckBoxes = TRUE;
wxListBox::Create( parent, id, pos, size, nStrings, choices, style, validator, name );
+1 -1
View File
@@ -255,7 +255,7 @@ void wxComboBox::Delete( int n )
return;
}
GList *list = g_list_append( NULL, child->data );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( listbox, list );
g_list_free( list );
-1
View File
@@ -14,7 +14,6 @@
#pragma interface
#endif
#include "wx/defs.h"
#if wxUSE_POSTSCRIPT
+5 -4
View File
@@ -733,8 +733,8 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
if (!m_data) return (wxDragResult) wxDragNone;
static GtkWidget *drag_icon = NULL;
static GtkWidget *drop_icon = NULL;
static GtkWidget *drag_icon = (GtkWidget*) NULL;
static GtkWidget *drop_icon = (GtkWidget*) NULL;
GdkPoint hotspot_1 = {0,-5 };
@@ -872,7 +872,7 @@ void wxDropSource::UnregisterWindow(void)
/*
* Shaped Windows
*/
static GdkWindow *root_win = NULL;
static GdkWindow *root_win = (GdkWindow*) NULL;
typedef struct _cursoroffset {gint x,y;} CursorOffset;
@@ -895,7 +895,8 @@ shape_pressed (GtkWidget *widget, GdkEventButton *event)
(GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK),
NULL, NULL, 0);
(GdkWindow*)NULL,
(GdkCursor*) NULL, 0);
}
+1 -1
View File
@@ -423,7 +423,7 @@ void wxListBox::Delete( int n )
wxCHECK_RET( child, "wrong listbox index" );
GList *list = g_list_append( NULL, child->data );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
g_list_free( list );
+26 -2
View File
@@ -155,14 +155,38 @@ bool wxMenuBar::Enabled( int id ) const
return FALSE;
}
wxString wxMenuBar::GetLabel( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->GetText();
return "";
}
void wxMenuBar::SetLabel( int id, const wxString &label )
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->SetText( label );
}
void wxMenuBar::EnableTop( int WXUNUSED(pos), bool WXUNUSED(flag) )
{
}
wxString wxMenuBar::GetLabelTop( int WXUNUSED(pos) ) const
{
return "menu";
}
void wxMenuBar::SetLabelTop( int WXUNUSED(pos), const wxString& WXUNUSED(label) )
{
}
//-----------------------------------------------------------------------------
// "activate"
//-----------------------------------------------------------------------------
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
wxYield();
int id = menu->FindMenuIdByMenuItem(widget);
/* should find it for normal (not popup) menu */
-1
View File
@@ -17,7 +17,6 @@
#include "gtk/gtk.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
// "clicked"
//-----------------------------------------------------------------------------
+1 -1
View File
@@ -429,7 +429,7 @@ bool wxNotebook::SetPageImage( int page, int image )
if (image == -1 && nb_page->m_image == -1)
return TRUE; /* Case 1): Nothing to do. */
GtkWidget *pixmapwid = NULL;
GtkWidget *pixmapwid = (GtkWidget*) NULL;
if (nb_page->m_image != -1)
{
+10 -11
View File
@@ -7,7 +7,6 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "radiobox.h"
#endif
@@ -148,8 +147,8 @@ void wxRadioBox::OnSize( wxSizeEvent &event )
wxSize wxRadioBox::LayoutItems()
{
int x = m_x+7;
int y = m_y+15;
int x = 7;
int y = 15;
int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1;
@@ -160,7 +159,7 @@ wxSize wxRadioBox::LayoutItems()
for (int j = 0; j < m_majorDim; j++)
{
y = m_y+15;
y = 15;
int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_per_major );
@@ -169,10 +168,10 @@ wxSize wxRadioBox::LayoutItems()
GtkWidget *button = GTK_WIDGET( node->Data() );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
int len = 22+gdk_string_measure( font, label->label );
if (len > max_len) max_len = len;
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += 22;
node = node->Next();
@@ -197,8 +196,8 @@ wxSize wxRadioBox::LayoutItems()
x += max_len + 2;
}
res.y -= 3;
res.x = x-2;
res.x = x+4;
res.y += 9;
}
else
{
@@ -211,7 +210,7 @@ wxSize wxRadioBox::LayoutItems()
GtkLabel *label = GTK_LABEL( button->child );
GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
int len = 22+gdk_string_measure( font, label->label );
if (len > max) max = len;
node = node->Next();
@@ -222,13 +221,13 @@ wxSize wxRadioBox::LayoutItems()
{
GtkWidget *button = GTK_WIDGET( node->Data() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
x += max;
gtk_widget_set_usize( button, max, 20 );
node = node->Next();
}
res.x = x-2;
res.x = x+4;
res.y = 42;
}

Some files were not shown because too many files have changed in this diff Show More