#ifndef _WX_DDE_H_BASE_
#define _WX_DDE_H_BASE_
+#include "wx/list.h"
+
+class wxDDEClient;
+class wxDDEServer;
+class wxDDEConnection;
+
+WX_DECLARE_LIST(wxDDEClient, wxDDEClientList);
+WX_DECLARE_LIST(wxDDEServer, wxDDEServerList);
+WX_DECLARE_LIST(wxDDEConnection, wxDDEConnectionList);
+
+
#if defined(__WXMSW__)
#include "wx/msw/dde.h"
#elif defined(__WXMOTIF__)
wxDDEConnection *FindConnection(WXHCONV conv);
bool DeleteConnection(WXHCONV conv);
inline wxString& GetServiceName(void) const { return (wxString&) m_serviceName; }
- inline wxList& GetConnections(void) const { return (wxList&) m_connections; }
-
- protected:
- int m_lastError;
- wxString m_serviceName;
- wxList m_connections;
+ inline wxDDEConnectionList& GetConnections(void) const
+ {
+ return (wxDDEConnectionList&) m_connections;
+ }
+
+protected:
+ int m_lastError;
+ wxString m_serviceName;
+ wxDDEConnectionList m_connections;
};
class WXDLLEXPORT wxDDEClient: public wxClientBase
// Find/delete wxDDEConnection corresponding to the HCONV
wxDDEConnection *FindConnection(WXHCONV conv);
bool DeleteConnection(WXHCONV conv);
- inline wxList& GetConnections(void) const { return (wxList&) m_connections; }
- protected:
- int m_lastError;
- wxList m_connections;
+ inline wxDDEConnectionList& GetConnections(void) const
+ {
+ return (wxDDEConnectionList&) m_connections;
+ }
+
+protected:
+ int m_lastError;
+ wxDDEConnectionList m_connections;
};
void WXDLLEXPORT wxDDEInitialize();
class WXDLLEXPORT wxGDIImageHandler;
class WXDLLEXPORT wxGDIImage;
+WX_DECLARE_LIST(wxGDIImageHandler, wxGDIImageHandlerList);
+
// ----------------------------------------------------------------------------
// wxGDIImageRefData: common data fields for all derived classes
// ----------------------------------------------------------------------------
{
public:
// handlers list interface
- static wxList& GetHandlers() { return ms_handlers; }
+ static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; }
static void AddHandler(wxGDIImageHandler *handler);
static void InsertHandler(wxGDIImageHandler *handler);
// create the data for the derived class here
virtual wxGDIImageRefData *CreateData() const = 0;
- static wxList ms_handlers;
+ static wxGDIImageHandlerList ms_handlers;
};
#endif // _WX_MSW_GDIIMAGE_H_
#pragma interface "taskbar.h"
#endif
-#include <wx/event.h>
-#include <wx/list.h>
-#include <wx/icon.h>
+#include "wx/event.h"
+#include "wx/list.h"
+#include "wx/icon.h"
+
+class wxTaskBarIcon;
+
+WX_DECLARE_LIST(wxTaskBarIcon, wxTaskBarIconList);
class WXDLLEXPORT wxTaskBarIcon: public wxEvtHandler {
DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
protected:
WXHWND m_hWnd;
bool m_iconAdded;
- static wxList sm_taskBarIcons;
+ static wxTaskBarIconList sm_taskBarIcons;
static bool sm_registeredClass;
static unsigned int sm_taskbarMsg;
// Send idle event to window and all subwindows
bool wxApp::SendIdleEvents(wxWindow* win)
{
- bool needMore = FALSE;
-
wxIdleEvent event;
event.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event);
- if (event.MoreRequested())
- needMore = TRUE;
+ bool needMore = event.MoreRequested();
- wxWindowList::Node* node = win->GetChildren().GetFirst();
- while (node)
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
+ while ( node )
{
- wxWindow* win = node->GetData();
+ wxWindow *win = node->GetData();
if (SendIdleEvents(win))
needMore = TRUE;
node = node->GetNext();
}
+
return needMore;
}
static DWORD DDEIdInst = 0L;
static wxDDEConnection *DDECurrentlyConnecting = NULL;
-
static wxList wxAtomTable(wxKEY_STRING);
-static wxList wxDDEClientObjects;
-static wxList wxDDEServerObjects;
+
+#include "wx/listimpl.cpp"
+
+WX_DEFINE_LIST(wxDDEClientList);
+WX_DEFINE_LIST(wxDDEServerList);
+WX_DEFINE_LIST(wxDDEConnectionList);
+
+static wxDDEClientList wxDDEClientObjects;
+static wxDDEServerList wxDDEServerObjects;
static bool DDEInitialized = false;
// Global find connection
static wxDDEConnection *DDEFindConnection(HCONV hConv)
{
- wxNode *node = wxDDEServerObjects.GetFirst();
- wxDDEConnection *found = NULL;
- while (node && !found)
- {
- wxDDEServer *object = (wxDDEServer *)node->GetData();
- found = object->FindConnection((WXHCONV) hConv);
- node = node->GetNext();
- }
- if (found)
- return found;
-
- node = wxDDEClientObjects.GetFirst();
- while (node && !found)
- {
- wxDDEClient *object = (wxDDEClient *)node->GetData();
- found = object->FindConnection((WXHCONV) hConv);
- node = node->GetNext();
- }
- return found;
+ wxDDEServerList::Node *serverNode = wxDDEServerObjects.GetFirst();
+ wxDDEConnection *found = NULL;
+ while (serverNode && !found)
+ {
+ wxDDEServer *object = serverNode->GetData();
+ found = object->FindConnection((WXHCONV) hConv);
+ serverNode = serverNode->GetNext();
+ }
+
+ if (found)
+ {
+ return found;
+ }
+
+ wxDDEClientList::Node *clientNode = wxDDEClientObjects.GetFirst();
+ while (clientNode && !found)
+ {
+ wxDDEClient *object = clientNode->GetData();
+ found = object->FindConnection((WXHCONV) hConv);
+ clientNode = clientNode->GetNext();
+ }
+ return found;
}
// Global delete connection
static void DDEDeleteConnection(HCONV hConv)
{
- wxNode *node = wxDDEServerObjects.GetFirst();
- bool found = false;
- while (node && !found)
- {
- wxDDEServer *object = (wxDDEServer *)node->GetData();
- found = object->DeleteConnection((WXHCONV) hConv);
- node = node->GetNext();
- }
- if (found)
- return;
-
- node = wxDDEClientObjects.GetFirst();
- while (node && !found)
- {
- wxDDEClient *object = (wxDDEClient *)node->GetData();
- found = object->DeleteConnection((WXHCONV) hConv);
- node = node->GetNext();
- }
+ wxDDEServerList::Node *serverNode = wxDDEServerObjects.GetFirst();
+ bool found = false;
+ while (serverNode && !found)
+ {
+ wxDDEServer *object = serverNode->GetData();
+ found = object->DeleteConnection((WXHCONV) hConv);
+ serverNode = serverNode->GetNext();
+ }
+ if (found)
+ {
+ return;
+ }
+
+ wxDDEClientList::Node *clientNode = wxDDEClientObjects.GetFirst();
+ while (clientNode && !found)
+ {
+ wxDDEClient *object = clientNode->GetData();
+ found = object->DeleteConnection((WXHCONV) hConv);
+ clientNode = clientNode->GetNext();
+ }
}
// Find a server from a service name
static wxDDEServer *DDEFindServer(const wxString& s)
{
- wxNode *node = wxDDEServerObjects.GetFirst();
- wxDDEServer *found = NULL;
- while (node && !found)
- {
- wxDDEServer *object = (wxDDEServer *)node->GetData();
-
- if (object->GetServiceName() == s)
- found = object;
- else node = node->GetNext();
- }
- return found;
+ wxDDEServerList::Node *node = wxDDEServerObjects.GetFirst();
+ wxDDEServer *found = NULL;
+ while (node && !found)
+ {
+ wxDDEServer *object = node->GetData();
+
+ if (object->GetServiceName() == s)
+ {
+ found = object;
+ }
+ else
+ {
+ node = node->GetNext();
+ }
+ }
+
+ return found;
}
// ----------------------------------------------------------------------------
wxDDEServerObjects.DeleteObject(this);
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
while (node)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
- wxNode *next = node->GetNext();
+ wxDDEConnection *connection = node->GetData();
+ wxDDEConnectionList::Node *next = node->GetNext();
connection->SetConnected(false);
connection->OnDisconnect(); // May delete the node implicitly
node = next;
node = m_connections.GetFirst();
while (node)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
- wxNode *next = node->GetNext();
+ wxDDEConnection *connection = node->GetData();
+ wxDDEConnectionList::Node *next = node->GetNext();
delete connection;
node = next;
}
wxDDEConnection *wxDDEServer::FindConnection(WXHCONV conv)
{
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
wxDDEConnection *found = NULL;
while (node && !found)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
+ wxDDEConnection *connection = node->GetData();
if (connection->m_hConv == conv)
found = connection;
else node = node->GetNext();
// Only delete the entry in the map, not the actual connection
bool wxDDEServer::DeleteConnection(WXHCONV conv)
{
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
bool found = false;
while (node && !found)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
+ wxDDEConnection *connection = node->GetData();
if (connection->m_hConv == conv)
{
found = true;
delete node;
}
- else node = node->GetNext();
+ else
+ {
+ node = node->GetNext();
+ }
}
return found;
}
wxDDEClient::~wxDDEClient()
{
wxDDEClientObjects.DeleteObject(this);
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
while (node)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
+ wxDDEConnection *connection = node->GetData();
delete connection; // Deletes the node implicitly (see ~wxDDEConnection)
node = m_connections.GetFirst();
}
wxDDEConnection *wxDDEClient::FindConnection(WXHCONV conv)
{
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
wxDDEConnection *found = NULL;
while (node && !found)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
+ wxDDEConnection *connection = node->GetData();
if (connection->m_hConv == conv)
found = connection;
else node = node->GetNext();
// Only delete the entry in the map, not the actual connection
bool wxDDEClient::DeleteConnection(WXHCONV conv)
{
- wxNode *node = m_connections.GetFirst();
+ wxDDEConnectionList::Node *node = m_connections.GetFirst();
bool found = false;
while (node && !found)
{
- wxDDEConnection *connection = (wxDDEConnection *)node->GetData();
+ wxDDEConnection *connection = node->GetData();
if (connection->m_hConv == conv)
{
found = true;
#include "wx/msw/gdiimage.h"
#include "wx/bitmap.h"
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxGDIImageHandlerList);
+
+
#ifdef __WIN16__
# include "wx/msw/curico.h"
#endif // __WIN16__
// implementation
// ============================================================================
-wxList wxGDIImage::ms_handlers;
+wxGDIImageHandlerList wxGDIImage::ms_handlers;
// ----------------------------------------------------------------------------
// wxGDIImage functions forwarded to wxGDIImageRefData
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& name)
{
- wxNode *node = ms_handlers.GetFirst();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->GetData();
+ wxGDIImageHandler *handler = node->GetData();
if ( handler->GetName() == name )
return handler;
node = node->GetNext();
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& extension,
long type)
{
- wxNode *node = ms_handlers.GetFirst();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->GetData();
+ wxGDIImageHandler *handler = node->GetData();
if ( (handler->GetExtension() = extension) &&
(type == -1 || handler->GetType() == type) )
{
wxGDIImageHandler *wxGDIImage::FindHandler(long type)
{
- wxNode *node = ms_handlers.GetFirst();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->GetData();
+ wxGDIImageHandler *handler = node->GetData();
if ( handler->GetType() == type )
return handler;
void wxGDIImage::CleanUpHandlers()
{
- wxNode *node = ms_handlers.GetFirst();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->GetData();
- wxNode *next = node->GetNext();
+ wxGDIImageHandler *handler = node->GetData();
+ wxGDIImageHandlerList::Node *next = node->GetNext();
delete handler;
delete node;
node = next;
if ( IsMdiCommandId(id) )
{
- wxWindowList::Node* node = GetChildren().GetFirst();
+ wxWindowList::Node *node = GetChildren().GetFirst();
while ( node )
{
- wxWindow* child = node->GetData();
+ wxWindow *child = node->GetData();
if ( child->GetHWND() )
{
long childId = wxGetWindowId(child->GetHWND());
{
if (GetParent())
{
- wxWindowList::Node* node = GetParent()->GetChildren().GetFirst();
+ wxWindowList::Node *node = GetParent()->GetChildren().GetFirst();
while (node)
{
- wxWindow* child = node->GetData();
+ wxWindow *child = node->GetData();
if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
{
- HWND hWnd = (HWND) child->GetHWND();
- ::RedrawWindow(hWnd, NULL, NULL, RDW_FRAME|RDW_ALLCHILDREN|RDW_INVALIDATE );
+ ::RedrawWindow(GetHwndOf(child),
+ NULL,
+ NULL,
+ RDW_FRAME |
+ RDW_ALLCHILDREN |
+ RDW_INVALIDATE);
}
node = node->GetNext();
}
#include <shellapi.h>
#endif
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxTaskBarIconList);
+
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam );
wxChar *wxTaskBarWindowClass = (wxChar*) wxT("wxTaskBarWindowClass");
-wxList wxTaskBarIcon::sm_taskBarIcons;
-bool wxTaskBarIcon::sm_registeredClass = false;
+wxTaskBarIconList wxTaskBarIcon::sm_taskBarIcons;
+bool wxTaskBarIcon::sm_registeredClass = FALSE;
UINT wxTaskBarIcon::sm_taskbarMsg = 0;
DEFINE_EVENT_TYPE( wxEVT_TASKBAR_MOVE )
wxTaskBarIcon* wxTaskBarIcon::FindObjectForHWND(WXHWND hWnd)
{
- wxNode *node = sm_taskBarIcons.GetFirst();
+ wxTaskBarIconList::Node *node = sm_taskBarIcons.GetFirst();
while (node)
{
- wxTaskBarIcon* obj = (wxTaskBarIcon*) node->GetData();
+ wxTaskBarIcon *obj = node->GetData();
if (obj->GetHWND() == hWnd)
return obj;
node = node->GetNext();
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam )
{
- wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
+ wxTaskBarIcon *obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
if (obj)
return obj->WindowProc((WXHWND) hWnd, msg, wParam, lParam);
else