Mercurial > mplayer.hg
comparison gui/dialog/preferences.c @ 36624:811c9f3f781a
Replace string constants by symbolic constants.
author | ib |
---|---|
date | Fri, 24 Jan 2014 15:36:07 +0000 |
parents | 28953f222517 |
children | 7d250553d451 |
comparison
equal
deleted
inserted
replaced
36623:e0572501d2cd | 36624:811c9f3f781a |
---|---|
153 #ifdef CONFIG_ICONV | 153 #ifdef CONFIG_ICONV |
154 static GtkWidget * CBSubEncoding, * ESubEncoding; | 154 static GtkWidget * CBSubEncoding, * ESubEncoding; |
155 #endif | 155 #endif |
156 | 156 |
157 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | 157 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) |
158 #define ENC_UTF8 "UTF-8" | |
159 #define ENC_UNICODE "UNICODE" | |
158 static struct | 160 static struct |
159 { | 161 { |
160 char * name; | 162 char * name; |
161 char * comment; | 163 char * comment; |
162 } lEncoding[] = | 164 } lEncoding[] = |
163 { | 165 { |
164 { "UTF-8", MSGTR_PREFERENCES_FontEncoding24 }, | 166 { ENC_UTF8, MSGTR_PREFERENCES_FontEncoding24 }, |
165 { "ISO-8859-1", MSGTR_PREFERENCES_FontEncoding2 }, | 167 { "ISO-8859-1", MSGTR_PREFERENCES_FontEncoding2 }, |
166 { "ISO-8859-2", MSGTR_PREFERENCES_FontEncoding4 }, | 168 { "ISO-8859-2", MSGTR_PREFERENCES_FontEncoding4 }, |
167 { "ISO-8859-3", MSGTR_PREFERENCES_FontEncoding5 }, | 169 { "ISO-8859-3", MSGTR_PREFERENCES_FontEncoding5 }, |
168 { "ISO-8859-4", MSGTR_PREFERENCES_FontEncoding6 }, | 170 { "ISO-8859-4", MSGTR_PREFERENCES_FontEncoding6 }, |
169 { "ISO-8859-5", MSGTR_PREFERENCES_FontEncoding7 }, | 171 { "ISO-8859-5", MSGTR_PREFERENCES_FontEncoding7 }, |
194 { "CP874", MSGTR_PREFERENCES_FontEncoding20 }, | 196 { "CP874", MSGTR_PREFERENCES_FontEncoding20 }, |
195 { "CP932", MSGTR_PREFERENCES_FontEncoding29 }, | 197 { "CP932", MSGTR_PREFERENCES_FontEncoding29 }, |
196 { "CP936", MSGTR_PREFERENCES_FontEncoding16 }, | 198 { "CP936", MSGTR_PREFERENCES_FontEncoding16 }, |
197 { "CP949", MSGTR_PREFERENCES_FontEncoding19 }, | 199 { "CP949", MSGTR_PREFERENCES_FontEncoding19 }, |
198 { "CP950", MSGTR_PREFERENCES_FontEncoding30 }, | 200 { "CP950", MSGTR_PREFERENCES_FontEncoding30 }, |
199 { "UNICODE", MSGTR_PREFERENCES_FontEncoding1 }, | 201 { ENC_UNICODE, MSGTR_PREFERENCES_FontEncoding1 }, |
200 { NULL,NULL } | 202 { NULL,NULL } |
201 }; | 203 }; |
202 #endif | 204 #endif |
203 | 205 |
204 static int old_audio_driver = 0; | 206 static int old_audio_driver = 0; |
814 { | 816 { |
815 int i, listed=(sub_cp == NULL); | 817 int i, listed=(sub_cp == NULL); |
816 | 818 |
817 for ( i=0;lEncoding[i].name;i++ ) | 819 for ( i=0;lEncoding[i].name;i++ ) |
818 { | 820 { |
819 cd=iconv_open( "UTF-8",lEncoding[i].name ); | 821 cd=iconv_open( ENC_UTF8,lEncoding[i].name ); |
820 | 822 |
821 if (cd != (iconv_t) -1) | 823 if (cd != (iconv_t) -1) |
822 { | 824 { |
823 iconv_close(cd); | 825 iconv_close(cd); |
824 CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); | 826 CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); |
911 gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | 913 gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
912 { | 914 { |
913 int i, append, listed=(subtitle_font_encoding == NULL); | 915 int i, append, listed=(subtitle_font_encoding == NULL); |
914 for ( i=0;lEncoding[i].name;i++ ) | 916 for ( i=0;lEncoding[i].name;i++ ) |
915 { | 917 { |
916 append=(strcasecmp( lEncoding[i].name,"UNICODE" ) == 0); | 918 append=(strcasecmp( lEncoding[i].name,ENC_UNICODE ) == 0); |
917 #ifdef CONFIG_ICONV | 919 #ifdef CONFIG_ICONV |
918 cd=iconv_open( "ucs-4",lEncoding[i].name ); | 920 cd=iconv_open( "ucs-4",lEncoding[i].name ); |
919 | 921 |
920 if (cd != (iconv_t) -1) | 922 if (cd != (iconv_t) -1) |
921 { | 923 { |
1306 gtk_adjustment_set_value( HSFontOutLineadj,subtitle_font_thickness / 8.0 * 100.0); // transform 0..8 to 0..100 | 1308 gtk_adjustment_set_value( HSFontOutLineadj,subtitle_font_thickness / 8.0 * 100.0); // transform 0..8 to 0..100 |
1307 gtk_adjustment_set_value( HSFontTextScaleadj,text_font_scale_factor ); | 1309 gtk_adjustment_set_value( HSFontTextScaleadj,text_font_scale_factor ); |
1308 gtk_adjustment_set_value( HSFontOSDScaleadj,osd_font_scale_factor ); | 1310 gtk_adjustment_set_value( HSFontOSDScaleadj,osd_font_scale_factor ); |
1309 { | 1311 { |
1310 int i; | 1312 int i; |
1311 const char *s = (subtitle_font_encoding ? subtitle_font_encoding : "UNICODE"); | 1313 const char *s = (subtitle_font_encoding ? subtitle_font_encoding : ENC_UNICODE); |
1312 for ( i=0;lEncoding[i].name;i++ ) | 1314 for ( i=0;lEncoding[i].name;i++ ) |
1313 if ( !strcasecmp( s,lEncoding[i].name ) ) break; | 1315 if ( !strcasecmp( s,lEncoding[i].name ) ) break; |
1314 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); | 1316 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); |
1315 else gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),s ); | 1317 else gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),s ); |
1316 } | 1318 } |