]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/settings.cpp
Fix history in wxWebViewIE when using a custom file scheme.
[wxWidgets.git] / src / gtk1 / settings.cpp
index 7eb099a0af6365dbd2afccac18ae0fc5c668a875..815c1e0aee75ccea6e70484f72b2c76b272c2830 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gtk/settings.cpp
+// Name:        src/gtk1/settings.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Modified by: Mart Raudsepp (GetMetric)
 #include "wx/wxprec.h"
 
 #include "wx/settings.h"
-#include "wx/debug.h"
-#include "wx/cmndata.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/toplevel.h"
+#endif
+
 #include "wx/fontutil.h"
-#include "wx/toplevel.h"
 
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
@@ -79,7 +81,7 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue,
     switch ( type )
     {
         default:
-            wxFAIL_MSG( _T("unexpected GTK widget type") );
+            wxFAIL_MSG( wxT("unexpected GTK widget type") );
             // fall through
 
         case wxGTK_BUTTON:
@@ -105,7 +107,7 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue,
         switch ( colour )
         {
             default:
-                wxFAIL_MSG( _T("unexpected GTK colour type") );
+                wxFAIL_MSG( wxT("unexpected GTK colour type") );
                 // fall through
 
             case wxGTK_FG:
@@ -125,11 +127,11 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue,
         green = col[state].green;
         blue = col[state].blue;
 
-        ok = TRUE;
+        ok = true;
     }
     else
     {
-        ok = FALSE;
+        ok = false;
     }
 
     gtk_widget_destroy( widget );
@@ -146,7 +148,7 @@ static void GetTooltipColors()
     gs_objects.m_colTooltip = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT);
     c = tooltips->tip_window->style->fg[GTK_STATE_NORMAL];
     gs_objects.m_colTooltipText = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT);
-    gtk_object_sink(wx_reinterpret_cast(GtkObject*, tooltips));
+    gtk_object_sink(reinterpret_cast<GtkObject*>(tooltips));
 }
 
 wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
@@ -163,7 +165,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
         case wxSYS_COLOUR_BTNFACE:
         case wxSYS_COLOUR_MENUBAR:
         case wxSYS_COLOUR_3DLIGHT:
-            if (!gs_objects.m_colBtnFace.Ok())
+            if (!gs_objects.m_colBtnFace.IsOk())
             {
                 int red, green, blue;
                 if ( !GetColourFromGTKWidget(red, green, blue) )
@@ -188,7 +190,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
         case wxSYS_COLOUR_GRAYTEXT:
         case wxSYS_COLOUR_BTNSHADOW:
         //case wxSYS_COLOUR_3DSHADOW:
-            if (!gs_objects.m_colBtnShadow.Ok())
+            if (!gs_objects.m_colBtnShadow.IsOk())
             {
                 wxColour faceColour(GetColour(wxSYS_COLOUR_3DFACE));
                 gs_objects.m_colBtnShadow =
@@ -204,7 +206,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             return * wxWHITE;
 
         case wxSYS_COLOUR_HIGHLIGHT:
-            if (!gs_objects.m_colHighlight.Ok())
+            if (!gs_objects.m_colHighlight.IsOk())
             {
                 int red, green, blue;
                 if ( !GetColourFromGTKWidget(red, green, blue,
@@ -223,7 +225,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             return gs_objects.m_colHighlight;
 
         case wxSYS_COLOUR_LISTBOX:
-            if (!gs_objects.m_colListBox.Ok())
+            if (!gs_objects.m_colListBox.IsOk())
             {
                 int red, green, blue;
                 if ( GetColourFromGTKWidget(red, green, blue,
@@ -247,7 +249,8 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
         case wxSYS_COLOUR_CAPTIONTEXT:
         case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
         case wxSYS_COLOUR_BTNTEXT:
-            if (!gs_objects.m_colBtnText.Ok())
+        case wxSYS_COLOUR_LISTBOXTEXT:
+            if (!gs_objects.m_colBtnText.IsOk())
             {
                 int red, green, blue;
                 if ( !GetColourFromGTKWidget(red, green, blue,
@@ -267,19 +270,20 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             return gs_objects.m_colBtnText;
 
         case wxSYS_COLOUR_INFOBK:
-            if (!gs_objects.m_colTooltip.Ok()) {
+            if (!gs_objects.m_colTooltip.IsOk()) {
                 GetTooltipColors();
             }
             return gs_objects.m_colTooltip;
 
         case wxSYS_COLOUR_INFOTEXT:
-            if (!gs_objects.m_colTooltipText.Ok()) {
+            if (!gs_objects.m_colTooltipText.IsOk()) {
                 GetTooltipColors();
             }
             return gs_objects.m_colTooltipText;
 
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
         case wxSYS_COLOUR_HIGHLIGHTTEXT:
-            if (!gs_objects.m_colHighlightText.Ok())
+            if (!gs_objects.m_colHighlightText.IsOk())
             {
                 wxColour hclr = GetColour(wxSYS_COLOUR_HIGHLIGHT);
                 if (hclr.Red() > 200 && hclr.Green() > 200 && hclr.Blue() > 200)
@@ -294,7 +298,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
 
         case wxSYS_COLOUR_ACTIVECAPTION:
         case wxSYS_COLOUR_MENUHILIGHT:
-            if (!gs_objects.m_colMenuItemHighlight.Ok())
+            if (!gs_objects.m_colMenuItemHighlight.IsOk())
             {
                 int red, green, blue;
                 if ( !GetColourFromGTKWidget(red, green, blue,
@@ -321,7 +325,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
 
         case wxSYS_COLOUR_MAX:
         default:
-            wxFAIL_MSG( _T("unknown system colour index") );
+            wxFAIL_MSG( wxT("unknown system colour index") );
     }
 
     return *wxWHITE;
@@ -342,7 +346,7 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
         case wxSYS_DEVICE_DEFAULT_FONT:
         case wxSYS_DEFAULT_GUI_FONT:
         {
-            if (!gs_objects.m_fontSystem.Ok())
+            if (!gs_objects.m_fontSystem.IsOk())
             {
                 gs_objects.m_fontSystem = wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
             }
@@ -354,7 +358,8 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
     }
 }
 
-int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win )
+int
+wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
 {
     switch (index)
     {
@@ -465,12 +470,12 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
     switch (index)
     {
         case wxSYS_CAN_ICONIZE_FRAME:
-            return FALSE;
+            return false;
 
         case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
-            return TRUE;
+            return true;
 
         default:
-            return FALSE;
+            return false;
     }
 }