]> git.sesse.net Git - vlc/commitdiff
WxWidgets: use wraptext in UTF-8 mode as that is the codeset for gettext
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 6 Mar 2006 10:25:12 +0000 (10:25 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 6 Mar 2006 10:25:12 +0000 (10:25 +0000)
core: remove unused ISO-8859-centric monobyte mode from vlc_wraptext()

include/vlc_common.h
include/vlc_symbols.h
modules/gui/wxwidgets/dialogs/preferences.cpp
modules/gui/wxwidgets/dialogs/preferences_widgets.cpp
modules/gui/wxwidgets/dialogs/wizard.cpp
modules/gui/wxwidgets/interface.cpp
src/extras/libc.c

index 2c54cdba09b743d8fe404f4ce8f6c058b9f6e236..60204149f9ef06ad807cd363fc975ecfe397538d 100644 (file)
@@ -1069,7 +1069,7 @@ VLC_EXPORT( char **, vlc_parse_cmdline, ( const char *, int * ) );
 
 /* vlc_wraptext (defined in src/extras/libc.c) */
 #define wraptext vlc_wraptext
-VLC_EXPORT( char *, vlc_wraptext, ( const char *, int, vlc_bool_t ) );
+VLC_EXPORT( char *, vlc_wraptext, ( const char *, int ) );
 
 /* iconv wrappers (defined in src/extras/libc.c) */
 typedef void *vlc_iconv_t;
index 02440c50243859fe081624bcfac7a26ff85f5e3f..0d1db907fb22210e367c1e24b5fb0b107f20b774 100644 (file)
@@ -186,7 +186,7 @@ struct module_symbols_t
     int (*vlc_closedir_inner) (void *);
     vlc_bool_t (*vlc_ureduce_inner) (unsigned *, unsigned *, uint64_t, uint64_t, uint64_t);
     char ** (*vlc_parse_cmdline_inner) (const char *, int *);
-    char * (*vlc_wraptext_inner) (const char *, int, vlc_bool_t);
+    char * (*vlc_wraptext_inner) (const char *, int);
     vlc_iconv_t (*vlc_iconv_open_inner) (const char *, const char *);
     size_t (*vlc_iconv_inner) (vlc_iconv_t, char **, size_t *, char **, size_t *);
     int (*vlc_iconv_close_inner) (vlc_iconv_t);
index 105fde47147d1ecac81278b3aa5cc4963917069b..cce40e3603bf7f08d615a50018151a212e7afbbc 100644 (file)
@@ -376,8 +376,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
                 psz_help = config_CategoryHelpGet( p_item->i_value );
                 if( psz_help )
                 {
-                    config_data->psz_help = wraptext( strdup( psz_help ),
-                                                      72 , 1 );
+                    config_data->psz_help = wraptext( strdup( psz_help ), 72 );
                 }
                 else
                 {
@@ -425,8 +424,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
                     char *psz_help = config_CategoryHelpGet( p_item->i_value );
                     if( psz_help )
                     {
-                        cd->psz_help = wraptext( strdup( psz_help ),72 ,
-                                                 1 );
+                        cd->psz_help = wraptext( strdup( psz_help ), 72 );
                     }
                     else
                     {
@@ -442,8 +440,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
                 psz_help = config_CategoryHelpGet( p_item->i_value );
                 if( psz_help )
                 {
-                    config_data->psz_help = wraptext( strdup( psz_help ) ,
-                                                      72 , 1 );
+                    config_data->psz_help = wraptext( strdup( psz_help ), 72 );
                 }
                 else
                 {
index 10f3cb2fbc37b5e35796294f44fc08ed36f40b21..8729f66c4490c3591274c9ff0f126324b9fd7188 100644 (file)
@@ -430,7 +430,7 @@ ModuleListCatConfigControl::ModuleListCatConfigControl( vlc_object_t *p_this,
     text->SetToolTip( wxU(p_item->psz_longtext) );
     sizer->Add(text, 0, wxEXPAND|wxALL, 5 );
 
-    sizer->Add (new wxStaticText( this, -1, wxU( vlc_wraptext( _("Select modules that you want. To get more advanced control, you can also modify the resulting chain by yourself") , 72, 1 ) ) ) );
+    sizer->Add (new wxStaticText( this, -1, wxU( vlc_wraptext( _("Select modules that you want. To get more advanced control, you can also modify the resulting chain by yourself") , 72 ) ) ) );
 
     sizer->Layout();
     this->SetSizerAndFit( sizer );
index 75b615e799527deb3b49b77500a2b6d34f37a659..7a8710b451972746af67afb18916e84d27341ff3 100644 (file)
@@ -434,7 +434,7 @@ static void pageHeader( wxWindow *window, wxBoxSizer *sizer,
     wtitle->SetFont(font);
     sizer->Add( wtitle, 0, wxALL, 5 );
     sizer->Add( new wxStaticText( window, -1,
-                wxU( vlc_wraptext( psz_text , TEXTWIDTH, false ) ) ),
+                wxU( vlc_wraptext( psz_text , TEXTWIDTH ) ) ),
                         0, wxALL, 5 );
 }
 
@@ -484,7 +484,7 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
                         wxBOTTOM, 5 );
 
         mainSizer->Add( new wxStaticText(this, -1,
-                        wxU( vlc_wraptext(HELLO_NOTICE , TEXTWIDTH , false ))),
+                        wxU( vlc_wraptext(HELLO_NOTICE , TEXTWIDTH ))),
                         0, wxALL, 5 );
 
         SetSizer(mainSizer);
@@ -846,7 +846,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
 
     /* Line 3 : text */
     video_text = new wxStaticText( this, -1,
-                     wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) );
+                     wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH ) ) );
     /* Fill the main video sizer */
     video_sizer->Add( video_sizer1 , 0, wxEXPAND , 5 );
     video_sizer->Add( video_text, 0, wxLEFT|wxTOP , 5 );
