return wxToolkitInfo by reference and not by pointer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2003-08-02 15:39:26 +00:00
parent a8eaaeb237
commit 324899f6c5
16 changed files with 38 additions and 39 deletions

View File

@ -23,7 +23,6 @@ class WXDLLIMPEXP_BASE wxLog;
class WXDLLIMPEXP_BASE wxMessageOutput;
class WXDLLEXPORT wxRendererNative;
class WXDLLIMPEXP_BASE wxString;
struct WXDLLIMPEXP_BASE wxToolkitInfo;
// ----------------------------------------------------------------------------
// toolkit information
@ -114,7 +113,7 @@ public:
// and in the latter -- about the OS, so we need to virtualize it
// - wxDynamicLibrary::CanonicalizePluginName() must embed toolkit
// signature in DLL name
virtual wxToolkitInfo *GetToolkitInfo() = 0;
virtual wxToolkitInfo& GetToolkitInfo() = 0;
};
// ----------------------------------------------------------------------------

View File

@ -22,7 +22,7 @@ public:
// other miscellaneous helpers
// ---------------------------
virtual wxToolkitInfo *GetToolkitInfo();
virtual owxToolkitInfo& GetToolkitInfo();
};
#if wxUSE_GUI
@ -33,7 +33,7 @@ public:
// other miscellaneous helpers
// ---------------------------
virtual wxToolkitInfo *GetToolkitInfo();
virtual wxToolkitInfo& GetToolkitInfo();
};
#endif // wxUSE_GUI

View File

@ -47,7 +47,7 @@ public:
// under MSW this function returns same version for both console and GUI
// applications so we can implement it directly in the base class and only
// override it wxGUIAppTraits to fill in toolkit information
virtual wxToolkitInfo *GetToolkitInfo();
virtual wxToolkitInfo& GetToolkitInfo();
};
#endif // _WX_MSW_APPTBASE_H_

View File

@ -36,7 +36,7 @@ public:
virtual void AfterChildWaitLoop(void *data);
virtual bool DoMessageFromThreadWait();
virtual wxToolkitInfo *GetToolkitInfo();
virtual wxToolkitInfo& GetToolkitInfo();
};
#endif // wxUSE_GUI

View File

@ -24,7 +24,7 @@ public:
virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData);
virtual int WaitForChild(wxExecuteData& execData);
virtual wxToolkitInfo *GetToolkitInfo();
virtual wxToolkitInfo& GetToolkitInfo();
};
#if wxUSE_GUI
@ -37,7 +37,7 @@ public:
virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData);
virtual int WaitForChild(wxExecuteData& execData);
virtual wxToolkitInfo *GetToolkitInfo();
virtual wxToolkitInfo& GetToolkitInfo();
};
#endif // wxUSE_GUI

View File

@ -415,7 +415,7 @@ wxString wxDynamicLibrary::CanonicalizePluginName(const wxString& name,
wxAppConsole::GetInstance()->GetTraits() : NULL;
wxASSERT_MSG( traits,
_("can't query for GUI plugins name in console applications") );
suffix = traits->GetToolkitInfo()->shortName;
suffix = traits->GetToolkitInfo().shortName;
}
#if wxUSE_UNICODE
suffix << _T('u');

View File

@ -293,12 +293,12 @@ int wxGetOsVersion(int *verMaj, int *verMin)
if ( ! traits )
traits = &traitsConsole;
wxToolkitInfo *info = traits->GetToolkitInfo();
wxToolkitInfo& info = traits->GetToolkitInfo();
if ( verMaj )
*verMaj = info->versionMajor;
*verMaj = info.versionMajor;
if ( verMin )
*verMin = info->versionMinor;
return info->os;
*verMin = info.versionMinor;
return info.os;
}
// ----------------------------------------------------------------------------

View File

@ -122,7 +122,7 @@ int wxDisplayDepth()
return gdk_window_get_visual( wxGetRootWindow()->window )->depth;
}
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
#ifdef __WXGTK20__
@ -138,7 +138,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.versionMajor = GTK_MAJOR_VERSION;
info.versionMinor = GTK_MINOR_VERSION;
info.os = wxGTK;
return &info;
return info;
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)

View File

