]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/utilsgtk.cpp
Don't always maximize top-level windows on Smartphone
[wxWidgets.git] / src / gtk / utilsgtk.cpp
index dc1d99dd9b1ed38184aaf981ad4f76ecbdcb11f4..4d780162b65bcf16c34789b9fbdb8c0adfb60e0d 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
@@ -81,6 +81,43 @@ bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
 }
 #endif
 
 }
 #endif
 
+#ifdef __WXGTK20__
+// Escapes string so that it is valid Pango markup XML string:
+wxString wxEscapeStringForPangoMarkup(const wxString& str)
+{
+    size_t len = str.length();
+    wxString out;
+    out.Alloc(len);
+    for (size_t i = 0; i < len; i++)
+    {
+        wxChar c = str[i];
+        switch (c)
+        {
+            case _T('&'):
+                out << _T("&amp;");
+                break;
+            case _T('<'):
+                out << _T("&lt;");
+                break;
+            case _T('>'):
+                out << _T("&gt;");
+                break;
+            case _T('\''):
+                out << _T("&apos;");
+                break;
+            case _T('"'):
+                out << _T("&quot;");
+                break;
+            default:
+                out << c;
+                break;
+        }
+    }
+    return out;
+}
+#endif
+
+
 // ----------------------------------------------------------------------------
 // display characterstics
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // display characterstics
 // ----------------------------------------------------------------------------
@@ -157,7 +194,8 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
 // subprocess routines
 // ----------------------------------------------------------------------------
 
 // subprocess routines
 // ----------------------------------------------------------------------------
 
-extern "C"
+extern "C" {
+static
 void GTK_EndProcessDetector(gpointer data, gint source,
                             GdkInputCondition WXUNUSED(condition) )
 {
 void GTK_EndProcessDetector(gpointer data, gint source,
                             GdkInputCondition WXUNUSED(condition) )
 {
@@ -188,6 +226,7 @@ void GTK_EndProcessDetector(gpointer data, gint source,
 
    wxHandleProcessTermination(proc_data);
 }
 
    wxHandleProcessTermination(proc_data);
 }
+}
 
 int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
 {
 
 int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
 {