4 * Copyright 1994 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
12 #else /* X_DISPLAY_MISSING */
14 #endif /* X_DISPLAY_MISSING */
21 #ifdef MALLOC_DEBUGGING
24 #include "wine/winuser16.h"
33 #include "builtin32.h"
35 #include "debugdefs.h"
43 /* when adding new languages look at ole/ole2nls.c
44 * for proper iso name and Windows code (add 0x0400
45 * to the code listed there)
47 const WINE_LANGUAGE_DEF Languages
[] =
49 {"En",0x0409}, /* LANG_En */
50 {"Es",0x040A}, /* LANG_Es */
51 {"De",0x0407}, /* LANG_De */
52 {"No",0x0414}, /* LANG_No */
53 {"Fr",0x040C}, /* LANG_Fr */
54 {"Fi",0x040B}, /* LANG_Fi */
55 {"Da",0x0406}, /* LANG_Da */
56 {"Cs",0x0405}, /* LANG_Cs */
57 {"Eo",0x048f}, /* LANG_Eo */
58 {"It",0x0410}, /* LANG_It */
59 {"Ko",0x0412}, /* LANG_Ko */
60 {"Hu",0x040e}, /* LANG_Hu */
61 {"Pl",0x0415}, /* LANG_Pl */
62 {"Pt",0x0416}, /* LANG_Pt */
63 {"Sv",0x041d}, /* LANG_Sv */
64 {"Ca",0x0403}, /* LANG_Ca */
65 {"Nl",0x0413}, /* LANG_Nl */
66 {"Ru",0x0419}, /* LANG_Ru */
70 WORD WINE_LanguageId
= 0x409; /* english as default */
72 struct options Options
=
73 { /* default options */
76 NULL
, /* desktopGeometry */
77 NULL
, /* programName */
80 FALSE
, /* usePrivateMap */
81 FALSE
, /* useFixedMap */
82 FALSE
, /* synchronous */
83 FALSE
, /* backing store */
84 SW_SHOWNORMAL
, /* cmdShow */
86 FALSE
, /* failReadOnly */
87 MODE_ENHANCED
, /* Enhanced mode */
89 DEFAULT_LANG
, /* Default language */
93 FALSE
, /* Managed windows */
94 FALSE
, /* Perfect graphics */
96 NULL
, /* Alternate config file name */
100 static char szUsage
[] =
102 "Usage: %s [options] \"program_name [arguments]\"\n"
103 #ifndef X_DISPLAY_MISSING
106 " -backingstore Turn on backing store\n"
107 " -config name Specify config file to use\n"
108 " -console driver Select which driver(s) to use for the console\n"
109 " -debug Enter debugger before starting application\n"
110 " -debugmsg name Turn debugging-messages on or off\n"
111 " -depth n Change the depth to use for multiple-depth screens\n"
112 " -desktop geom Use a desktop window of the given geometry\n"
113 " -display name Use the specified display\n"
114 " -dll name Enable or disable built-in DLLs\n"
115 " -failreadonly Read only files may not be opened in write mode\n"
116 " -fixedmap Use a \"standard\" color map\n"
117 " -help Show this help message\n"
118 " -iconic Start as an icon\n"
119 " -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n"
120 " Ko,Nl,No,Pl,Pt,Sv,Ru)\n"
121 " -managed Allow the window manager to manage created windows\n"
122 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
123 " -name name Set the application name\n"
124 " -nodga Disable XFree86 DGA extensions\n"
125 " -perfect Favor correctness over speed for graphical operations\n"
126 " -privatemap Use a private color map\n"
127 " -synchronous Turn on synchronous display mode\n"
128 " -version Display the Wine version\n"
129 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
130 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
131 #endif /* X_DISPLAY_MISSING */
134 /***********************************************************************
137 void MAIN_Usage( char *name
)
139 MSG( szUsage
, WINE_RELEASE_INFO
, name
);
143 /***********************************************************************
144 * MAIN_GetProgramName
146 * Get the program name. The name is specified by (in order of precedence):
147 * - the option '-name'.
148 * - the environment variable 'WINE_NAME'.
149 * - the last component of argv[0].
151 static char *MAIN_GetProgramName( int argc
, char *argv
[] )
156 for (i
= 1; i
< argc
-1; i
++)
157 if (!strcmp( argv
[i
], "-name" )) return argv
[i
+1];
158 if ((p
= getenv( "WINE_NAME" )) != NULL
) return p
;
159 if ((p
= strrchr( argv
[0], '/' )) != NULL
) return p
+1;
163 /***********************************************************************
164 * MAIN_ParseDebugOptions
166 * Turns specific debug messages on or off, according to "options".
169 * TRUE if parsing was successful
171 BOOL
MAIN_ParseDebugOptions(char *options
)
173 /* defined in relay32/relay386.c */
174 extern char **debug_relay_includelist
;
175 extern char **debug_relay_excludelist
;
176 /* defined in relay32/snoop.c */
177 extern char **debug_snoop_includelist
;
178 extern char **debug_snoop_excludelist
;
181 int l
, cls
, dotracerelay
= TRACE_ON(relay
);
186 if (options
[l
-1]=='\n') options
[l
-1]='\0';
189 if ((*options
!='+')&&(*options
!='-')){
192 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
193 if(!lstrncmpiA(options
, debug_cl_name
[j
], strlen(debug_cl_name
[j
])))
195 if(j
==DEBUG_CLASS_COUNT
)
197 options
+= strlen(debug_cl_name
[j
]);
198 if ((*options
!='+')&&(*options
!='-'))
203 cls
= -1; /* all classes */
205 if (strchr(options
,','))
206 l
=strchr(options
,',')-options
;
210 if (!lstrncmpiA(options
+1,"all",l
-1))
213 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
214 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
215 if(cls
== -1 || cls
== j
)
216 debug_msg_enabled
[i
][j
]=(*options
=='+');
218 else if (!lstrncmpiA(options
+1, "relay=", 6) ||
219 !lstrncmpiA(options
+1, "snoop=", 6))
222 char *s
, *s2
, ***output
, c
;
224 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
225 if (debug_ch_name
&& (!lstrncmpiA(debug_ch_name
[i
],options
+1,5))){
226 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
227 if(cls
== -1 || cls
== j
)
228 debug_msg_enabled
[i
][j
]=TRUE
;
231 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
232 if (i
==DEBUG_CHANNEL_COUNT
)
234 output
= (*options
== '+') ?
235 ((*(options
+1) == 'r') ?
236 &debug_relay_includelist
:
237 &debug_snoop_includelist
) :
238 ((*(options
+1) == 'r') ?
239 &debug_relay_excludelist
:
240 &debug_snoop_excludelist
);
243 while((s
= strchr(s
, ':'))) i
++, s
++;
244 *output
= malloc(sizeof(char **) * i
+ 1);
247 while((s2
= strchr(s
, ':'))) {
250 *((*output
)+i
) = strdup(s
);
256 *(options
+ l
) = '\0';
257 *((*output
)+i
) = strdup(s
);
259 *((*output
)+i
+1) = NULL
;
264 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
265 if (debug_ch_name
&& (!lstrncmpiA(options
+1,debug_ch_name
[i
],l
-1))){
266 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
267 if(cls
== -1 || cls
== j
)
268 debug_msg_enabled
[i
][j
]=(*options
=='+');
271 if (i
==DEBUG_CHANNEL_COUNT
)
276 while((*options
==',')&&(*(++options
)));
278 /* special handling for relay debugging */
279 if (dotracerelay
!= TRACE_ON(relay
))
280 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay
) );
286 MSG("%s: Syntax: -debugmsg [class]+xxx,... or "
287 "-debugmsg [class]-xxx,...\n",Options
.argv
[0]);
288 MSG("Example: -debugmsg +all,warn-heap\n"
289 " turn on all messages except warning heap messages\n");
290 MSG("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
291 " turn on -debugmsg +relay only as specified\n"
292 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
293 " turn on -debugmsg +relay except as specified\n"
294 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
296 MSG("Available message classes:\n");
297 for(i
=0;i
<DEBUG_CLASS_COUNT
;i
++)
298 MSG( "%-9s", debug_cl_name
[i
]);
301 MSG("Available message types:\n");
303 for(i
=0;i
<DEBUG_CHANNEL_COUNT
;i
++)
305 MSG("%-9s%c",debug_ch_name
[i
],
306 (((i
+2)%8==0)?'\n':' '));
311 /***********************************************************************
315 * Lang: a string whose two first chars are the iso name of a language.
316 * Country: a string whose two first chars are the iso name of country
317 * Charset: a string defining the chossen charset encoding
318 * Dialect: a string defining a variation of the locale
320 * all those values are from the standardized format of locale
321 * name in unix which is: Lang[_Country][.Charset][@Dialect]
324 * the numeric code of the language used by Windows (or 0x00)
326 int MAIN_GetLanguageID(LPCSTR Lang
,LPCSTR Country
,LPCSTR Charset
,LPCSTR Dialect
)
328 char lang
[3]="??", country
[3]={0,0,0};
329 char *charset
=NULL
, *dialect
=NULL
;
332 if (Lang
==NULL
) return 0x00;
333 if (Lang
[0]) lang
[0]=tolower(Lang
[0]);
334 if (Lang
[1]) lang
[1]=tolower(Lang
[1]);
337 if (Country
[0]) country
[0]=toupper(Country
[0]);
338 if (Country
[1]) country
[1]=toupper(Country
[1]);
343 charset
=(char*)malloc(j
+1);
345 charset
[i
]=toupper(Charset
[i
]);
351 dialect
=(char*)malloc(j
+1);
353 dialect
[i
]=tolower(Dialect
[i
]);
360 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
363 goto end_MAIN_GetLanguageID; \
365 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
366 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
367 goto end_MAIN_GetLanguageID;
368 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
369 goto end_MAIN_GetLanguageID; }
370 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
371 goto end_MAIN_GetLanguageID; \
374 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC
)
375 LANG_SUB_ENTRY( "SA", ARABIC
, ARABIC
)
376 LANG_SUB_ENTRY( "IQ", ARABIC
, ARABIC_IRAQ
)
377 LANG_SUB_ENTRY( "EG", ARABIC
, ARABIC_EGYPT
)
378 LANG_SUB_ENTRY( "LY", ARABIC
, ARABIC_LIBYA
)
379 LANG_SUB_ENTRY( "DZ", ARABIC
, ARABIC_ALGERIA
)
380 LANG_SUB_ENTRY( "MA", ARABIC
, ARABIC_MOROCCO
)
381 LANG_SUB_ENTRY( "TN", ARABIC
, ARABIC_TUNISIA
)
382 LANG_SUB_ENTRY( "OM", ARABIC
, ARABIC_OMAN
)
383 LANG_SUB_ENTRY( "YE", ARABIC
, ARABIC_YEMEN
)
384 LANG_SUB_ENTRY( "SY", ARABIC
, ARABIC_SYRIA
)
385 LANG_SUB_ENTRY( "JO", ARABIC
, ARABIC_JORDAN
)
386 LANG_SUB_ENTRY( "LB", ARABIC
, ARABIC_LEBANON
)
387 LANG_SUB_ENTRY( "KW", ARABIC
, ARABIC_KUWAIT
)
388 LANG_SUB_ENTRY( "AE", ARABIC
, ARABIC_UAE
)
389 LANG_SUB_ENTRY( "BH", ARABIC
, ARABIC_BAHRAIN
)
390 LANG_SUB_ENTRY( "QA", ARABIC
, ARABIC_QATAR
)
391 LANG_ENTRY_END( ARABIC
)
392 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN
)
393 LANG_ENTRY_END( BULGARIAN
)
394 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN
)
395 LANG_ENTRY_END( CATALAN
)
396 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE
)
397 LANG_SUB_ENTRY( "TW", CHINESE
, CHINESE_TRADITIONAL
)
398 LANG_SUB_ENTRY( "CN", CHINESE
, CHINESE_SIMPLIFIED
)
399 LANG_SUB_ENTRY( "HK", CHINESE
, CHINESE_HONGKONG
)
400 LANG_SUB_ENTRY( "SG", CHINESE
, CHINESE_SINGAPORE
)
401 LANG_SUB_ENTRY( "MO", CHINESE
, CHINESE_MACAU
)
402 LANG_ENTRY_END( CHINESE
)
403 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH
)
404 LANG_ENTRY_END( CZECH
)
405 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH
)
406 LANG_ENTRY_END( DANISH
)
407 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN
)
408 LANG_SUB_ENTRY( "DE", GERMAN
, GERMAN
)
409 LANG_SUB_ENTRY( "CH", GERMAN
, GERMAN_SWISS
)
410 LANG_SUB_ENTRY( "AT", GERMAN
, GERMAN_AUSTRIAN
)
411 LANG_SUB_ENTRY( "LU", GERMAN
, GERMAN_LUXEMBOURG
)
412 LANG_SUB_ENTRY( "LI", GERMAN
, GERMAN_LIECHTENSTEIN
)
413 LANG_ENTRY_END( GERMAN
)
414 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK
)
415 LANG_ENTRY_END( GREEK
)
416 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH
)
417 LANG_SUB_ENTRY( "US", ENGLISH
, ENGLISH_US
)
418 LANG_SUB_ENTRY( "UK", ENGLISH
, ENGLISH_UK
)
419 LANG_SUB_ENTRY( "AU", ENGLISH
, ENGLISH_AUS
)
420 LANG_SUB_ENTRY( "CA", ENGLISH
, ENGLISH_CAN
)
421 LANG_SUB_ENTRY( "NZ", ENGLISH
, ENGLISH_NZ
)
422 LANG_SUB_ENTRY( "EI", ENGLISH
, ENGLISH_EIRE
)
423 LANG_SUB_ENTRY( "ZA", ENGLISH
, ENGLISH_SAFRICA
)
424 LANG_SUB_ENTRY( "JM", ENGLISH
, ENGLISH_JAMAICA
)
425 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
426 LANG_SUB_ENTRY( "BZ", ENGLISH
, ENGLISH_BELIZE
)
427 LANG_SUB_ENTRY( "TT", ENGLISH
, ENGLISH_TRINIDAD
)
428 LANG_SUB_ENTRY( "ZW", ENGLISH
, ENGLISH_ZIMBABWE
)
429 LANG_SUB_ENTRY( "PH", ENGLISH
, ENGLISH_PHILIPPINES
)
430 LANG_ENTRY_END( ENGLISH
)
431 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH
)
432 /* traditional sorting */
433 if (!strcmp(dialect
,"tradicional"))
434 LANG_DIALECT_ENTRY( SPANISH
, SPANISH
)
435 LANG_SUB_ENTRY( "MX", SPANISH
, SPANISH_MEXICAN
)
436 LANG_SUB_ENTRY( "ES", SPANISH
, SPANISH_MODERN
)
437 LANG_SUB_ENTRY( "GT", SPANISH
, SPANISH_GUATEMALA
)
438 LANG_SUB_ENTRY( "CR", SPANISH
, SPANISH_COSTARICA
)
439 LANG_SUB_ENTRY( "PA", SPANISH
, SPANISH_PANAMA
)
440 LANG_SUB_ENTRY( "DO", SPANISH
, SPANISH_DOMINICAN
)
441 LANG_SUB_ENTRY( "VE", SPANISH
, SPANISH_VENEZUELA
)
442 LANG_SUB_ENTRY( "CO", SPANISH
, SPANISH_COLOMBIA
)
443 LANG_SUB_ENTRY( "PE", SPANISH
, SPANISH_PERU
)
444 LANG_SUB_ENTRY( "AR", SPANISH
, SPANISH_ARGENTINA
)
445 LANG_SUB_ENTRY( "EC", SPANISH
, SPANISH_ECUADOR
)
446 LANG_SUB_ENTRY( "CL", SPANISH
, SPANISH_CHILE
)
447 LANG_SUB_ENTRY( "UY", SPANISH
, SPANISH_URUGUAY
)
448 LANG_SUB_ENTRY( "PY", SPANISH
, SPANISH_PARAGUAY
)
449 LANG_SUB_ENTRY( "BO", SPANISH
, SPANISH_BOLIVIA
)
450 LANG_SUB_ENTRY( "HN", SPANISH
, SPANISH_HONDURAS
)
451 LANG_SUB_ENTRY( "NI", SPANISH
, SPANISH_NICARAGUA
)
452 LANG_SUB_ENTRY( "PR", SPANISH
, SPANISH_PUERTO_RICO
)
453 LANG_ENTRY_END( SPANISH
)
454 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH
)
455 LANG_ENTRY_END( FINNISH
)
456 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH
)
457 LANG_SUB_ENTRY( "FR", FRENCH
, FRENCH
)
458 LANG_SUB_ENTRY( "BE", FRENCH
, FRENCH_BELGIAN
)
459 LANG_SUB_ENTRY( "CA", FRENCH
, FRENCH_CANADIAN
)
460 LANG_SUB_ENTRY( "CH", FRENCH
, FRENCH_SWISS
)
461 LANG_SUB_ENTRY( "LU", FRENCH
, FRENCH_LUXEMBOURG
)
462 LANG_SUB_ENTRY( "MC", FRENCH
, FRENCH_MONACO
)
463 LANG_ENTRY_END( FRENCH
)
464 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW
)
465 LANG_ENTRY_END( HEBREW
)
466 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN
)
467 LANG_ENTRY_END( HUNGARIAN
)
468 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC
)
469 LANG_ENTRY_END( ICELANDIC
)
470 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN
)
471 LANG_SUB_ENTRY( "IT", ITALIAN
, ITALIAN
)
472 LANG_SUB_ENTRY( "CH", ITALIAN
, ITALIAN_SWISS
)
473 LANG_ENTRY_END( ITALIAN
)
474 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE
)
475 LANG_ENTRY_END( JAPANESE
)
476 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN
)
478 if (!strcmp(charset
,"JOHAB"))
479 LANG_DIALECT_ENTRY( KOREAN
, KOREAN_JOHAB
)
481 LANG_DIALECT_ENTRY( KOREAN
, KOREAN
)
482 LANG_ENTRY_END( KOREAN
)
483 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH
)
484 LANG_SUB_ENTRY( "NL", DUTCH
, DUTCH
)
485 LANG_SUB_ENTRY( "BE", DUTCH
, DUTCH_BELGIAN
)
486 LANG_SUB_ENTRY( "SR", DUTCH
, DUTCH_SURINAM
)
487 LANG_ENTRY_END( DUTCH
)
488 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN
)
490 if (!strcmp(dialect
,"nynorsk"))
491 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_NYNORSK
)
493 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_BOKMAL
)
494 LANG_ENTRY_END( NORWEGIAN
)
495 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH
)
496 LANG_ENTRY_END( POLISH
)
497 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE
)
498 LANG_SUB_ENTRY( "BR", PORTUGUESE
, PORTUGUESE_BRAZILIAN
)
499 LANG_SUB_ENTRY( "PT", PORTUGUESE
, PORTUGUESE
)
500 LANG_ENTRY_END( PORTUGUESE
)
501 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE
)
502 LANG_ENTRY_END( RHAETO_ROMANCE
)
503 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN
)
504 LANG_SUB_ENTRY( "RO", ROMANIAN
, ROMANIAN
)
505 LANG_SUB_ENTRY( "MD", ROMANIAN
, ROMANIAN_MOLDAVIA
)
506 LANG_ENTRY_END( ROMANIAN
)
507 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN
)
508 LANG_SUB_ENTRY( "RU", RUSSIAN
, RUSSIAN
)
509 LANG_SUB_ENTRY( "MD", RUSSIAN
, RUSSIAN_MOLDAVIA
)
510 LANG_ENTRY_END( RUSSIAN
)
511 /*x1a*/ if (!strcmp(lang
,"sh") || !strcmp(lang
,"hr") || !strcmp(lang
,"sr")) {
513 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, NEUTRAL
)
514 if (!strcmp(charset
,"ISO-8859-5"))
515 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN
)
516 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN
, CROATIAN
)
517 if (!strcmp(country
,"YU") && !strcmp(charset
,"ISO-8859-2"))
518 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
519 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN
, SERBIAN
)
520 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
522 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK
)
523 LANG_ENTRY_END( SLOVAK
)
524 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN
)
525 LANG_ENTRY_END( ALBANIAN
)
526 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH
)
527 LANG_SUB_ENTRY( "SE", SWEDISH
, SWEDISH
)
528 LANG_SUB_ENTRY( "FI", SWEDISH
, SWEDISH_FINLAND
)
529 LANG_ENTRY_END( SWEDISH
)
530 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI
)
531 LANG_ENTRY_END( THAI
)
532 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH
)
533 LANG_ENTRY_END( TURKISH
)
534 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU
)
535 LANG_ENTRY_END( URDU
)
536 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN
)
537 LANG_ENTRY_END( INDONESIAN
)
538 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN
)
539 LANG_ENTRY_END( UKRAINIAN
)
540 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN
)
541 LANG_ENTRY_END( BYELORUSSIAN
)
542 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN
)
543 LANG_ENTRY_END( SLOVENIAN
)
544 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN
)
545 LANG_ENTRY_END( ESTONIAN
)
546 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN
)
547 LANG_ENTRY_END( LATVIAN
)
548 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN
)
549 /* traditional sorting ? */
550 if (!strcmp(dialect
,"classic") || !strcmp(dialect
,"traditional"))
551 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN_CLASSIC
)
553 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN
)
554 LANG_ENTRY_END( LITHUANIAN
)
555 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI
)
556 LANG_ENTRY_END( MAORI
)
557 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI
)
558 LANG_ENTRY_END( FARSI
)
559 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE
)
560 LANG_ENTRY_END( VIETNAMESE
)
561 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN
)
562 LANG_ENTRY_END( ARMENIAN
)
563 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI
)
565 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
566 LANG_DIALECT_ENTRY( AZERI
, AZERI_CYRILLIC
)
568 LANG_DIALECT_ENTRY( AZERI
, AZERI
)
569 LANG_ENTRY_END( AZERI
)
570 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE
)
571 LANG_ENTRY_END( BASQUE
)
572 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
573 LANG_ENTRY_END( SORBIAN ) */
574 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN
)
575 LANG_ENTRY_END( MACEDONIAN
)
576 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
577 LANG_ENTRY_END( SUTU ) */
578 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA
)
579 LANG_ENTRY_END( TSONGA
)
580 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
581 LANG_ENTRY_END( TSWANA ) */
582 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
583 LANG_ENTRY_END( VENDA ) */
584 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA
)
585 LANG_ENTRY_END( XHOSA
)
586 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU
)
587 LANG_ENTRY_END( ZULU
)
588 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS
)
589 LANG_ENTRY_END( AFRIKAANS
)
590 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN
)
591 LANG_ENTRY_END( GEORGIAN
)
592 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE
)
593 LANG_ENTRY_END( FAEROESE
)
594 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI
)
595 LANG_ENTRY_END( HINDI
)
596 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE
)
597 LANG_ENTRY_END( MALTESE
)
598 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
599 LANG_ENTRY_END( SAAMI ) */
600 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC
)
601 LANG_DIALECT_ENTRY( GAELIC
, GAELIC
)
602 LANG_ENTRY_END( GAELIC
)
603 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC
)
604 LANG_DIALECT_ENTRY( GAELIC
, GAELIC_SCOTTISH
)
605 LANG_ENTRY_END( GAELIC
)
607 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY
)
608 LANG_SUB_ENTRY( "MY", MALAY
, MALAY
)
609 LANG_SUB_ENTRY( "BN", MALAY
, MALAY_BRUNEI_DARUSSALAM
)
610 LANG_ENTRY_END( MALAY
)
611 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH
)
612 LANG_ENTRY_END( KAZAKH
)
614 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI
)
615 LANG_ENTRY_END( SWAHILI
)
617 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK
)
619 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
620 LANG_DIALECT_ENTRY( UZBEK
, UZBEK_CYRILLIC
)
622 LANG_DIALECT_ENTRY( UZBEK
, UZBEK
)
623 LANG_ENTRY_END( UZBEK
)
624 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR
)
625 LANG_ENTRY_END( TATAR
)
626 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI
)
627 LANG_ENTRY_END( BENGALI
)
628 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI
)
629 LANG_ENTRY_END( PUNJABI
)
630 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI
)
631 LANG_ENTRY_END( GUJARATI
)
632 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA
)
633 LANG_ENTRY_END( ORIYA
)
634 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL
)
635 LANG_ENTRY_END( TAMIL
)
636 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU
)
637 LANG_ENTRY_END( TELUGU
)
638 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA
)
639 LANG_ENTRY_END( KANNADA
)
640 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM
)
641 LANG_ENTRY_END( MALAYALAM
)
642 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE
)
643 LANG_ENTRY_END( ASSAMESE
)
644 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI
)
645 LANG_ENTRY_END( MARATHI
)
646 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT
)
647 LANG_ENTRY_END( SANSKRIT
)
649 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
650 LANG_ENTRY_END( KONKANI ) */
652 LANG_ENTRY_BEGIN( "eo", ESPERANTO
) /* not official */
653 LANG_ENTRY_END( ESPERANTO
)
657 end_MAIN_GetLanguageID
:
658 if (Charset
) free(charset
);
664 /***********************************************************************
665 * MAIN_ParseLanguageOption
667 * Parse -language option.
669 void MAIN_ParseLanguageOption( char *arg
)
671 const WINE_LANGUAGE_DEF
*p
= Languages
;
673 /* for compatibility whith non-iso names previously used */
674 if (!strcmp("Sw",arg
)) { strcpy(arg
,"Sv"); FIXME(system
,"use 'Sv' instead of 'Sw'\n");}
675 if (!strcmp("Cz",arg
)) { strcpy(arg
,"Cs"); FIXME(system
,"use 'Cs' instead of 'Cz'\n");}
676 if (!strcmp("Po",arg
)) { strcpy(arg
,"Pt"); FIXME(system
,"use 'Pt' instead of 'Po'\n");}
678 Options
.language
= LANG_Xx
; /* First (dummy) language */
681 if (!lstrcmpiA( p
->name
, arg
))
683 WINE_LanguageId
= p
->langid
;
688 MSG( "Invalid language specified '%s'. Supported languages are: ", arg
);
689 for (p
= Languages
; p
->name
; p
++) MSG( "%s ", p
->name
);
695 /***********************************************************************
696 * MAIN_ParseModeOption
698 * Parse -mode option.
700 void MAIN_ParseModeOption( char *arg
)
702 if (!lstrcmpiA("enhanced", arg
)) Options
.mode
= MODE_ENHANCED
;
703 else if (!lstrcmpiA("standard", arg
)) Options
.mode
= MODE_STANDARD
;
706 MSG( "Invalid mode '%s' specified.\n", arg
);
707 MSG( "Valid modes are: 'standard', 'enhanced' (default).\n");
712 /***********************************************************************
715 * Parse command line options and open display.
717 static void MAIN_ParseOptions( int *argc
, char *argv
[] )
724 Options
.programName
= MAIN_GetProgramName( *argc
, argv
);
725 Options
.argv0
= argv
[0];
727 /* initialise Options.language to 0 to tell "no language choosen yet" */
728 Options
.language
= 0;
730 /* make sure there is no "." in Options.programName to confuse the X
731 resource database lookups */
732 if ((pcDot
= strchr(Options
.programName
, '.'))) *pcDot
= '\0';
734 for (i
= 1; i
< *argc
; i
++)
736 if (!strcmp( argv
[i
], "-v" ) || !strcmp( argv
[i
], "-version" ))
738 MSG( "%s\n", WINE_RELEASE_INFO
);
741 if (!strcmp( argv
[i
], "-h" ) || !strcmp( argv
[i
], "-help" ))
748 #ifndef X_DISPLAY_MISSING
749 X11DRV_MAIN_ParseOptions(argc
,argv
);
750 #else /* X_DISPLAY_MISSING */
751 TTYDRV_MAIN_ParseOptions(argc
,argv
);
752 #endif /* X_DISPLAY_MISSING */
755 /***********************************************************************
758 static void called_at_exit(void)
760 #ifndef X_DISPLAY_MISSING
761 X11DRV_MAIN_RestoreSetup();
762 #else /* X_DISPLAY_MISSING */
763 TTYDRV_MAIN_RestoreSetup();
764 #endif /* X_DISPLAY_MISSING */
770 /***********************************************************************
773 * Wine initialisation and command-line parsing
775 BOOL
MAIN_WineInit( int *argc
, char *argv
[] )
779 #ifdef MALLOC_DEBUGGING
783 if (!(trace
= getenv("MALLOC_TRACE")))
785 MSG( "MALLOC_TRACE not set. No trace generated\n" );
789 MSG( "malloc trace goes to %s\n", trace
);
797 setlocale(LC_CTYPE
,"");
798 gettimeofday( &tv
, NULL
);
799 MSG_WineStartTicks
= (tv
.tv_sec
* 1000) + (tv
.tv_usec
/ 1000);
801 #ifndef X_DISPLAY_MISSING
802 X11DRV_MAIN_Initialize();
803 MAIN_ParseOptions( argc
, argv
);
804 X11DRV_MAIN_Create();
805 X11DRV_MAIN_SaveSetup();
806 #else /* !defined(X_DISPLAY_MISSING) */
807 TTYDRV_MAIN_Initialize();
808 MAIN_ParseOptions( argc
, argv
);
809 TTYDRV_MAIN_Create();
810 TTYDRV_MAIN_SaveSetup();
811 #endif /* !defined(X_DISPLAY_MISSING) */
813 #ifndef X_DISPLAY_MISSING
814 MONITOR_PrimaryMonitor
.pDriver
= &X11DRV_MONITOR_Driver
;
815 #else /* !defined(X_DISPLAY_MISSING) */
816 MONITOR_PrimaryMonitor
.pDriver
= &TTYDRV_MONITOR_Driver
;
817 #endif /* !defined(X_DISPLAY_MISSING) */
818 MONITOR_Initialize(&MONITOR_PrimaryMonitor
);
820 if (Options
.dllFlags
)
821 BUILTIN32_ParseDLLOptions( Options
.dllFlags
);
822 /* if (__winelib && errors ) print_error_message_like_misc_main(); */
824 atexit(called_at_exit
);
828 /***********************************************************************
829 * MessageBeep16 (USER.104)
831 void WINAPI
MessageBeep16( UINT16 i
)
837 /***********************************************************************
838 * MessageBeep32 (USER32.390)
840 BOOL WINAPI
MessageBeep( UINT i
)
842 TSXBell( display
, 0 );
847 /***********************************************************************
850 BOOL WINAPI
Beep( DWORD dwFreq
, DWORD dwDur
)
852 /* dwFreq and dwDur are ignored by Win95 */
858 /***********************************************************************
859 * GetTimerResolution (USER.14)
861 LONG WINAPI
GetTimerResolution16(void)
866 /***********************************************************************
867 * SystemParametersInfo32A (USER32.540)
869 BOOL WINAPI
SystemParametersInfoA( UINT uAction
, UINT uParam
,
870 LPVOID lpvParam
, UINT fuWinIni
)
874 XKeyboardState keyboard_state
;
878 TSXGetKeyboardControl(display
, &keyboard_state
);
879 if (keyboard_state
.bell_percent
== 0)
880 *(BOOL
*) lpvParam
= FALSE
;
882 *(BOOL
*) lpvParam
= TRUE
;
886 *(INT
*)lpvParam
= GetSystemMetrics( SM_CXFRAME
);
889 case SPI_GETDRAGFULLWINDOWS
:
890 *(BOOL
*) lpvParam
= FALSE
;
893 case SPI_SETDRAGFULLWINDOWS
:
896 case SPI_GETFASTTASKSWITCH
:
897 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
898 *(BOOL
*) lpvParam
= TRUE
;
900 *(BOOL
*) lpvParam
= FALSE
;
903 case SPI_GETGRIDGRANULARITY
:
904 *(INT
*)lpvParam
=GetProfileIntA("desktop","GridGranularity",1);
907 case SPI_GETICONTITLEWRAP
:
908 *(BOOL
*)lpvParam
=GetProfileIntA("desktop","IconTitleWrap",TRUE
);
911 case SPI_GETKEYBOARDDELAY
:
912 *(INT
*)lpvParam
=GetProfileIntA("keyboard","KeyboardDelay",1);
915 case SPI_GETKEYBOARDSPEED
:
916 *(DWORD
*)lpvParam
=GetProfileIntA("keyboard","KeyboardSpeed",30);
919 case SPI_GETMENUDROPALIGNMENT
:
920 *(BOOL
*)lpvParam
=GetSystemMetrics(SM_MENUDROPALIGNMENT
); /* XXX check this */
923 case SPI_GETSCREENSAVEACTIVE
:
924 if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
925 *(BOOL
*)lpvParam
= TRUE
;
927 *(BOOL
*)lpvParam
= FALSE
;
930 case SPI_GETSCREENSAVETIMEOUT
:
931 #ifndef X_DISPLAY_MISSING
932 TSXGetScreenSaver(display
, &timeout
, &temp
,&temp
,&temp
);
933 #else /* X_DISPLAY_MISSING */
934 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
935 #endif /* X_DISPLAY_MISSING */
936 *(INT
*) lpvParam
= timeout
* 1000;
939 case SPI_ICONHORIZONTALSPACING
:
940 /* FIXME Get/SetProfileInt */
941 if (lpvParam
== NULL
)
942 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
944 *(INT
*)lpvParam
=GetSystemMetrics(SM_CXICONSPACING
);
947 case SPI_ICONVERTICALSPACING
:
948 /* FIXME Get/SetProfileInt */
949 if (lpvParam
== NULL
)
950 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
952 *(INT
*)lpvParam
=GetSystemMetrics(SM_CYICONSPACING
);
955 case SPI_GETICONTITLELOGFONT
: {
956 LPLOGFONTA lpLogFont
= (LPLOGFONTA
)lpvParam
;
958 /* from now on we always have an alias for MS Sans Serif */
960 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
961 lpLogFont
->lfFaceName
, LF_FACESIZE
);
962 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 8);
963 lpLogFont
->lfWidth
= 0;
964 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
965 lpLogFont
->lfWeight
= FW_NORMAL
;
966 lpLogFont
->lfItalic
= FALSE
;
967 lpLogFont
->lfStrikeOut
= FALSE
;
968 lpLogFont
->lfUnderline
= FALSE
;
969 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
970 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
971 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
972 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
975 case SPI_GETWORKAREA
:
976 SetRect( (RECT
*)lpvParam
, 0, 0,
977 GetSystemMetrics( SM_CXSCREEN
),
978 GetSystemMetrics( SM_CYSCREEN
)
981 case SPI_GETNONCLIENTMETRICS
:
983 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
985 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICSA
) )
987 /* FIXME: initialize geometry entries */
989 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
990 (LPVOID
)&(lpnm
->lfCaptionFont
),0);
991 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
992 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
993 (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
994 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
995 (LPVOID
)&(lpnm
->lfMenuFont
),0);
996 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
997 (LPVOID
)&(lpnm
->lfStatusFont
),0);
998 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
999 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1004 case SPI_GETANIMATION
: {
1005 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1007 /* Tell it "disabled" */
1008 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1009 uParam
= sizeof(ANIMATIONINFO
);
1010 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1014 case SPI_SETANIMATION
: {
1015 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1018 WARN(system
, "SPI_SETANIMATION ignored.\n");
1019 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1020 uParam
= sizeof(ANIMATIONINFO
);
1024 case SPI_GETHIGHCONTRAST
:
1026 LPHIGHCONTRASTA lpHighContrastA
= (LPHIGHCONTRASTA
)lpvParam
;
1028 FIXME(system
,"SPI_GETHIGHCONTRAST not fully implemented\n");
1030 if ( lpHighContrastA
->cbSize
== sizeof( HIGHCONTRASTA
) )
1032 /* Indicate that there is no high contrast available */
1033 lpHighContrastA
->dwFlags
= 0;
1034 lpHighContrastA
->lpszDefaultScheme
= NULL
;
1045 return SystemParametersInfo16(uAction
,uParam
,lpvParam
,fuWinIni
);
1051 /***********************************************************************
1052 * SystemParametersInfo16 (USER.483)
1054 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
1055 LPVOID lpvParam
, UINT16 fuWinIni
)
1060 XKeyboardState keyboard_state
;
1061 XKeyboardControl keyboard_value
;
1066 TSXGetKeyboardControl(display
, &keyboard_state
);
1067 if (keyboard_state
.bell_percent
== 0)
1068 *(BOOL16
*) lpvParam
= FALSE
;
1070 *(BOOL16
*) lpvParam
= TRUE
;
1074 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXFRAME
);
1077 case SPI_GETFASTTASKSWITCH
:
1078 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1079 *(BOOL16
*) lpvParam
= TRUE
;
1081 *(BOOL16
*) lpvParam
= FALSE
;
1084 case SPI_GETGRIDGRANULARITY
:
1085 *(INT16
*) lpvParam
= GetProfileIntA( "desktop",
1090 case SPI_GETICONTITLEWRAP
:
1091 *(BOOL16
*) lpvParam
= GetProfileIntA( "desktop",
1096 case SPI_GETKEYBOARDDELAY
:
1097 *(INT16
*) lpvParam
= GetProfileIntA( "keyboard",
1098 "KeyboardDelay", 1 );
1101 case SPI_GETKEYBOARDSPEED
:
1102 *(WORD
*) lpvParam
= GetProfileIntA( "keyboard",
1107 case SPI_GETMENUDROPALIGNMENT
:
1108 *(BOOL16
*) lpvParam
= GetSystemMetrics16( SM_MENUDROPALIGNMENT
); /* XXX check this */
1111 case SPI_GETSCREENSAVEACTIVE
:
1112 if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
1113 *(BOOL16
*) lpvParam
= TRUE
;
1115 *(BOOL16
*) lpvParam
= FALSE
;
1118 case SPI_GETSCREENSAVETIMEOUT
:
1119 #ifndef X_DISPLAY_MISSING
1120 TSXGetScreenSaver(display
, &timeout
, &temp
,&temp
,&temp
);
1121 #else /* X_DISPLAY_MISSING */
1122 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1123 #endif /* X_DISPLAY_MISSING */
1124 *(INT16
*) lpvParam
= timeout
;
1127 case SPI_ICONHORIZONTALSPACING
:
1128 /* FIXME Get/SetProfileInt */
1129 if (lpvParam
== NULL
)
1130 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1132 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXICONSPACING
);
1135 case SPI_ICONVERTICALSPACING
:
1136 /* FIXME Get/SetProfileInt */
1137 if (lpvParam
== NULL
)
1138 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1140 *(INT16
*)lpvParam
= GetSystemMetrics16(SM_CYICONSPACING
);
1145 keyboard_value
.bell_percent
= -1;
1147 keyboard_value
.bell_percent
= 0;
1148 TSXChangeKeyboardControl(display
, KBBellPercent
,
1152 case SPI_SETSCREENSAVEACTIVE
:
1154 TSXActivateScreenSaver(display
);
1156 TSXResetScreenSaver(display
);
1159 case SPI_SETSCREENSAVETIMEOUT
:
1160 TSXSetScreenSaver(display
, uParam
, 60, DefaultBlanking
,
1164 case SPI_SETDESKWALLPAPER
:
1165 return (SetDeskWallPaper((LPSTR
) lpvParam
));
1168 case SPI_SETDESKPATTERN
:
1169 if ((INT16
)uParam
== -1) {
1170 GetProfileStringA("Desktop", "Pattern",
1171 "170 85 170 85 170 85 170 85",
1172 buffer
, sizeof(buffer
) );
1173 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1175 return (DESKTOP_SetPattern((LPSTR
) lpvParam
));
1178 case SPI_GETICONTITLELOGFONT
:
1180 LPLOGFONT16 lpLogFont
= (LPLOGFONT16
)lpvParam
;
1182 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1183 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1184 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 8);
1185 lpLogFont
->lfWidth
= 0;
1186 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1187 lpLogFont
->lfWeight
= FW_NORMAL
;
1188 lpLogFont
->lfItalic
= FALSE
;
1189 lpLogFont
->lfStrikeOut
= FALSE
;
1190 lpLogFont
->lfUnderline
= FALSE
;
1191 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1192 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1193 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1194 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1197 case SPI_GETNONCLIENTMETRICS
:
1199 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1200 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICS16
) )
1202 /* FIXME: initialize geometry entries */
1203 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1204 (LPVOID
)&(lpnm
->lfCaptionFont
),0);
1205 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1206 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1207 (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1208 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1209 (LPVOID
)&(lpnm
->lfMenuFont
),0);
1210 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1211 (LPVOID
)&(lpnm
->lfStatusFont
),0);
1212 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1213 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1215 else /* winfile 95 sets sbSize to 340 */
1216 SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
1220 case SPI_LANGDRIVER
:
1222 case SPI_SETDOUBLECLKHEIGHT
:
1223 case SPI_SETDOUBLECLICKTIME
:
1224 case SPI_SETDOUBLECLKWIDTH
:
1225 case SPI_SETFASTTASKSWITCH
:
1226 case SPI_SETKEYBOARDDELAY
:
1227 case SPI_SETKEYBOARDSPEED
:
1228 WARN(system
, "Option %d ignored.\n", uAction
);
1231 case SPI_GETWORKAREA
:
1232 SetRect16( (RECT16
*)lpvParam
, 0, 0,
1233 GetSystemMetrics16( SM_CXSCREEN
),
1234 GetSystemMetrics16( SM_CYSCREEN
) );
1238 WARN(system
, "Unknown option %d.\n", uAction
);
1244 /***********************************************************************
1245 * SystemParametersInfo32W (USER32.541)
1247 BOOL WINAPI
SystemParametersInfoW( UINT uAction
, UINT uParam
,
1248 LPVOID lpvParam
, UINT fuWinIni
)
1254 case SPI_SETDESKWALLPAPER
:
1257 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1258 return SetDeskWallPaper(buffer
);
1260 return SetDeskWallPaper(NULL
);
1262 case SPI_SETDESKPATTERN
:
1263 if ((INT
) uParam
== -1)
1265 GetProfileStringA("Desktop", "Pattern",
1266 "170 85 170 85 170 85 170 85",
1267 buffer
, sizeof(buffer
) );
1268 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1272 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1273 return DESKTOP_SetPattern(buffer
);
1275 return DESKTOP_SetPattern(NULL
);
1277 case SPI_GETICONTITLELOGFONT
:
1279 LPLOGFONTW lpLogFont
= (LPLOGFONTW
)lpvParam
;
1280 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1281 buffer
, sizeof(buffer
) );
1282 lstrcpynAtoW(lpLogFont
->lfFaceName
, buffer
,LF_FACESIZE
);
1283 lpLogFont
->lfHeight
= 10;
1284 lpLogFont
->lfWidth
= 0;
1285 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1286 lpLogFont
->lfWeight
= FW_NORMAL
;
1287 lpLogFont
->lfItalic
= lpLogFont
->lfStrikeOut
= lpLogFont
->lfUnderline
= FALSE
;
1288 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1289 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1290 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1291 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1294 case SPI_GETNONCLIENTMETRICS
: {
1295 /* FIXME: implement correctly */
1296 LPNONCLIENTMETRICSW lpnm
=(LPNONCLIENTMETRICSW
)lpvParam
;
1298 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfCaptionFont
),0);
1299 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1300 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1301 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMenuFont
),0);
1302 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfStatusFont
),0);
1303 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMessageFont
),0);
1307 case SPI_GETHIGHCONTRAST
:
1309 LPHIGHCONTRASTW lpHighContrastW
= (LPHIGHCONTRASTW
)lpvParam
;
1311 FIXME(system
,"SPI_GETHIGHCONTRAST not fully implemented\n");
1313 if ( lpHighContrastW
->cbSize
== sizeof( HIGHCONTRASTW
) )
1315 /* Indicate that there is no high contrast available */
1316 lpHighContrastW
->dwFlags
= 0;
1317 lpHighContrastW
->lpszDefaultScheme
= NULL
;
1328 return SystemParametersInfoA(uAction
,uParam
,lpvParam
,fuWinIni
);
1335 /***********************************************************************
1336 * FileCDR (KERNEL.130)
1338 FARPROC16 WINAPI
FileCDR16(FARPROC16 x
)
1340 FIXME(file
,"(0x%8x): stub\n", (int) x
);
1341 return (FARPROC16
)TRUE
;