@ -122,7 +122,7 @@ int wxDisplayDepth()
return gdk_window_get_visual( wxGetRootWindow()->window )->depth;
}
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
#ifdef __WXGTK20__
@ -138,7 +138,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.versionMajor = GTK_MAJOR_VERSION;
info.versionMinor = GTK_MINOR_VERSION;
info.os = wxGTK;
return &info;
return info;
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)

View File

@ -218,19 +218,19 @@ static int DoGetOSVersion(int *majorVsn, int *minorVsn)
#endif
}
wxToolkitInfo *wxConsoleAppTraits::GetToolkitInfo()
wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion);
info.name = _T("wxBase");
return &info;
return info;
}
#endif // wxUSE_BASE
#if wxUSE_GUI
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion);
@ -240,7 +240,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.shortName << _T("univ");
info.name << _T("/wxUniversal");
#endif
return &info;
return info;
}
// Reading and writing resources (eg WIN.INI, .Xdefaults)

View File

@ -218,19 +218,19 @@ static int DoGetOSVersion(int *majorVsn, int *minorVsn)
#endif
}
wxToolkitInfo *wxConsoleAppTraits::GetToolkitInfo()
wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion);
info.name = _T("wxBase");
return &info;
return info;
}
#endif // wxUSE_BASE
#if wxUSE_GUI
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
info.os = DoGetOSVersion(&info.majorVersion, &info.minorVersion);
@ -240,7 +240,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.shortName << _T("univ");
info.name << _T("/wxUniversal");
#endif
return &info;
return info;
}
// Reading and writing resources (eg WIN.INI, .Xdefaults)

View File

@ -133,7 +133,7 @@ void wxBell()
XBell (wxGlobalDisplay(), 0);
}
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
wxToolkitInfo info;
info.shortName = _T("motif");
@ -150,7 +150,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.versionMajor = ProtocolVersion (display);
info.versionMinor = ProtocolRevision (display);
info.os = wxMOTIF_X;
return &info;
return info;
}
// ----------------------------------------------------------------------------

View File

@ -229,20 +229,20 @@ bool wxGUIAppTraits::DoMessageFromThreadWait()
return !wxTheApp || wxTheApp->DoMessage();
}
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
wxToolkitInfo *baseInfo = wxAppTraits::GetToolkitInfo();
info.versionMajor = baseInfo->versionMajor;
info.versionMinor = baseInfo->versionMinor;
info.os = baseInfo->os;
wxToolkitInfo& baseInfo = wxAppTraits::GetToolkitInfo();
info.versionMajor = baseInfo.versionMajor;
info.versionMinor = baseInfo.versionMinor;
info.os = baseInfo.os;
info.shortName = _T("msw");
info.name = _T("wxMSW");
#ifdef __WXUNIVERSAL__
info.shortName << _T("univ");
info.name << _T("/wxUniversal");
#endif
return &info;
return info;
}
// ===========================================================================

View File

@ -1012,7 +1012,7 @@ wxString wxGetOsDescription()
#endif // Win32/16
}
wxToolkitInfo *wxAppTraits::GetToolkitInfo()
wxToolkitInfo& wxAppTraits::GetToolkitInfo()
{
// cache the version info, it's not going to change
//
@ -1061,7 +1061,7 @@ wxToolkitInfo *wxAppTraits::GetToolkitInfo()
info.versionMinor = s_minor;
info.os = s_ver;
info.name = _T("wxBase");
return &info;
return info;
}
// ----------------------------------------------------------------------------

View File

@ -88,7 +88,7 @@ wxConsoleAppTraits::WaitForChild(wxExecuteData& execData)
// this is in mac/utils.cpp under Mac
#ifndef __WXMAC__
wxToolkitInfo *wxConsoleAppTraits::GetToolkitInfo()
wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
int major, minor;
@ -106,7 +106,7 @@ wxToolkitInfo *wxConsoleAppTraits::GetToolkitInfo()
info.name = _T("wxBase");
info.os = wxUNIX;
return &info;
return info;
}
#endif // __WXMAC__

View File

@ -98,7 +98,7 @@ void wxBell()
XBell ((Display*) wxGetDisplay(), 0);
}
wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
{
static wxToolkitInfo info;
info.shortName = _T("x11univ");
@ -106,7 +106,7 @@ wxToolkitInfo *wxGUIAppTraits::GetToolkitInfo()
info.versionMajor = 0;
info.versionMinor = 0;
info.os = wxX11;
return &info;
return info;
}
// ----------------------------------------------------------------------------