]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/colour.cpp
Commit patch [ 1559950 ] fix mem leaks in wx{Dir|File}Dialog
[wxWidgets.git] / src / motif / colour.cpp
index 473e2028645ad8d305defded82c910cf493f32f3..32c0d39b78a3236fc1b4285e0d0008972601d38a 100644 (file)
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/gdicmn.h"
 #include "wx/colour.h"
-#include "wx/app.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/gdicmn.h"
+#endif
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -42,11 +45,6 @@ void wxColour::Init()
     m_pixel = -1;
 }
 
-wxColour::wxColour()
-{
-    Init();
-}
-
 wxColour::wxColour(const wxColour& col)
 {
     *this = col;
@@ -62,47 +60,12 @@ wxColour& wxColour::operator =(const wxColour& col)
     return *this;
 }
 
-void wxColour::InitFromName(const wxString& name)
-{
-    if ( wxTheColourDatabase )
-    {
-        wxColour col = wxTheColourDatabase->Find(name);
-        if ( col.Ok() )
-        {
-            *this = col;
-            return;
-        }
-    }
-
-    // leave invalid
-    Init();
-}
-
-/* static */
-wxColour wxColour::CreateByName(const wxString& name)
-{
-    wxColour col;
-
-    Display *dpy = wxGlobalDisplay();
-    WXColormap colormap = wxTheApp->GetMainColormap( dpy );
-    XColor xcol;
-    if ( XParseColor( dpy, (Colormap)colormap, name.mb_str(), &xcol ) )
-    {
-        col.m_red = (unsigned char)(xcol.red & 0xff);
-        col.m_green = (unsigned char)(xcol.green & 0xff);
-        col.m_blue = (unsigned char)(xcol.blue & 0xff);
-        col.m_isInit = true;
-        col.m_pixel = -1;
-    }
-
-    return col;
-}
-
 wxColour::~wxColour()
 {
 }
 
-void wxColour::Set(unsigned char r, unsigned char g, unsigned char b)
+void wxColour::InitRGBA(unsigned char r, unsigned char g, unsigned char b,
+                        unsigned char WXUNUSED(a))
 {
     m_red = r;
     m_green = g;