]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
fix more unused parameters warnings
[wxWidgets.git] / src / gtk / textctrl.cpp
index 37c1c1a3f59f4d0402400c9287ea65339578a953..a1bdfc5414f601bfdcb93badd9ba78ca9bfc0404 100644 (file)
@@ -38,8 +38,8 @@
 extern "C" {
 static void wxGtkOnRemoveTag(GtkTextBuffer *buffer,
                              GtkTextTag *tag,
 extern "C" {
 static void wxGtkOnRemoveTag(GtkTextBuffer *buffer,
                              GtkTextTag *tag,
-                             GtkTextIter *start,
-                             GtkTextIter *end,
+                             GtkTextIter * WXUNUSED(start),
+                             GtkTextIter * WXUNUSED(end),
                              char *prefix)
 {
     gchar *name;
                              char *prefix)
 {
     gchar *name;
@@ -84,7 +84,9 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text,
     {
         wxGtkTextRemoveTagsWithPrefix(text_buffer, "WXFONT", start, end);
 
     {
         wxGtkTextRemoveTagsWithPrefix(text_buffer, "WXFONT", start, end);
 
-        PangoFontDescription *font_description = attr.GetFont().GetNativeFontInfo()->description;
+        wxFont font(attr.GetFont());
+
+        PangoFontDescription *font_description = font.GetNativeFontInfo()->description;
         wxGtkString font_string(pango_font_description_to_string(font_description));
         g_snprintf(buf, sizeof(buf), "WXFONT %s", font_string.c_str());
         tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
         wxGtkString font_string(pango_font_description_to_string(font_description));
         g_snprintf(buf, sizeof(buf), "WXFONT %s", font_string.c_str());
         tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
@@ -95,7 +97,7 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text,
                                               NULL );
         gtk_text_buffer_apply_tag (text_buffer, tag, start, end);
 
                                               NULL );
         gtk_text_buffer_apply_tag (text_buffer, tag, start, end);
 
-        if (attr.GetFont().GetUnderlined())
+        if (font.GetUnderlined())
         {
             g_snprintf(buf, sizeof(buf), "WXFONTUNDERLINE");
             tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
         {
             g_snprintf(buf, sizeof(buf), "WXFONTUNDERLINE");
             tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
@@ -303,9 +305,9 @@ extern "C" {
 static void
 au_apply_tag_callback(GtkTextBuffer *buffer,
                       GtkTextTag *tag,
 static void
 au_apply_tag_callback(GtkTextBuffer *buffer,
                       GtkTextTag *tag,
-                      GtkTextIter *start,
-                      GtkTextIter *end,
-                      gpointer textctrl)
+                      GtkTextIter * WXUNUSED(start),
+                      GtkTextIter * WXUNUSED(end),
+                      gpointer WXUNUSED(textctrl))
 {
     if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl"))
         g_signal_stop_emission_by_name (buffer, "apply_tag");
 {
     if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl"))
         g_signal_stop_emission_by_name (buffer, "apply_tag");
@@ -318,7 +320,7 @@ au_apply_tag_callback(GtkTextBuffer *buffer,
 
 extern "C" {
 static gboolean
 
 extern "C" {
 static gboolean
-pred_whitespace (gunichar ch, gpointer user_data)
+pred_whitespace(gunichar ch, gpointer WXUNUSED(user_data))
 {
     return g_unichar_isspace(ch);
 }
 {
     return g_unichar_isspace(ch);
 }
@@ -326,7 +328,7 @@ pred_whitespace (gunichar ch, gpointer user_data)
 
 extern "C" {
 static gboolean
 
 extern "C" {
 static gboolean
-pred_non_whitespace (gunichar ch, gpointer user_data)
+pred_non_whitespace (gunichar ch, gpointer WXUNUSED(user_data))
 {
     return !g_unichar_isspace(ch);
 }
 {
     return !g_unichar_isspace(ch);
 }
@@ -334,7 +336,7 @@ pred_non_whitespace (gunichar ch, gpointer user_data)
 
 extern "C" {
 static gboolean
 
 extern "C" {
 static gboolean
-pred_nonpunct (gunichar ch, gpointer user_data)
+pred_nonpunct (gunichar ch, gpointer WXUNUSED(user_data))
 {
     return !g_unichar_ispunct(ch);
 }
 {
     return !g_unichar_ispunct(ch);
 }
@@ -342,7 +344,7 @@ pred_nonpunct (gunichar ch, gpointer user_data)
 
 extern "C" {
 static gboolean
 
 extern "C" {
 static gboolean
-pred_nonpunct_or_slash (gunichar ch, gpointer user_data)
+pred_nonpunct_or_slash (gunichar ch, gpointer WXUNUSED(user_data))
 {
     return !g_unichar_ispunct(ch) || ch == '/';
 }
 {
     return !g_unichar_ispunct(ch) || ch == '/';
 }
@@ -451,7 +453,7 @@ au_check_range(GtkTextIter *s,
 
 extern "C" {
 static void
 
 extern "C" {
 static void
-au_insert_text_callback(GtkTextBuffer *buffer,
+au_insert_text_callback(GtkTextBuffer * WXUNUSED(buffer),
                         GtkTextIter *end,
                         gchar *text,
                         gint len,
                         GtkTextIter *end,
                         gchar *text,
                         gint len,
@@ -483,7 +485,7 @@ au_insert_text_callback(GtkTextBuffer *buffer,
 
 extern "C" {
 static void
 
 extern "C" {
 static void
-au_delete_range_callback(GtkTextBuffer *buffer,
+au_delete_range_callback(GtkTextBuffer * WXUNUSED(buffer),
                          GtkTextIter *start,
                          GtkTextIter *end,
                          wxTextCtrl *win)
                          GtkTextIter *start,
                          GtkTextIter *end,
                          wxTextCtrl *win)
@@ -509,7 +511,7 @@ au_delete_range_callback(GtkTextBuffer *buffer,
 
 extern "C" {
 static void
 
 extern "C" {
 static void
-gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
+gtk_text_changed_callback( GtkWidget * WXUNUSED(widget), wxTextCtrl *win )
 {
     if ( win->IgnoreTextUpdate() )
         return;
 {
     if ( win->IgnoreTextUpdate() )
         return;
@@ -571,7 +573,9 @@ gtk_paste_clipboard_callback( GtkWidget *widget, wxTextCtrl *win )
 
 extern "C" {
 static gboolean
 
 extern "C" {
 static gboolean
-gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl *win )
+gtk_text_exposed_callback( GtkWidget * WXUNUSED(widget),
+                           GdkEventExpose * WXUNUSED(event),
+                           wxTextCtrl * WXUNUSED(win) )
 {
     return TRUE;
 }
 {
     return TRUE;
 }
@@ -943,7 +947,7 @@ wxFontEncoding wxTextCtrl::GetTextEncoding() const
     // first check the default text style (we intentionally don't check the
     // style for the current position as it doesn't make sense for SetValue())
     const wxTextAttr& style = GetDefaultStyle();
     // first check the default text style (we intentionally don't check the
     // style for the current position as it doesn't make sense for SetValue())
     const wxTextAttr& style = GetDefaultStyle();
-    wxFontEncoding enc = style.HasFont() ? style.GetFont().GetEncoding()
+    wxFontEncoding enc = style.HasFontEncoding() ? style.GetFontEncoding()
                                          : wxFONTENCODING_SYSTEM;
 
     // fall back to the controls font if no style
                                          : wxFONTENCODING_SYSTEM;
 
     // fall back to the controls font if no style
@@ -1028,9 +1032,9 @@ void wxTextCtrl::WriteText( const wxString &text )
     // check if we have a specific style for the current position
     wxFontEncoding enc = wxFONTENCODING_SYSTEM;
     wxTextAttr style;
     // check if we have a specific style for the current position
     wxFontEncoding enc = wxFONTENCODING_SYSTEM;
     wxTextAttr style;
-    if ( GetStyle(GetInsertionPoint(), style) && style.HasFont() )
+    if ( GetStyle(GetInsertionPoint(), style) && style.HasFontEncoding() )
     {
     {
-        enc = style.GetFont().GetEncoding();
+        enc = style.GetFontEncoding();
     }
 
     if ( enc == wxFONTENCODING_SYSTEM )
     }
 
     if ( enc == wxFONTENCODING_SYSTEM )
@@ -1232,7 +1236,7 @@ bool wxTextCtrl::Enable( bool enable )
 // wxGTK-specific: called recursively by Enable,
 // to give widgets an opportunity to correct their colours after they
 // have been changed by Enable
 // wxGTK-specific: called recursively by Enable,
 // to give widgets an opportunity to correct their colours after they
 // have been changed by Enable
-void wxTextCtrl::OnEnabled( bool enable )
+void wxTextCtrl::OnEnabled(bool WXUNUSED(enable))
 {
     // If we have a custom background colour, we use this colour in both
     // disabled and enabled mode, or we end up with a different colour under the
 {
     // If we have a custom background colour, we use this colour in both
     // disabled and enabled mode, or we end up with a different colour under the