Source cleaning: tabs, whitespaces, -1/wxID_ANY, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
// Created: 25/4/2000
|
// Created: 25/4/2000
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||||
|
@@ -85,7 +85,7 @@ class WXDLLIMPEXP_BASE wxEncodingConverter : public wxObject
|
|||||||
// both modes gurantee that output string will have same length
|
// both modes gurantee that output string will have same length
|
||||||
// as input string
|
// as input string
|
||||||
//
|
//
|
||||||
// Returns FALSE if given conversion is impossible, TRUE otherwise
|
// Returns false if given conversion is impossible, true otherwise
|
||||||
// (conversion may be impossible either if you try to convert
|
// (conversion may be impossible either if you try to convert
|
||||||
// to Unicode with non-Unicode build of wxWidgets or if input
|
// to Unicode with non-Unicode build of wxWidgets or if input
|
||||||
// or output encoding is not supported.)
|
// or output encoding is not supported.)
|
||||||
|
@@ -1256,7 +1256,7 @@ public:
|
|||||||
int GetMenuId() const { return m_menuId; }
|
int GetMenuId() const { return m_menuId; }
|
||||||
|
|
||||||
// only for wxEVT_MENU_OPEN/CLOSE
|
// only for wxEVT_MENU_OPEN/CLOSE
|
||||||
bool IsPopup() const { return m_menuId == -1; }
|
bool IsPopup() const { return m_menuId == wxID_ANY; }
|
||||||
|
|
||||||
// only for wxEVT_MENU_OPEN/CLOSE
|
// only for wxEVT_MENU_OPEN/CLOSE
|
||||||
wxMenu* GetMenu() const { return m_menu; }
|
wxMenu* GetMenu() const { return m_menu; }
|
||||||
@@ -2418,9 +2418,9 @@ typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureC
|
|||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
#define EVT_SIZE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SIZE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSizeEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_SIZE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SIZE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSizeEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_SIZING(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SIZING, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSizeEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_SIZING(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SIZING, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSizeEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_MOVE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMoveEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_MOVE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMoveEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_MOVING(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOVING, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMoveEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_MOVING(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOVING, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMoveEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_CLOSE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CLOSE_WINDOW, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_CLOSE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CLOSE_WINDOW, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
||||||
#define EVT_QUERY_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
#define EVT_QUERY_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
|
||||||
|
@@ -39,10 +39,10 @@ public:
|
|||||||
// exit from the loop with the given exit code
|
// exit from the loop with the given exit code
|
||||||
virtual void Exit(int rc = 0) = 0;
|
virtual void Exit(int rc = 0) = 0;
|
||||||
|
|
||||||
// return TRUE if any events are available
|
// return true if any events are available
|
||||||
virtual bool Pending() const = 0;
|
virtual bool Pending() const = 0;
|
||||||
|
|
||||||
// dispatch a single event, return FALSE if we should exit from the loop
|
// dispatch a single event, return false if we should exit from the loop
|
||||||
virtual bool Dispatch() = 0;
|
virtual bool Dispatch() = 0;
|
||||||
|
|
||||||
// is the event loop running now?
|
// is the event loop running now?
|
||||||
@@ -83,7 +83,7 @@ class WXDLLEXPORT wxEventLoop : public wxEventLoopBase
|
|||||||
public:
|
public:
|
||||||
wxEventLoop() { m_impl = NULL; }
|
wxEventLoop() { m_impl = NULL; }
|
||||||
virtual ~wxEventLoop();
|
virtual ~wxEventLoop();
|
||||||
|
|
||||||
virtual int Run();
|
virtual int Run();
|
||||||
virtual void Exit(int rc = 0);
|
virtual void Exit(int rc = 0);
|
||||||
virtual bool Pending() const;
|
virtual bool Pending() const;
|
||||||
|
@@ -122,5 +122,5 @@ bool wxEffects::TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap)
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -63,19 +63,19 @@ static wxUint16* GetEncTable(wxFontEncoding enc)
|
|||||||
{
|
{
|
||||||
TECObjectRef converter ;
|
TECObjectRef converter ;
|
||||||
TextEncodingBase code = wxMacGetSystemEncFromFontEnc( enc ) ;
|
TextEncodingBase code = wxMacGetSystemEncFromFontEnc( enc ) ;
|
||||||
TextEncodingBase unicode = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
|
TextEncodingBase unicode = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
|
||||||
OSStatus status = TECCreateConverter(&converter,code,unicode);
|
OSStatus status = TECCreateConverter(&converter,code,unicode);
|
||||||
char s[2] ;
|
char s[2] ;
|
||||||
s[1] = 0 ;
|
s[1] = 0 ;
|
||||||
ByteCount byteInLen, byteOutLen ;
|
ByteCount byteInLen, byteOutLen ;
|
||||||
for( unsigned char c = 255 ; c >= 128 ; --c )
|
for( unsigned char c = 255 ; c >= 128 ; --c )
|
||||||
{
|
{
|
||||||
s[0] = c ;
|
s[0] = c ;
|
||||||
status = TECConvertText(converter, (ConstTextPtr) &s , 1, &byteInLen,
|
status = TECConvertText(converter, (ConstTextPtr) &s , 1, &byteInLen,
|
||||||
(TextPtr) &gMacEncodings[i][c-128] , 2, &byteOutLen);
|
(TextPtr) &gMacEncodings[i][c-128] , 2, &byteOutLen);
|
||||||
}
|
}
|
||||||
status = TECDisposeConverter(converter);
|
status = TECDisposeConverter(converter);
|
||||||
gMacEncodingsInited[i]=true;
|
gMacEncodingsInited[i]=true;
|
||||||
}
|
}
|
||||||
return gMacEncodings[i] ;
|
return gMacEncodings[i] ;
|
||||||
}
|
}
|
||||||
@@ -118,8 +118,8 @@ static CharsetItem* BuildReverseTable(wxUint16 *tbl)
|
|||||||
wxEncodingConverter::wxEncodingConverter()
|
wxEncodingConverter::wxEncodingConverter()
|
||||||
{
|
{
|
||||||
m_Table = NULL;
|
m_Table = NULL;
|
||||||
m_UnicodeInput = m_UnicodeOutput = FALSE;
|
m_UnicodeInput = m_UnicodeOutput = false;
|
||||||
m_JustCopy = FALSE;
|
m_JustCopy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,17 +132,17 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e
|
|||||||
if (m_Table) {delete[] m_Table; m_Table = NULL;}
|
if (m_Table) {delete[] m_Table; m_Table = NULL;}
|
||||||
|
|
||||||
#if !wxUSE_WCHAR_T
|
#if !wxUSE_WCHAR_T
|
||||||
if (input_enc == wxFONTENCODING_UNICODE || output_enc == wxFONTENCODING_UNICODE) return FALSE;
|
if (input_enc == wxFONTENCODING_UNICODE || output_enc == wxFONTENCODING_UNICODE) return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (input_enc == output_enc) {m_JustCopy = TRUE; return TRUE;}
|
if (input_enc == output_enc) {m_JustCopy = true; return true;}
|
||||||
|
|
||||||
m_UnicodeOutput = (output_enc == wxFONTENCODING_UNICODE);
|
m_UnicodeOutput = (output_enc == wxFONTENCODING_UNICODE);
|
||||||
m_JustCopy = FALSE;
|
m_JustCopy = false;
|
||||||
|
|
||||||
if (input_enc == wxFONTENCODING_UNICODE)
|
if (input_enc == wxFONTENCODING_UNICODE)
|
||||||
{
|
{
|
||||||
if ((out_tbl = GetEncTable(output_enc)) == NULL) return FALSE;
|
if ((out_tbl = GetEncTable(output_enc)) == NULL) return false;
|
||||||
|
|
||||||
m_Table = new tchar[65536];
|
m_Table = new tchar[65536];
|
||||||
for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII
|
for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII
|
||||||
@@ -158,15 +158,15 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e
|
|||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
m_Table[out_tbl[i]] = (tchar)(128 + i);
|
m_Table[out_tbl[i]] = (tchar)(128 + i);
|
||||||
|
|
||||||
m_UnicodeInput = TRUE;
|
m_UnicodeInput = true;
|
||||||
}
|
}
|
||||||
else // input !Unicode
|
else // input !Unicode
|
||||||
{
|
{
|
||||||
if ((in_tbl = GetEncTable(input_enc)) == NULL) return FALSE;
|
if ((in_tbl = GetEncTable(input_enc)) == NULL) return false;
|
||||||
if (output_enc != wxFONTENCODING_UNICODE)
|
if (output_enc != wxFONTENCODING_UNICODE)
|
||||||
if ((out_tbl = GetEncTable(output_enc)) == NULL) return FALSE;
|
if ((out_tbl = GetEncTable(output_enc)) == NULL) return false;
|
||||||
|
|
||||||
m_UnicodeInput = FALSE;
|
m_UnicodeInput = false;
|
||||||
|
|
||||||
m_Table = new tchar[256];
|
m_Table = new tchar[256];
|
||||||
for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII
|
for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII
|
||||||
@@ -174,7 +174,7 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e
|
|||||||
if (output_enc == wxFONTENCODING_UNICODE)
|
if (output_enc == wxFONTENCODING_UNICODE)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 128; i++) m_Table[128 + i] = (tchar)in_tbl[i];
|
for (i = 0; i < 128; i++) m_Table[128 + i] = (tchar)in_tbl[i];
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else // output !Unicode
|
else // output !Unicode
|
||||||
{
|
{
|
||||||
@@ -203,7 +203,7 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ wxEventHashTable wxEvtHandler::sm_eventHashTable(wxEvtHandler::sm_eventTable);
|
|||||||
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
|
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
|
||||||
{ DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) };
|
{ DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) };
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
// Clear up event hash table contents or we can get problems
|
// Clear up event hash table contents or we can get problems
|
||||||
// when C++ is cleaning up the static object
|
// when C++ is cleaning up the static object
|
||||||
@@ -137,7 +137,7 @@ public:
|
|||||||
};
|
};
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxEventTableEntryModule, wxModule)
|
IMPLEMENT_DYNAMIC_CLASS(wxEventTableEntryModule, wxModule)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global variables
|
// global variables
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -759,7 +759,7 @@ wxEventHashTable::wxEventHashTable(const wxEventTable &table)
|
|||||||
m_rebuildHash(true)
|
m_rebuildHash(true)
|
||||||
{
|
{
|
||||||
AllocEventTypeTable(EVENT_TYPE_TABLE_INIT_SIZE);
|
AllocEventTypeTable(EVENT_TYPE_TABLE_INIT_SIZE);
|
||||||
|
|
||||||
m_next = sm_first;
|
m_next = sm_first;
|
||||||
if (m_next)
|
if (m_next)
|
||||||
m_next->m_previous = this;
|
m_next->m_previous = this;
|
||||||
@@ -774,7 +774,7 @@ wxEventHashTable::~wxEventHashTable()
|
|||||||
m_previous->m_next = m_next;
|
m_previous->m_next = m_next;
|
||||||
if (sm_first == this)
|
if (sm_first == this)
|
||||||
sm_first = m_next;
|
sm_first = m_next;
|
||||||
|
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -817,9 +817,9 @@ bool wxEventHashTable::HandleEvent(wxEvent &event, wxEvtHandler *self)
|
|||||||
InitHashTable();
|
InitHashTable();
|
||||||
m_rebuildHash = false;
|
m_rebuildHash = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_eventTypeTable)
|
if (!m_eventTypeTable)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// Find all entries for the given event type.
|
// Find all entries for the given event type.
|
||||||
wxEventType eventType = event.GetEventType();
|
wxEventType eventType = event.GetEventType();
|
||||||
@@ -881,7 +881,7 @@ void wxEventHashTable::AddEntry(const wxEventTableEntry &entry)
|
|||||||
// This might happen 'accidentally' as the app is exiting
|
// This might happen 'accidentally' as the app is exiting
|
||||||
if (!m_eventTypeTable)
|
if (!m_eventTypeTable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EventTypeTablePointer *peTTnode = &m_eventTypeTable[entry.m_eventType % m_size];
|
EventTypeTablePointer *peTTnode = &m_eventTypeTable[entry.m_eventType % m_size];
|
||||||
EventTypeTablePointer eTTnode = *peTTnode;
|
EventTypeTablePointer eTTnode = *peTTnode;
|
||||||
|
|
||||||
@@ -1152,9 +1152,9 @@ wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry,
|
|||||||
// the event table (meaning "any") or the event id matches the id
|
// the event table (meaning "any") or the event id matches the id
|
||||||
// specified in the event table either exactly or by falling into
|
// specified in the event table either exactly or by falling into
|
||||||
// range between first and last
|
// range between first and last
|
||||||
if ((tableId1 == -1) ||
|
if ((tableId1 == wxID_ANY) ||
|
||||||
(tableId2 == -1 && tableId1 == event.GetId()) ||
|
(tableId2 == wxID_ANY && tableId1 == event.GetId()) ||
|
||||||
(tableId2 != -1 &&
|
(tableId2 != wxID_ANY &&
|
||||||
(event.GetId() >= tableId1 && event.GetId() <= tableId2)))
|
(event.GetId() >= tableId1 && event.GetId() <= tableId2)))
|
||||||
{
|
{
|
||||||
event.Skip(false);
|
event.Skip(false);
|
||||||
@@ -1304,7 +1304,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
|||||||
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
|
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
|
||||||
|
|
||||||
if ((entry->m_id == id) &&
|
if ((entry->m_id == id) &&
|
||||||
((entry->m_lastId == lastId) || (lastId == -1)) &&
|
((entry->m_lastId == lastId) || (lastId == wxID_ANY)) &&
|
||||||
((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) &&
|
((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) &&
|
||||||
((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) &&
|
((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) &&
|
||||||
((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) &&
|
((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) &&
|
||||||
|
Reference in New Issue
Block a user