4 * Copyright 1994 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
11 #else /* !defined(X_DISPLAY_MISSING) */
13 #endif /* !defined(X_DISPLAY_MISSING) */
20 #ifdef MALLOC_DEBUGGING
32 #include "builtin32.h"
33 #include "debugtools.h"
34 #include "debugdefs.h"
44 #include "wine/winuser16.h"
47 /**********************************************************************/
49 USER_DRIVER *USER_Driver = NULL;
51 /* when adding new languages look at ole/ole2nls.c
52 * for proper iso name and Windows code (add 0x0400
53 * to the code listed there)
55 const WINE_LANGUAGE_DEF Languages[] =
57 {"En",0x0409}, /* LANG_En */
58 {"Es",0x040A}, /* LANG_Es */
59 {"De",0x0407}, /* LANG_De */
60 {"No",0x0414}, /* LANG_No */
61 {"Fr",0x040C}, /* LANG_Fr */
62 {"Fi",0x040B}, /* LANG_Fi */
63 {"Da",0x0406}, /* LANG_Da */
64 {"Cs",0x0405}, /* LANG_Cs */
65 {"Eo",0x048f}, /* LANG_Eo */
66 {"It",0x0410}, /* LANG_It */
67 {"Ko",0x0412}, /* LANG_Ko */
68 {"Hu",0x040e}, /* LANG_Hu */
69 {"Pl",0x0415}, /* LANG_Pl */
70 {"Pt",0x0416}, /* LANG_Pt */
71 {"Sv",0x041d}, /* LANG_Sv */
72 {"Ca",0x0403}, /* LANG_Ca */
73 {"Nl",0x0413}, /* LANG_Nl */
74 {"Ru",0x0419}, /* LANG_Ru */
75 {"Wa",0x0490}, /* LANG_Wa */
79 WORD WINE_LanguageId = 0x409; /* english as default */
81 struct options Options =
82 { /* default options */
85 NULL, /* desktopGeometry */
86 NULL, /* programName */
89 FALSE, /* usePrivateMap */
90 FALSE, /* useFixedMap */
91 FALSE, /* synchronous */
92 FALSE, /* backing store */
93 SW_SHOWNORMAL, /* cmdShow */
95 FALSE, /* failReadOnly */
96 MODE_ENHANCED, /* Enhanced mode */
98 DEFAULT_LANG, /* Default language */
102 FALSE, /* Managed windows */
103 FALSE, /* Perfect graphics */
105 NULL, /* Alternate config file name */
109 static char szUsage[] =
111 "Usage: %s [options] \"program_name [arguments]\"\n"
114 " -backingstore Turn on backing store\n"
115 " -config name Specify config file to use\n"
116 " -console driver Select which driver(s) to use for the console\n"
117 " -debug Enter debugger before starting application\n"
118 " -debugmsg name Turn debugging-messages on or off\n"
119 " -depth n Change the depth to use for multiple-depth screens\n"
120 " -desktop geom Use a desktop window of the given geometry\n"
121 " -display name Use the specified display\n"
122 " -dll name Enable or disable built-in DLLs\n"
123 " -failreadonly Read only files may not be opened in write mode\n"
124 " -fixedmap Use a \"standard\" color map\n"
125 " -help Show this help message\n"
126 " -iconic Start as an icon\n"
127 " -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n"
128 " Ko,Nl,No,Pl,Pt,Sv,Ru,Wa)\n"
129 " -managed Allow the window manager to manage created windows\n"
130 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
131 " -name name Set the application name\n"
132 " -nodga Disable XFree86 DGA extensions\n"
133 " -perfect Favor correctness over speed for graphical operations\n"
134 " -privatemap Use a private color map\n"
135 " -synchronous Turn on synchronous display mode\n"
136 " -version Display the Wine version\n"
137 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
138 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
141 /***********************************************************************
144 void MAIN_Usage( char *name )
146 MESSAGE( szUsage, WINE_RELEASE_INFO, name );
150 /***********************************************************************
151 * MAIN_GetProgramName
153 * Get the program name. The name is specified by (in order of precedence):
154 * - the option '-name'.
155 * - the environment variable 'WINE_NAME'.
156 * - the last component of argv[0].
158 static char *MAIN_GetProgramName( int argc, char *argv[] )
163 for (i = 1; i < argc-1; i++)
164 if (!strcmp( argv[i], "-name" )) return argv[i+1];
165 if ((p = getenv( "WINE_NAME" )) != NULL) return p;
166 if ((p = strrchr( argv[0], '/' )) != NULL) return p+1;
170 /***********************************************************************
171 * MAIN_ParseDebugOptions
173 * Turns specific debug messages on or off, according to "options".
176 * TRUE if parsing was successful
178 BOOL MAIN_ParseDebugOptions(char *options)
180 /* defined in relay32/relay386.c */
181 extern char **debug_relay_includelist;
182 extern char **debug_relay_excludelist;
183 /* defined in relay32/snoop.c */
184 extern char **debug_snoop_includelist;
185 extern char **debug_snoop_excludelist;
188 int l, cls, dotracerelay = TRACE_ON(relay);
193 if (options[l-1]=='\n') options[l-1]='\0';
196 if ((*options!='+')&&(*options!='-')){
199 for(j=0; j<DEBUG_CLASS_COUNT; j++)
200 if(!lstrncmpiA(options, debug_cl_name[j], strlen(debug_cl_name[j])))
202 if(j==DEBUG_CLASS_COUNT)
204 options += strlen(debug_cl_name[j]);
205 if ((*options!='+')&&(*options!='-'))
210 cls = -1; /* all classes */
212 if (strchr(options,','))
213 l=strchr(options,',')-options;
217 if (!lstrncmpiA(options+1,"all",l-1))
220 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
221 for(j=0; j<DEBUG_CLASS_COUNT; j++)
222 if(cls == -1 || cls == j)
223 __SET_DEBUGGING( j, i, (*options=='+') );
225 else if (!lstrncmpiA(options+1, "relay=", 6) ||
226 !lstrncmpiA(options+1, "snoop=", 6))
229 char *s, *s2, ***output, c;
231 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
232 if (debug_ch_name && (!lstrncmpiA(debug_ch_name[i],options+1,5))){
233 for(j=0; j<DEBUG_CLASS_COUNT; j++)
234 if(cls == -1 || cls == j)
235 __SET_DEBUGGING( j, i, 1 );
238 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
239 if (i==DEBUG_CHANNEL_COUNT)
241 output = (*options == '+') ?
242 ((*(options+1) == 'r') ?
243 &debug_relay_includelist :
244 &debug_snoop_includelist) :
245 ((*(options+1) == 'r') ?
246 &debug_relay_excludelist :
247 &debug_snoop_excludelist);
249 /* if there are n ':', there are n+1 modules, and we need n+2 slots
250 * last one being for the sentinel (NULL) */
252 while((s = strchr(s, ':'))) i++, s++;
253 *output = malloc(sizeof(char **) * i);
256 while((s2 = strchr(s, ':'))) {
259 *((*output)+i) = CharUpperA(strdup(s));
265 *(options + l) = '\0';
266 *((*output)+i) = CharUpperA(strdup(s));
268 *((*output)+i+1) = NULL;
273 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
274 if (debug_ch_name && (!lstrncmpiA(options+1,debug_ch_name[i],l-1))){
275 for(j=0; j<DEBUG_CLASS_COUNT; j++)
276 if(cls == -1 || cls == j)
277 __SET_DEBUGGING( j, i, (*options=='+') );
280 if (i==DEBUG_CHANNEL_COUNT)
285 while((*options==',')&&(*(++options)));
287 /* special handling for relay debugging */
288 if (dotracerelay != TRACE_ON(relay))
289 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay) );
295 MESSAGE("%s: Syntax: -debugmsg [class]+xxx,... or "
296 "-debugmsg [class]-xxx,...\n",Options.argv[0]);
297 MESSAGE("Example: -debugmsg +all,warn-heap\n"
298 " turn on all messages except warning heap messages\n");
299 MESSAGE("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
300 " turn on -debugmsg +relay only as specified\n"
301 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
302 " turn on -debugmsg +relay except as specified\n"
303 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
305 MESSAGE("Available message classes:\n");
306 for(i=0;i<DEBUG_CLASS_COUNT;i++)
307 MESSAGE( "%-9s", debug_cl_name[i]);
310 MESSAGE("Available message types:\n");
311 MESSAGE("%-9s ","all");
312 for(i=0;i<DEBUG_CHANNEL_COUNT;i++)
314 MESSAGE("%-9s%c",debug_ch_name[i],
315 (((i+2)%8==0)?'\n':' '));
321 /***********************************************************************
325 * Lang: a string whose two first chars are the iso name of a language.
326 * Country: a string whose two first chars are the iso name of country
327 * Charset: a string defining the chossen charset encoding
328 * Dialect: a string defining a variation of the locale
330 * all those values are from the standardized format of locale
331 * name in unix which is: Lang[_Country][.Charset][@Dialect]
334 * the numeric code of the language used by Windows (or 0x00)
336 int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
338 char lang[3]="??", country[3]={0,0,0};
339 char *charset=NULL, *dialect=NULL;
342 if (Lang==NULL) return 0x00;
343 if (Lang[0]) lang[0]=tolower(Lang[0]);
344 if (Lang[1]) lang[1]=tolower(Lang[1]);
347 if (Country[0]) country[0]=toupper(Country[0]);
348 if (Country[1]) country[1]=toupper(Country[1]);
353 charset=(char*)malloc(j+1);
355 charset[i]=toupper(Charset[i]);
361 dialect=(char*)malloc(j+1);
363 dialect[i]=tolower(Dialect[i]);
370 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
373 goto end_MAIN_GetLanguageID; \
375 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
376 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
377 goto end_MAIN_GetLanguageID;
378 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
379 goto end_MAIN_GetLanguageID; }
380 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
381 goto end_MAIN_GetLanguageID; \
384 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC )
385 LANG_SUB_ENTRY( "SA", ARABIC, ARABIC)
386 LANG_SUB_ENTRY( "IQ", ARABIC, ARABIC_IRAQ )
387 LANG_SUB_ENTRY( "EG", ARABIC, ARABIC_EGYPT )
388 LANG_SUB_ENTRY( "LY", ARABIC, ARABIC_LIBYA )
389 LANG_SUB_ENTRY( "DZ", ARABIC, ARABIC_ALGERIA )
390 LANG_SUB_ENTRY( "MA", ARABIC, ARABIC_MOROCCO )
391 LANG_SUB_ENTRY( "TN", ARABIC, ARABIC_TUNISIA )
392 LANG_SUB_ENTRY( "OM", ARABIC, ARABIC_OMAN )
393 LANG_SUB_ENTRY( "YE", ARABIC, ARABIC_YEMEN )
394 LANG_SUB_ENTRY( "SY", ARABIC, ARABIC_SYRIA )
395 LANG_SUB_ENTRY( "JO", ARABIC, ARABIC_JORDAN )
396 LANG_SUB_ENTRY( "LB", ARABIC, ARABIC_LEBANON )
397 LANG_SUB_ENTRY( "KW", ARABIC, ARABIC_KUWAIT )
398 LANG_SUB_ENTRY( "AE", ARABIC, ARABIC_UAE )
399 LANG_SUB_ENTRY( "BH", ARABIC, ARABIC_BAHRAIN )
400 LANG_SUB_ENTRY( "QA", ARABIC, ARABIC_QATAR )
401 LANG_ENTRY_END( ARABIC )
402 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN )
403 LANG_ENTRY_END( BULGARIAN )
404 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN )
405 LANG_ENTRY_END( CATALAN )
406 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE )
407 LANG_SUB_ENTRY( "TW", CHINESE, CHINESE_TRADITIONAL )
408 LANG_SUB_ENTRY( "CN", CHINESE, CHINESE_SIMPLIFIED )
409 LANG_SUB_ENTRY( "HK", CHINESE, CHINESE_HONGKONG )
410 LANG_SUB_ENTRY( "SG", CHINESE, CHINESE_SINGAPORE )
411 LANG_SUB_ENTRY( "MO", CHINESE, CHINESE_MACAU )
412 LANG_ENTRY_END( CHINESE )
413 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH )
414 LANG_ENTRY_END( CZECH )
415 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH )
416 LANG_ENTRY_END( DANISH )
417 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN )
418 LANG_SUB_ENTRY( "DE", GERMAN, GERMAN )
419 LANG_SUB_ENTRY( "CH", GERMAN, GERMAN_SWISS )
420 LANG_SUB_ENTRY( "AT", GERMAN, GERMAN_AUSTRIAN )
421 LANG_SUB_ENTRY( "LU", GERMAN, GERMAN_LUXEMBOURG )
422 LANG_SUB_ENTRY( "LI", GERMAN, GERMAN_LIECHTENSTEIN )
423 LANG_ENTRY_END( GERMAN )
424 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK )
425 LANG_ENTRY_END( GREEK )
426 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH )
427 LANG_SUB_ENTRY( "US", ENGLISH, ENGLISH_US )
428 LANG_SUB_ENTRY( "UK", ENGLISH, ENGLISH_UK )
429 LANG_SUB_ENTRY( "AU", ENGLISH, ENGLISH_AUS )
430 LANG_SUB_ENTRY( "CA", ENGLISH, ENGLISH_CAN )
431 LANG_SUB_ENTRY( "NZ", ENGLISH, ENGLISH_NZ )
432 LANG_SUB_ENTRY( "EI", ENGLISH, ENGLISH_EIRE )
433 LANG_SUB_ENTRY( "ZA", ENGLISH, ENGLISH_SAFRICA )
434 LANG_SUB_ENTRY( "JM", ENGLISH, ENGLISH_JAMAICA )
435 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
436 LANG_SUB_ENTRY( "BZ", ENGLISH, ENGLISH_BELIZE )
437 LANG_SUB_ENTRY( "TT", ENGLISH, ENGLISH_TRINIDAD )
438 LANG_SUB_ENTRY( "ZW", ENGLISH, ENGLISH_ZIMBABWE )
439 LANG_SUB_ENTRY( "PH", ENGLISH, ENGLISH_PHILIPPINES )
440 LANG_ENTRY_END( ENGLISH )
441 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH )
442 /* traditional sorting */
443 if (!strcmp(dialect,"tradicional"))
444 LANG_DIALECT_ENTRY( SPANISH, SPANISH )
445 LANG_SUB_ENTRY( "MX", SPANISH, SPANISH_MEXICAN )
446 LANG_SUB_ENTRY( "ES", SPANISH, SPANISH_MODERN )
447 LANG_SUB_ENTRY( "GT", SPANISH, SPANISH_GUATEMALA )
448 LANG_SUB_ENTRY( "CR", SPANISH, SPANISH_COSTARICA )
449 LANG_SUB_ENTRY( "PA", SPANISH, SPANISH_PANAMA )
450 LANG_SUB_ENTRY( "DO", SPANISH, SPANISH_DOMINICAN )
451 LANG_SUB_ENTRY( "VE", SPANISH, SPANISH_VENEZUELA )
452 LANG_SUB_ENTRY( "CO", SPANISH, SPANISH_COLOMBIA )
453 LANG_SUB_ENTRY( "PE", SPANISH, SPANISH_PERU )
454 LANG_SUB_ENTRY( "AR", SPANISH, SPANISH_ARGENTINA )
455 LANG_SUB_ENTRY( "EC", SPANISH, SPANISH_ECUADOR )
456 LANG_SUB_ENTRY( "CL", SPANISH, SPANISH_CHILE )
457 LANG_SUB_ENTRY( "UY", SPANISH, SPANISH_URUGUAY )
458 LANG_SUB_ENTRY( "PY", SPANISH, SPANISH_PARAGUAY )
459 LANG_SUB_ENTRY( "BO", SPANISH, SPANISH_BOLIVIA )
460 LANG_SUB_ENTRY( "HN", SPANISH, SPANISH_HONDURAS )
461 LANG_SUB_ENTRY( "NI", SPANISH, SPANISH_NICARAGUA )
462 LANG_SUB_ENTRY( "PR", SPANISH, SPANISH_PUERTO_RICO )
463 LANG_ENTRY_END( SPANISH )
464 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH )
465 LANG_ENTRY_END( FINNISH )
466 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH )
467 LANG_SUB_ENTRY( "FR", FRENCH, FRENCH )
468 LANG_SUB_ENTRY( "BE", FRENCH, FRENCH_BELGIAN )
469 LANG_SUB_ENTRY( "CA", FRENCH, FRENCH_CANADIAN )
470 LANG_SUB_ENTRY( "CH", FRENCH, FRENCH_SWISS )
471 LANG_SUB_ENTRY( "LU", FRENCH, FRENCH_LUXEMBOURG )
472 LANG_SUB_ENTRY( "MC", FRENCH, FRENCH_MONACO )
473 LANG_ENTRY_END( FRENCH )
474 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW )
475 LANG_ENTRY_END( HEBREW )
476 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN )
477 LANG_ENTRY_END( HUNGARIAN )
478 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC )
479 LANG_ENTRY_END( ICELANDIC )
480 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN )
481 LANG_SUB_ENTRY( "IT", ITALIAN, ITALIAN )
482 LANG_SUB_ENTRY( "CH", ITALIAN, ITALIAN_SWISS )
483 LANG_ENTRY_END( ITALIAN )
484 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE )
485 LANG_ENTRY_END( JAPANESE )
486 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN )
488 if (!strcmp(charset,"JOHAB"))
489 LANG_DIALECT_ENTRY( KOREAN, KOREAN_JOHAB )
491 LANG_DIALECT_ENTRY( KOREAN, KOREAN )
492 LANG_ENTRY_END( KOREAN )
493 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH )
494 LANG_SUB_ENTRY( "NL", DUTCH, DUTCH )
495 LANG_SUB_ENTRY( "BE", DUTCH, DUTCH_BELGIAN )
496 LANG_SUB_ENTRY( "SR", DUTCH, DUTCH_SURINAM )
497 LANG_ENTRY_END( DUTCH )
498 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN )
500 if (!strcmp(dialect,"nynorsk"))
501 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_NYNORSK )
503 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_BOKMAL )
504 LANG_ENTRY_END( NORWEGIAN )
505 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH )
506 LANG_ENTRY_END( POLISH )
507 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE )
508 LANG_SUB_ENTRY( "BR", PORTUGUESE, PORTUGUESE_BRAZILIAN )
509 LANG_SUB_ENTRY( "PT", PORTUGUESE, PORTUGUESE )
510 LANG_ENTRY_END( PORTUGUESE )
511 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE )
512 LANG_ENTRY_END( RHAETO_ROMANCE )
513 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN )
514 LANG_SUB_ENTRY( "RO", ROMANIAN, ROMANIAN )
515 LANG_SUB_ENTRY( "MD", ROMANIAN, ROMANIAN_MOLDAVIA )
516 LANG_ENTRY_END( ROMANIAN )
517 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN )
518 LANG_SUB_ENTRY( "RU", RUSSIAN, RUSSIAN )
519 LANG_SUB_ENTRY( "MD", RUSSIAN, RUSSIAN_MOLDAVIA )
520 LANG_ENTRY_END( RUSSIAN )
521 /*x1a*/ if (!strcmp(lang,"sh") || !strcmp(lang,"hr") || !strcmp(lang,"sr")) {
523 LANG_DIALECT_ENTRY( SERBO_CROATIAN, NEUTRAL)
524 if (!strcmp(charset,"ISO-8859-5"))
525 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN )
526 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN, CROATIAN )
527 if (!strcmp(country,"YU") && !strcmp(charset,"ISO-8859-2"))
528 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
529 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN, SERBIAN )
530 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
532 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK )
533 LANG_ENTRY_END( SLOVAK )
534 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN )
535 LANG_ENTRY_END( ALBANIAN )
536 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH )
537 LANG_SUB_ENTRY( "SE", SWEDISH, SWEDISH )
538 LANG_SUB_ENTRY( "FI", SWEDISH, SWEDISH_FINLAND )
539 LANG_ENTRY_END( SWEDISH )
540 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI )
541 LANG_ENTRY_END( THAI )
542 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH )
543 LANG_ENTRY_END( TURKISH )
544 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU )
545 LANG_ENTRY_END( URDU )
546 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN )
547 LANG_ENTRY_END( INDONESIAN )
548 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN )
549 LANG_ENTRY_END( UKRAINIAN )
550 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN )
551 LANG_ENTRY_END( BYELORUSSIAN )
552 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN )
553 LANG_ENTRY_END( SLOVENIAN )
554 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN )
555 LANG_ENTRY_END( ESTONIAN )
556 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN )
557 LANG_ENTRY_END( LATVIAN )
558 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN )
559 /* traditional sorting ? */
560 if (!strcmp(dialect,"classic") || !strcmp(dialect,"traditional"))
561 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN_CLASSIC )
563 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN )
564 LANG_ENTRY_END( LITHUANIAN )
565 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI )
566 LANG_ENTRY_END( MAORI )
567 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI )
568 LANG_ENTRY_END( FARSI )
569 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE )
570 LANG_ENTRY_END( VIETNAMESE )
571 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN )
572 LANG_ENTRY_END( ARMENIAN )
573 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI )
575 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
576 LANG_DIALECT_ENTRY( AZERI, AZERI_CYRILLIC )
578 LANG_DIALECT_ENTRY( AZERI, AZERI )
579 LANG_ENTRY_END( AZERI )
580 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE )
581 LANG_ENTRY_END( BASQUE )
582 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
583 LANG_ENTRY_END( SORBIAN ) */
584 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN )
585 LANG_ENTRY_END( MACEDONIAN )
586 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
587 LANG_ENTRY_END( SUTU ) */
588 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA )
589 LANG_ENTRY_END( TSONGA )
590 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
591 LANG_ENTRY_END( TSWANA ) */
592 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
593 LANG_ENTRY_END( VENDA ) */
594 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA )
595 LANG_ENTRY_END( XHOSA )
596 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU )
597 LANG_ENTRY_END( ZULU )
598 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS )
599 LANG_ENTRY_END( AFRIKAANS )
600 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN )
601 LANG_ENTRY_END( GEORGIAN )
602 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE )
603 LANG_ENTRY_END( FAEROESE )
604 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI )
605 LANG_ENTRY_END( HINDI )
606 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE )
607 LANG_ENTRY_END( MALTESE )
608 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
609 LANG_ENTRY_END( SAAMI ) */
610 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC )
611 LANG_DIALECT_ENTRY( GAELIC, GAELIC )
612 LANG_ENTRY_END( GAELIC )
613 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC )
614 LANG_DIALECT_ENTRY( GAELIC, GAELIC_SCOTTISH )
615 LANG_ENTRY_END( GAELIC )
617 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY )
618 LANG_SUB_ENTRY( "MY", MALAY, MALAY )
619 LANG_SUB_ENTRY( "BN", MALAY, MALAY_BRUNEI_DARUSSALAM )
620 LANG_ENTRY_END( MALAY )
621 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH )
622 LANG_ENTRY_END( KAZAKH )
624 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI )
625 LANG_ENTRY_END( SWAHILI )
627 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK )
629 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
630 LANG_DIALECT_ENTRY( UZBEK, UZBEK_CYRILLIC )
632 LANG_DIALECT_ENTRY( UZBEK, UZBEK )
633 LANG_ENTRY_END( UZBEK )
634 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR )
635 LANG_ENTRY_END( TATAR )
636 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI )
637 LANG_ENTRY_END( BENGALI )
638 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI )
639 LANG_ENTRY_END( PUNJABI )
640 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI )
641 LANG_ENTRY_END( GUJARATI )
642 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA )
643 LANG_ENTRY_END( ORIYA )
644 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL )
645 LANG_ENTRY_END( TAMIL )
646 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU )
647 LANG_ENTRY_END( TELUGU )
648 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA )
649 LANG_ENTRY_END( KANNADA )
650 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM )
651 LANG_ENTRY_END( MALAYALAM )
652 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE )
653 LANG_ENTRY_END( ASSAMESE )
654 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI )
655 LANG_ENTRY_END( MARATHI )
656 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT )
657 LANG_ENTRY_END( SANSKRIT )
659 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
660 LANG_ENTRY_END( KONKANI ) */
662 LANG_ENTRY_BEGIN( "eo", ESPERANTO ) /* not official */
663 LANG_ENTRY_END( ESPERANTO )
664 LANG_ENTRY_BEGIN( "wa", WALON ) /* not official */
665 LANG_ENTRY_END( WALON )
669 end_MAIN_GetLanguageID:
670 if (Charset) free(charset);
676 /***********************************************************************
677 * MAIN_ParseLanguageOption
679 * Parse -language option.
681 void MAIN_ParseLanguageOption( char *arg )
683 const WINE_LANGUAGE_DEF *p = Languages;
685 /* for compatibility whith non-iso names previously used */
686 if (!strcmp("Sw",arg)) { strcpy(arg,"Sv"); FIXME_(system)("use 'Sv' instead of 'Sw'\n");}
687 if (!strcmp("Cz",arg)) { strcpy(arg,"Cs"); FIXME_(system)("use 'Cs' instead of 'Cz'\n");}
688 if (!strcmp("Po",arg)) { strcpy(arg,"Pt"); FIXME_(system)("use 'Pt' instead of 'Po'\n");}
690 Options.language = LANG_Xx; /* First (dummy) language */
693 if (!lstrcmpiA( p->name, arg ))
695 WINE_LanguageId = p->langid;
700 MESSAGE( "Invalid language specified '%s'. Supported languages are: ", arg );
701 for (p = Languages; p->name; p++) MESSAGE( "%s ", p->name );
707 /***********************************************************************
708 * MAIN_ParseModeOption
710 * Parse -mode option.
712 void MAIN_ParseModeOption( char *arg )
714 if (!lstrcmpiA("enhanced", arg)) Options.mode = MODE_ENHANCED;
715 else if (!lstrcmpiA("standard", arg)) Options.mode = MODE_STANDARD;
718 MESSAGE( "Invalid mode '%s' specified.\n", arg);
719 MESSAGE( "Valid modes are: 'standard', 'enhanced' (default).\n");
724 /***********************************************************************
727 * Parse command line options and open display.
729 static void MAIN_ParseOptions( int *argc, char *argv[] )
736 Options.programName = MAIN_GetProgramName( *argc, argv );
737 Options.argv0 = argv[0];
739 /* initialise Options.language to 0 to tell "no language choosen yet" */
740 Options.language = 0;
742 /* make sure there is no "." in Options.programName to confuse the X
743 resource database lookups */
744 if ((pcDot = strchr(Options.programName, '.'))) *pcDot = '\0';
746 for (i = 1; i < *argc; i++)
748 if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "-version" ))
750 MESSAGE( "%s\n", WINE_RELEASE_INFO );
753 if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "-help" ))
761 /***********************************************************************
764 static void called_at_exit(void)
767 GDI_Driver->pFinalize();
769 USER_Driver->pFinalize();
775 /***********************************************************************
778 * Wine initialisation and command-line parsing
780 BOOL MAIN_WineInit( int *argc, char *argv[] )
784 #ifdef MALLOC_DEBUGGING
788 if (!(trace = getenv("MALLOC_TRACE")))
790 MESSAGE( "MALLOC_TRACE not set. No trace generated\n" );
794 MESSAGE( "malloc trace goes to %s\n", trace );
802 setlocale(LC_CTYPE,"");
803 gettimeofday( &tv, NULL);
804 MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
806 MAIN_ParseOptions(argc, argv);
808 #ifndef X_DISPLAY_MISSING
809 USER_Driver = &X11DRV_USER_Driver;
810 #else /* !defined(X_DISPLAY_MISSING) */
811 USER_Driver = &TTYDRV_USER_Driver;
812 #endif /* !defined(X_DISPLAY_MISSING) */
814 USER_Driver->pInitialize();
816 MONITOR_Initialize(&MONITOR_PrimaryMonitor);
818 atexit(called_at_exit);
822 /***********************************************************************
823 * MessageBeep16 (USER.104)
825 void WINAPI MessageBeep16( UINT16 i )
831 /***********************************************************************
832 * MessageBeep32 (USER32.390)
834 BOOL WINAPI MessageBeep( UINT i )
841 /***********************************************************************
844 BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
846 /* dwFreq and dwDur are ignored by Win95 */
852 /***********************************************************************
853 * GetTimerResolution (USER.14)
855 LONG WINAPI GetTimerResolution16(void)
860 /***********************************************************************
861 * SystemParametersInfo32A (USER32.540)
863 BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
864 LPVOID lpvParam, UINT fuWinIni )
870 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
873 KEYBOARD_SetBeepActive(uParam);
877 *(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
880 case SPI_GETDRAGFULLWINDOWS:
881 *(BOOL *) lpvParam = FALSE;
884 case SPI_SETDRAGFULLWINDOWS:
887 case SPI_GETFASTTASKSWITCH:
888 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
889 *(BOOL *) lpvParam = TRUE;
891 *(BOOL *) lpvParam = FALSE;
894 case SPI_GETGRIDGRANULARITY:
895 *(INT*)lpvParam=GetProfileIntA("desktop","GridGranularity",1);
898 case SPI_GETICONTITLEWRAP:
899 *(BOOL*)lpvParam=GetProfileIntA("desktop","IconTitleWrap",TRUE);
902 case SPI_GETKEYBOARDDELAY:
903 *(INT*)lpvParam=GetProfileIntA("keyboard","KeyboardDelay",1);
906 case SPI_GETKEYBOARDSPEED:
907 *(DWORD*)lpvParam=GetProfileIntA("keyboard","KeyboardSpeed",30);
910 case SPI_GETMENUDROPALIGNMENT:
911 *(BOOL*)lpvParam=GetSystemMetrics(SM_MENUDROPALIGNMENT); /* XXX check this */
914 case SPI_GETSCREENSAVEACTIVE:
915 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
916 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
917 *(BOOL*)lpvParam = TRUE;
919 *(BOOL*)lpvParam = FALSE;
922 case SPI_GETSCREENSAVETIMEOUT:
923 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
925 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
926 *(INT *) lpvParam = timeout * 1000;
929 case SPI_ICONHORIZONTALSPACING:
930 /* FIXME Get/SetProfileInt */
931 if (lpvParam == NULL)
932 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
934 *(INT*)lpvParam=GetSystemMetrics(SM_CXICONSPACING);
937 case SPI_ICONVERTICALSPACING:
938 /* FIXME Get/SetProfileInt */
939 if (lpvParam == NULL)
940 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
942 *(INT*)lpvParam=GetSystemMetrics(SM_CYICONSPACING);
945 case SPI_GETICONTITLELOGFONT: {
946 LPLOGFONTA lpLogFont = (LPLOGFONTA)lpvParam;
948 /* from now on we always have an alias for MS Sans Serif */
950 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
951 lpLogFont->lfFaceName, LF_FACESIZE );
952 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
953 lpLogFont->lfWidth = 0;
954 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
955 lpLogFont->lfWeight = FW_NORMAL;
956 lpLogFont->lfItalic = FALSE;
957 lpLogFont->lfStrikeOut = FALSE;
958 lpLogFont->lfUnderline = FALSE;
959 lpLogFont->lfCharSet = ANSI_CHARSET;
960 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
961 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
962 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
965 case SPI_GETWORKAREA:
966 SetRect( (RECT *)lpvParam, 0, 0,
967 GetSystemMetrics( SM_CXSCREEN ),
968 GetSystemMetrics( SM_CYSCREEN )
971 case SPI_GETNONCLIENTMETRICS:
973 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
975 if( lpnm->cbSize == sizeof(NONCLIENTMETRICSA) )
976 { LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
978 /* FIXME: initialize geometry entries */
980 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
981 (LPVOID)&(lpnm->lfCaptionFont),0);
984 lpnm->iCaptionWidth = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 12;
985 lpnm->iCaptionHeight = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 12;
986 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfSmCaptionFont),0);
987 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
990 lpnm->iCaptionWidth = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 10;
991 lpnm->iCaptionHeight = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 10;
993 /* menus, FIXME: names of wine.conf entrys are bogus */
995 lpnm->iMenuWidth = GetProfileIntA("Desktop","MenuWidth", 8); /* size of the menu buttons*/
996 lpnm->iMenuHeight = GetProfileIntA("Desktop","MenuHeight",
997 (TWEAK_WineLook > WIN31_LOOK) ? 8 : 16);
999 GetProfileStringA("Desktop", "MenuFont",
1000 (TWEAK_WineLook > WIN31_LOOK) ? "MS Sans Serif": "System",
1001 lpLogFont->lfFaceName, LF_FACESIZE );
1003 lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 8);
1004 lpLogFont->lfWidth = 0;
1005 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1006 lpLogFont->lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
1007 lpLogFont->lfItalic = FALSE;
1008 lpLogFont->lfStrikeOut = FALSE;
1009 lpLogFont->lfUnderline = FALSE;
1010 lpLogFont->lfCharSet = ANSI_CHARSET;
1011 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1012 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1013 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1015 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
1016 (LPVOID)&(lpnm->lfStatusFont),0);
1017 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
1018 (LPVOID)&(lpnm->lfMessageFont),0);
1023 case SPI_GETANIMATION: {
1024 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
1026 /* Tell it "disabled" */
1027 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
1028 uParam = sizeof(ANIMATIONINFO);
1029 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1033 case SPI_SETANIMATION: {
1034 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
1037 WARN_(system)("SPI_SETANIMATION ignored.\n");
1038 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
1039 uParam = sizeof(ANIMATIONINFO);
1043 case SPI_GETHIGHCONTRAST:
1045 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)lpvParam;
1047 FIXME_(system)("SPI_GETHIGHCONTRAST not fully implemented\n");
1049 if ( lpHighContrastA->cbSize == sizeof( HIGHCONTRASTA ) )
1051 /* Indicate that there is no high contrast available */
1052 lpHighContrastA->dwFlags = 0;
1053 lpHighContrastA->lpszDefaultScheme = NULL;
1064 return SystemParametersInfo16(uAction,uParam,lpvParam,fuWinIni);
1070 /***********************************************************************
1071 * SystemParametersInfo16 (USER.483)
1073 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
1074 LPVOID lpvParam, UINT16 fuWinIni )
1082 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
1086 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXFRAME );
1089 case SPI_GETFASTTASKSWITCH:
1090 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1091 *(BOOL16 *) lpvParam = TRUE;
1093 *(BOOL16 *) lpvParam = FALSE;
1096 case SPI_GETGRIDGRANULARITY:
1097 *(INT16 *) lpvParam = GetProfileIntA( "desktop",
1102 case SPI_GETICONTITLEWRAP:
1103 *(BOOL16 *) lpvParam = GetProfileIntA( "desktop",
1108 case SPI_GETKEYBOARDDELAY:
1109 *(INT16 *) lpvParam = GetProfileIntA( "keyboard",
1110 "KeyboardDelay", 1 );
1113 case SPI_GETKEYBOARDSPEED:
1114 *(WORD *) lpvParam = GetProfileIntA( "keyboard",
1119 case SPI_GETMENUDROPALIGNMENT:
1120 *(BOOL16 *) lpvParam = GetSystemMetrics16( SM_MENUDROPALIGNMENT ); /* XXX check this */
1123 case SPI_GETSCREENSAVEACTIVE:
1124 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
1125 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
1126 *(BOOL16 *) lpvParam = TRUE;
1128 *(BOOL16 *) lpvParam = FALSE;
1131 case SPI_GETSCREENSAVETIMEOUT:
1132 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
1134 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1135 *(INT16 *) lpvParam = timeout;
1138 case SPI_ICONHORIZONTALSPACING:
1139 /* FIXME Get/SetProfileInt */
1140 if (lpvParam == NULL)
1141 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1143 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXICONSPACING );
1146 case SPI_ICONVERTICALSPACING:
1147 /* FIXME Get/SetProfileInt */
1148 if (lpvParam == NULL)
1149 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1151 *(INT16 *)lpvParam = GetSystemMetrics16(SM_CYICONSPACING);
1155 KEYBOARD_SetBeepActive(uParam);
1158 case SPI_SETSCREENSAVEACTIVE:
1159 MONITOR_SetScreenSaveActive(&MONITOR_PrimaryMonitor, uParam);
1162 case SPI_SETSCREENSAVETIMEOUT:
1163 MONITOR_SetScreenSaveTimeout(&MONITOR_PrimaryMonitor, uParam);
1166 case SPI_SETDESKWALLPAPER:
1167 return (SetDeskWallPaper((LPSTR) lpvParam));
1170 case SPI_SETDESKPATTERN:
1171 if ((INT16)uParam == -1) {
1172 GetProfileStringA("Desktop", "Pattern",
1173 "170 85 170 85 170 85 170 85",
1174 buffer, sizeof(buffer) );
1175 return (DESKTOP_SetPattern((LPSTR) buffer));
1177 return (DESKTOP_SetPattern((LPSTR) lpvParam));
1180 case SPI_GETICONTITLELOGFONT:
1182 LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
1184 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1185 lpLogFont->lfFaceName, LF_FACESIZE );
1186 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
1187 lpLogFont->lfWidth = 0;
1188 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1189 lpLogFont->lfWeight = FW_NORMAL;
1190 lpLogFont->lfItalic = FALSE;
1191 lpLogFont->lfStrikeOut = FALSE;
1192 lpLogFont->lfUnderline = FALSE;
1193 lpLogFont->lfCharSet = ANSI_CHARSET;
1194 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1195 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1196 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1199 case SPI_GETNONCLIENTMETRICS:
1201 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1202 if( lpnm->cbSize == sizeof(NONCLIENTMETRICS16) )
1204 /* FIXME: initialize geometry entries */
1205 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1206 (LPVOID)&(lpnm->lfCaptionFont),0);
1207 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1208 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1209 (LPVOID)&(lpnm->lfSmCaptionFont),0);
1210 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1211 (LPVOID)&(lpnm->lfMenuFont),0);
1212 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1213 (LPVOID)&(lpnm->lfStatusFont),0);
1214 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1215 (LPVOID)&(lpnm->lfMessageFont),0);
1217 else /* winfile 95 sets sbSize to 340 */
1218 SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
1222 case SPI_LANGDRIVER:
1224 case SPI_SETDOUBLECLKHEIGHT:
1225 case SPI_SETDOUBLECLICKTIME:
1226 case SPI_SETDOUBLECLKWIDTH:
1227 case SPI_SETFASTTASKSWITCH:
1228 case SPI_SETKEYBOARDDELAY:
1229 case SPI_SETKEYBOARDSPEED:
1230 WARN_(system)("Option %d ignored.\n", uAction);
1233 case SPI_GETWORKAREA:
1234 SetRect16( (RECT16 *)lpvParam, 0, 0,
1235 GetSystemMetrics16( SM_CXSCREEN ),
1236 GetSystemMetrics16( SM_CYSCREEN ) );
1240 WARN_(system)("Unknown option %d.\n", uAction);
1246 /***********************************************************************
1247 * SystemParametersInfo32W (USER32.541)
1249 BOOL WINAPI SystemParametersInfoW( UINT uAction, UINT uParam,
1250 LPVOID lpvParam, UINT fuWinIni )
1256 case SPI_SETDESKWALLPAPER:
1259 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1260 return SetDeskWallPaper(buffer);
1262 return SetDeskWallPaper(NULL);
1264 case SPI_SETDESKPATTERN:
1265 if ((INT) uParam == -1)
1267 GetProfileStringA("Desktop", "Pattern",
1268 "170 85 170 85 170 85 170 85",
1269 buffer, sizeof(buffer) );
1270 return (DESKTOP_SetPattern((LPSTR) buffer));
1274 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1275 return DESKTOP_SetPattern(buffer);
1277 return DESKTOP_SetPattern(NULL);
1279 case SPI_GETICONTITLELOGFONT:
1281 LPLOGFONTW lpLogFont = (LPLOGFONTW)lpvParam;
1282 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1283 buffer, sizeof(buffer) );
1284 lstrcpynAtoW(lpLogFont->lfFaceName, buffer ,LF_FACESIZE);
1285 lpLogFont->lfHeight = 10;
1286 lpLogFont->lfWidth = 0;
1287 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1288 lpLogFont->lfWeight = FW_NORMAL;
1289 lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE;
1290 lpLogFont->lfCharSet = ANSI_CHARSET;
1291 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1292 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1293 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1296 case SPI_GETNONCLIENTMETRICS: {
1297 /* FIXME: implement correctly */
1298 LPNONCLIENTMETRICSW lpnm=(LPNONCLIENTMETRICSW)lpvParam;
1300 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfCaptionFont),0);
1301 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1302 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfSmCaptionFont),0);
1303 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMenuFont),0);
1304 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfStatusFont),0);
1305 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMessageFont),0);
1309 case SPI_GETHIGHCONTRAST:
1311 LPHIGHCONTRASTW lpHighContrastW = (LPHIGHCONTRASTW)lpvParam;
1313 FIXME_(system)("SPI_GETHIGHCONTRAST not fully implemented\n");
1315 if ( lpHighContrastW->cbSize == sizeof( HIGHCONTRASTW ) )
1317 /* Indicate that there is no high contrast available */
1318 lpHighContrastW->dwFlags = 0;
1319 lpHighContrastW->lpszDefaultScheme = NULL;
1330 return SystemParametersInfoA(uAction,uParam,lpvParam,fuWinIni);
1337 /***********************************************************************
1338 * FileCDR (KERNEL.130)
1340 FARPROC16 WINAPI FileCDR16(FARPROC16 x)
1342 FIXME_(file)("(0x%8x): stub\n", (int) x);
1343 return (FARPROC16)TRUE;