@@ -885,7 +885,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
 
     /* Line 3 : text */
     audio_text = new wxStaticText( this, -1,
-                     wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) );
+                     wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH ) ) );
 
     audio_sizer->Add(audio_sizer1, 0, wxEXPAND, 5);
     audio_sizer->Add( audio_text, 0, wxLEFT | wxTOP, 5 );
@@ -925,7 +925,7 @@ void wizTranscodeCodecPage::OnVideoCodecChange(wxCommandEvent& event)
 {
     struct codec *c = (struct codec*)
              (video_combo->GetClientData(video_combo->GetSelection()));
-    video_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH, false) ) );
+    video_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH ) ) );
     i_video_codec = video_combo->GetSelection();
     vcodec = strdup(c->psz_codec);
 }
@@ -934,7 +934,7 @@ void wizTranscodeCodecPage::OnAudioCodecChange(wxCommandEvent& event)
 {
     struct codec *c = (struct codec*)
              (audio_combo->GetClientData(audio_combo->GetSelection()));
-    audio_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH, false) ) );
+    audio_text->SetLabel( wxU( vlc_wraptext(c->psz_descr, TEXTWIDTH ) ) );
     i_audio_codec = audio_combo->GetSelection();
     acodec = strdup(c->psz_codec);
 
@@ -1050,8 +1050,7 @@ wizStreamingMethodPage::wizStreamingMethodPage( intf_thread_t *p_this, wxWizard
 
     /* Big kludge, we take the longest text to get the size */
     address_text = new wxStaticText(this, -1,
-               wxU( vlc_wraptext(methods_array[2].psz_address,
-                                 TEXTWIDTH, false ) ),
+               wxU( vlc_wraptext(methods_array[2].psz_address, TEXTWIDTH ) ),
                wxDefaultPosition, wxDefaultSize );
 
     address_txtctrl = new wxTextCtrl( this, -1, wxU(""), wxDefaultPosition,
@@ -1063,7 +1062,7 @@ wizStreamingMethodPage::wizStreamingMethodPage( intf_thread_t *p_this, wxWizard
     /* Set the minimum size */
     address_sizer->SetMinSize( address_sizer->GetSize() );
     address_text->SetLabel( wxU(
-     vlc_wraptext( _(methods_array[0].psz_address), TEXTWIDTH, false)));
+     vlc_wraptext( _(methods_array[0].psz_address), TEXTWIDTH )));
 
     mainSizer->Add( method_sizer, 0, wxALL | wxEXPAND, 5 );
     mainSizer->Add( address_sizer, 0, wxALL | wxEXPAND, 5 );
@@ -1128,7 +1127,7 @@ void wizStreamingMethodPage::OnMethodChange( wxCommandEvent& event )
 {
     i_method = event.GetId() - MethodRadio0_Event;
     address_text->SetLabel( wxU(
-     vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false)));
+     vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH )));
     address_sizer->Layout();
     mainSizer->Layout();
 }
index 772a605cc669b2b0ef3538c5870c91ef22a86b66..712a831d067b018ebf8277cc4992d00f07f9112d 100644 (file)
@@ -919,7 +919,7 @@ void Interface::OnAbout( wxCommandEvent& WXUNUSED(event) )
        wxU(_("Compiler: "))+ wxU(VLC_Compiler())+wxT( ".\n") +
        wxU(_("Based on SVN revision: "))+wxU(VLC_Changeset())+wxT(".\n\n") +
 #ifdef __WXMSW__
-        wxU( vlc_wraptext(LICENSE_MSG,WRAPCOUNT,VLC_TRUE) ) + wxT("\n\n") +
+        wxU( vlc_wraptext(LICENSE_MSG,WRAPCOUNT) ) + wxT("\n\n") +
 #else
         wxU( LICENSE_MSG ) + wxT("\n\n") +
 #endif
index 19fd2a384c66839098e26d97877dca364b140144..d358bfd1bf873a4428b2349d7180618cfbaaa419 100644 (file)
@@ -531,17 +531,14 @@ static int count_utf8_string( const char *psz_string )
  * wraptext: inserts \n at convenient places to wrap the text.
  *           Returns the modified string in a new buffer.
  *****************************************************************************/
-char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
+char *vlc_wraptext( const char *psz_text, int i_line )
 {
     int i_len;
     char *psz_line, *psz_new_text;
 
     psz_line = psz_new_text = strdup( psz_text );
 
-    if( b_utf8 )
-        i_len = count_utf8_string( psz_text );
-    else
-        i_len = strlen( psz_text );
+    i_len = count_utf8_string( psz_text );
 
     while( i_len > i_line )
     {
@@ -550,10 +547,7 @@ char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
         int i_count = 0;
         while( i_count <= i_line && *psz_parser != '\n' )
         {
-            if( b_utf8 )
-            {
-                while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
-            }
+            while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
             psz_parser++;
             i_count++;
         }
@@ -567,10 +561,7 @@ char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
         /* Find the furthest space. */
         while( psz_parser > psz_line && *psz_parser != ' ' )
         {
-            if( b_utf8 )
-            {
-                while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
-            }
+            while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
             psz_parser--;
             i_count--;
         }
@@ -585,10 +576,7 @@ char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
         /* Wrapping has failed. Find the first space or newline */
         while( i_count < i_len && *psz_parser != ' ' && *psz_parser != '\n' )
         {
-            if( b_utf8 )
-            {
-                while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
-            }
+            while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
             psz_parser++;
             i_count++;
         }