4 * Copyright 1994 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
12 #else /* X_DISPLAY_MISSING */
14 #endif /* X_DISPLAY_MISSING */
21 #ifdef MALLOC_DEBUGGING
32 #include "builtin32.h"
34 #include "debugdefs.h"
41 /* when adding new languages look at ole/ole2nls.c
42 * for proper iso name and Windows code (add 0x0400
43 * to the code listed there)
45 const WINE_LANGUAGE_DEF Languages
[] =
47 {"En",0x0409}, /* LANG_En */
48 {"Es",0x040A}, /* LANG_Es */
49 {"De",0x0407}, /* LANG_De */
50 {"No",0x0414}, /* LANG_No */
51 {"Fr",0x040C}, /* LANG_Fr */
52 {"Fi",0x040B}, /* LANG_Fi */
53 {"Da",0x0406}, /* LANG_Da */
54 {"Cs",0x0405}, /* LANG_Cs */
55 {"Eo",0x048f}, /* LANG_Eo */
56 {"It",0x0410}, /* LANG_It */
57 {"Ko",0x0412}, /* LANG_Ko */
58 {"Hu",0x040e}, /* LANG_Hu */
59 {"Pl",0x0415}, /* LANG_Pl */
60 {"Pt",0x0416}, /* LANG_Pt */
61 {"Sv",0x041d}, /* LANG_Sv */
62 {"Ca",0x0403}, /* LANG_Ca */
63 {"Nl",0x0413}, /* LANG_Nl */
64 {"Ru",0x0419}, /* LANG_Ru */
68 WORD WINE_LanguageId
= 0x409; /* english as default */
70 struct options Options
=
71 { /* default options */
74 NULL
, /* desktopGeometry */
75 NULL
, /* programName */
78 FALSE
, /* usePrivateMap */
79 FALSE
, /* useFixedMap */
80 FALSE
, /* synchronous */
81 FALSE
, /* backing store */
82 SW_SHOWNORMAL
, /* cmdShow */
84 FALSE
, /* failReadOnly */
85 MODE_ENHANCED
, /* Enhanced mode */
87 DEFAULT_LANG
, /* Default language */
91 FALSE
, /* Managed windows */
92 FALSE
, /* Perfect graphics */
94 NULL
, /* Alternate config file name */
98 static char szUsage
[] =
100 "Usage: %s [options] \"program_name [arguments]\"\n"
101 #ifndef X_DISPLAY_MISSING
104 " -backingstore Turn on backing store\n"
105 " -config name Specify config file to use\n"
106 " -console driver Select which driver(s) to use for the console\n"
107 " -debug Enter debugger before starting application\n"
108 " -debugmsg name Turn debugging-messages on or off\n"
109 " -depth n Change the depth to use for multiple-depth screens\n"
110 " -desktop geom Use a desktop window of the given geometry\n"
111 " -display name Use the specified display\n"
112 " -dll name Enable or disable built-in DLLs\n"
113 " -failreadonly Read only files may not be opened in write mode\n"
114 " -fixedmap Use a \"standard\" color map\n"
115 " -help Show this help message\n"
116 " -iconic Start as an icon\n"
117 " -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n"
118 " Ko,Nl,No,Pl,Pt,Sv,Ru)\n"
119 " -managed Allow the window manager to manage created windows\n"
120 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
121 " -name name Set the application name\n"
122 " -nodga Disable XFree86 DGA extensions\n"
123 " -perfect Favor correctness over speed for graphical operations\n"
124 " -privatemap Use a private color map\n"
125 " -synchronous Turn on synchronous display mode\n"
126 " -version Display the Wine version\n"
127 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
128 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
129 #endif /* X_DISPLAY_MISSING */
132 /***********************************************************************
135 void MAIN_Usage( char *name
)
137 MSG( szUsage
, WINE_RELEASE_INFO
, name
);
141 /***********************************************************************
142 * MAIN_GetProgramName
144 * Get the program name. The name is specified by (in order of precedence):
145 * - the option '-name'.
146 * - the environment variable 'WINE_NAME'.
147 * - the last component of argv[0].
149 static char *MAIN_GetProgramName( int argc
, char *argv
[] )
154 for (i
= 1; i
< argc
-1; i
++)
155 if (!strcmp( argv
[i
], "-name" )) return argv
[i
+1];
156 if ((p
= getenv( "WINE_NAME" )) != NULL
) return p
;
157 if ((p
= strrchr( argv
[0], '/' )) != NULL
) return p
+1;
161 /***********************************************************************
162 * MAIN_ParseDebugOptions
164 * Turns specific debug messages on or off, according to "options".
167 * TRUE if parsing was successful
169 BOOL
MAIN_ParseDebugOptions(char *options
)
171 /* defined in relay32/relay386.c */
172 extern char **debug_relay_includelist
;
173 extern char **debug_relay_excludelist
;
174 /* defined in relay32/snoop.c */
175 extern char **debug_snoop_includelist
;
176 extern char **debug_snoop_excludelist
;
179 int l
, cls
, dotracerelay
= TRACE_ON(relay
);
184 if (options
[l
-1]=='\n') options
[l
-1]='\0';
187 if ((*options
!='+')&&(*options
!='-')){
190 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
191 if(!lstrncmpiA(options
, debug_cl_name
[j
], strlen(debug_cl_name
[j
])))
193 if(j
==DEBUG_CLASS_COUNT
)
195 options
+= strlen(debug_cl_name
[j
]);
196 if ((*options
!='+')&&(*options
!='-'))
201 cls
= -1; /* all classes */
203 if (strchr(options
,','))
204 l
=strchr(options
,',')-options
;
208 if (!lstrncmpiA(options
+1,"all",l
-1))
211 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
212 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
213 if(cls
== -1 || cls
== j
)
214 debug_msg_enabled
[i
][j
]=(*options
=='+');
216 else if (!lstrncmpiA(options
+1, "relay=", 6) ||
217 !lstrncmpiA(options
+1, "snoop=", 6))
220 char *s
, *s2
, ***output
, c
;
222 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
223 if (debug_ch_name
&& (!lstrncmpiA(debug_ch_name
[i
],options
+1,5))){
224 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
225 if(cls
== -1 || cls
== j
)
226 debug_msg_enabled
[i
][j
]=TRUE
;
229 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
230 if (i
==DEBUG_CHANNEL_COUNT
)
232 output
= (*options
== '+') ?
233 ((*(options
+1) == 'r') ?
234 &debug_relay_includelist
:
235 &debug_snoop_includelist
) :
236 ((*(options
+1) == 'r') ?
237 &debug_relay_excludelist
:
238 &debug_snoop_excludelist
);
241 while((s
= strchr(s
, ':'))) i
++, s
++;
242 *output
= malloc(sizeof(char **) * i
+ 1);
245 while((s2
= strchr(s
, ':'))) {
248 *((*output
)+i
) = strdup(s
);
254 *(options
+ l
) = '\0';
255 *((*output
)+i
) = strdup(s
);
257 *((*output
)+i
+1) = NULL
;
262 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
263 if (debug_ch_name
&& (!lstrncmpiA(options
+1,debug_ch_name
[i
],l
-1))){
264 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
265 if(cls
== -1 || cls
== j
)
266 debug_msg_enabled
[i
][j
]=(*options
=='+');
269 if (i
==DEBUG_CHANNEL_COUNT
)
274 while((*options
==',')&&(*(++options
)));
276 /* special handling for relay debugging */
277 if (dotracerelay
!= TRACE_ON(relay
))
278 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay
) );
284 MSG("%s: Syntax: -debugmsg [class]+xxx,... or "
285 "-debugmsg [class]-xxx,...\n",Options
.argv
[0]);
286 MSG("Example: -debugmsg +all,warn-heap\n"
287 " turn on all messages except warning heap messages\n");
288 MSG("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
289 " turn on -debugmsg +relay only as specified\n"
290 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
291 " turn on -debugmsg +relay except as specified\n"
292 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
294 MSG("Available message classes:\n");
295 for(i
=0;i
<DEBUG_CLASS_COUNT
;i
++)
296 MSG( "%-9s", debug_cl_name
[i
]);
299 MSG("Available message types:\n");
301 for(i
=0;i
<DEBUG_CHANNEL_COUNT
;i
++)
303 MSG("%-9s%c",debug_ch_name
[i
],
304 (((i
+2)%8==0)?'\n':' '));
309 /***********************************************************************
313 * Lang: a string whose two first chars are the iso name of a language.
314 * Country: a string whose two first chars are the iso name of country
315 * Charset: a string defining the chossen charset encoding
316 * Dialect: a string defining a variation of the locale
318 * all those values are from the standardized format of locale
319 * name in unix which is: Lang[_Country][.Charset][@Dialect]
322 * the numeric code of the language used by Windows (or 0x00)
324 int MAIN_GetLanguageID(LPCSTR Lang
,LPCSTR Country
,LPCSTR Charset
,LPCSTR Dialect
)
326 char lang
[3]="??", country
[3]={0,0,0};
327 char *charset
=NULL
, *dialect
=NULL
;
330 if (Lang
==NULL
) return 0x00;
331 if (Lang
[0]) lang
[0]=tolower(Lang
[0]);
332 if (Lang
[1]) lang
[1]=tolower(Lang
[1]);
335 if (Country
[0]) country
[0]=toupper(Country
[0]);
336 if (Country
[1]) country
[1]=toupper(Country
[1]);
341 charset
=(char*)malloc(j
+1);
343 charset
[i
]=toupper(Charset
[i
]);
349 dialect
=(char*)malloc(j
+1);
351 dialect
[i
]=tolower(Dialect
[i
]);
358 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
361 goto end_MAIN_GetLanguageID; \
363 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
364 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
365 goto end_MAIN_GetLanguageID;
366 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
367 goto end_MAIN_GetLanguageID; }
368 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
369 goto end_MAIN_GetLanguageID; \
372 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC
)
373 LANG_SUB_ENTRY( "SA", ARABIC
, ARABIC
)
374 LANG_SUB_ENTRY( "IQ", ARABIC
, ARABIC_IRAQ
)
375 LANG_SUB_ENTRY( "EG", ARABIC
, ARABIC_EGYPT
)
376 LANG_SUB_ENTRY( "LY", ARABIC
, ARABIC_LIBYA
)
377 LANG_SUB_ENTRY( "DZ", ARABIC
, ARABIC_ALGERIA
)
378 LANG_SUB_ENTRY( "MA", ARABIC
, ARABIC_MOROCCO
)
379 LANG_SUB_ENTRY( "TN", ARABIC
, ARABIC_TUNISIA
)
380 LANG_SUB_ENTRY( "OM", ARABIC
, ARABIC_OMAN
)
381 LANG_SUB_ENTRY( "YE", ARABIC
, ARABIC_YEMEN
)
382 LANG_SUB_ENTRY( "SY", ARABIC
, ARABIC_SYRIA
)
383 LANG_SUB_ENTRY( "JO", ARABIC
, ARABIC_JORDAN
)
384 LANG_SUB_ENTRY( "LB", ARABIC
, ARABIC_LEBANON
)
385 LANG_SUB_ENTRY( "KW", ARABIC
, ARABIC_KUWAIT
)
386 LANG_SUB_ENTRY( "AE", ARABIC
, ARABIC_UAE
)
387 LANG_SUB_ENTRY( "BH", ARABIC
, ARABIC_BAHRAIN
)
388 LANG_SUB_ENTRY( "QA", ARABIC
, ARABIC_QATAR
)
389 LANG_ENTRY_END( ARABIC
)
390 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN
)
391 LANG_ENTRY_END( BULGARIAN
)
392 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN
)
393 LANG_ENTRY_END( CATALAN
)
394 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE
)
395 LANG_SUB_ENTRY( "TW", CHINESE
, CHINESE_TRADITIONAL
)
396 LANG_SUB_ENTRY( "CN", CHINESE
, CHINESE_SIMPLIFIED
)
397 LANG_SUB_ENTRY( "HK", CHINESE
, CHINESE_HONGKONG
)
398 LANG_SUB_ENTRY( "SG", CHINESE
, CHINESE_SINGAPORE
)
399 LANG_SUB_ENTRY( "MO", CHINESE
, CHINESE_MACAU
)
400 LANG_ENTRY_END( CHINESE
)
401 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH
)
402 LANG_ENTRY_END( CZECH
)
403 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH
)
404 LANG_ENTRY_END( DANISH
)
405 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN
)
406 LANG_SUB_ENTRY( "DE", GERMAN
, GERMAN
)
407 LANG_SUB_ENTRY( "CH", GERMAN
, GERMAN_SWISS
)
408 LANG_SUB_ENTRY( "AT", GERMAN
, GERMAN_AUSTRIAN
)
409 LANG_SUB_ENTRY( "LU", GERMAN
, GERMAN_LUXEMBOURG
)
410 LANG_SUB_ENTRY( "LI", GERMAN
, GERMAN_LIECHTENSTEIN
)
411 LANG_ENTRY_END( GERMAN
)
412 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK
)
413 LANG_ENTRY_END( GREEK
)
414 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH
)
415 LANG_SUB_ENTRY( "US", ENGLISH
, ENGLISH_US
)
416 LANG_SUB_ENTRY( "UK", ENGLISH
, ENGLISH_UK
)
417 LANG_SUB_ENTRY( "AU", ENGLISH
, ENGLISH_AUS
)
418 LANG_SUB_ENTRY( "CA", ENGLISH
, ENGLISH_CAN
)
419 LANG_SUB_ENTRY( "NZ", ENGLISH
, ENGLISH_NZ
)
420 LANG_SUB_ENTRY( "EI", ENGLISH
, ENGLISH_EIRE
)
421 LANG_SUB_ENTRY( "ZA", ENGLISH
, ENGLISH_SAFRICA
)
422 LANG_SUB_ENTRY( "JM", ENGLISH
, ENGLISH_JAMAICA
)
423 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
424 LANG_SUB_ENTRY( "BZ", ENGLISH
, ENGLISH_BELIZE
)
425 LANG_SUB_ENTRY( "TT", ENGLISH
, ENGLISH_TRINIDAD
)
426 LANG_SUB_ENTRY( "ZW", ENGLISH
, ENGLISH_ZIMBABWE
)
427 LANG_SUB_ENTRY( "PH", ENGLISH
, ENGLISH_PHILIPPINES
)
428 LANG_ENTRY_END( ENGLISH
)
429 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH
)
430 /* traditional sorting */
431 if (!strcmp(dialect
,"tradicional"))
432 LANG_DIALECT_ENTRY( SPANISH
, SPANISH
)
433 LANG_SUB_ENTRY( "MX", SPANISH
, SPANISH_MEXICAN
)
434 LANG_SUB_ENTRY( "ES", SPANISH
, SPANISH_MODERN
)
435 LANG_SUB_ENTRY( "GT", SPANISH
, SPANISH_GUATEMALA
)
436 LANG_SUB_ENTRY( "CR", SPANISH
, SPANISH_COSTARICA
)
437 LANG_SUB_ENTRY( "PA", SPANISH
, SPANISH_PANAMA
)
438 LANG_SUB_ENTRY( "DO", SPANISH
, SPANISH_DOMINICAN
)
439 LANG_SUB_ENTRY( "VE", SPANISH
, SPANISH_VENEZUELA
)
440 LANG_SUB_ENTRY( "CO", SPANISH
, SPANISH_COLOMBIA
)
441 LANG_SUB_ENTRY( "PE", SPANISH
, SPANISH_PERU
)
442 LANG_SUB_ENTRY( "AR", SPANISH
, SPANISH_ARGENTINA
)
443 LANG_SUB_ENTRY( "EC", SPANISH
, SPANISH_ECUADOR
)
444 LANG_SUB_ENTRY( "CL", SPANISH
, SPANISH_CHILE
)
445 LANG_SUB_ENTRY( "UY", SPANISH
, SPANISH_URUGUAY
)
446 LANG_SUB_ENTRY( "PY", SPANISH
, SPANISH_PARAGUAY
)
447 LANG_SUB_ENTRY( "BO", SPANISH
, SPANISH_BOLIVIA
)
448 LANG_SUB_ENTRY( "HN", SPANISH
, SPANISH_HONDURAS
)
449 LANG_SUB_ENTRY( "NI", SPANISH
, SPANISH_NICARAGUA
)
450 LANG_SUB_ENTRY( "PR", SPANISH
, SPANISH_PUERTO_RICO
)
451 LANG_ENTRY_END( SPANISH
)
452 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH
)
453 LANG_ENTRY_END( FINNISH
)
454 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH
)
455 LANG_SUB_ENTRY( "FR", FRENCH
, FRENCH
)
456 LANG_SUB_ENTRY( "BE", FRENCH
, FRENCH_BELGIAN
)
457 LANG_SUB_ENTRY( "CA", FRENCH
, FRENCH_CANADIAN
)
458 LANG_SUB_ENTRY( "CH", FRENCH
, FRENCH_SWISS
)
459 LANG_SUB_ENTRY( "LU", FRENCH
, FRENCH_LUXEMBOURG
)
460 LANG_SUB_ENTRY( "MC", FRENCH
, FRENCH_MONACO
)
461 LANG_ENTRY_END( FRENCH
)
462 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW
)
463 LANG_ENTRY_END( HEBREW
)
464 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN
)
465 LANG_ENTRY_END( HUNGARIAN
)
466 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC
)
467 LANG_ENTRY_END( ICELANDIC
)
468 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN
)
469 LANG_SUB_ENTRY( "IT", ITALIAN
, ITALIAN
)
470 LANG_SUB_ENTRY( "CH", ITALIAN
, ITALIAN_SWISS
)
471 LANG_ENTRY_END( ITALIAN
)
472 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE
)
473 LANG_ENTRY_END( JAPANESE
)
474 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN
)
476 if (!strcmp(charset
,"JOHAB"))
477 LANG_DIALECT_ENTRY( KOREAN
, KOREAN_JOHAB
)
479 LANG_DIALECT_ENTRY( KOREAN
, KOREAN
)
480 LANG_ENTRY_END( KOREAN
)
481 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH
)
482 LANG_SUB_ENTRY( "NL", DUTCH
, DUTCH
)
483 LANG_SUB_ENTRY( "BE", DUTCH
, DUTCH_BELGIAN
)
484 LANG_SUB_ENTRY( "SR", DUTCH
, DUTCH_SURINAM
)
485 LANG_ENTRY_END( DUTCH
)
486 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN
)
488 if (!strcmp(dialect
,"nynorsk"))
489 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_NYNORSK
)
491 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_BOKMAL
)
492 LANG_ENTRY_END( NORWEGIAN
)
493 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH
)
494 LANG_ENTRY_END( POLISH
)
495 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE
)
496 LANG_SUB_ENTRY( "BR", PORTUGUESE
, PORTUGUESE_BRAZILIAN
)
497 LANG_SUB_ENTRY( "PT", PORTUGUESE
, PORTUGUESE
)
498 LANG_ENTRY_END( PORTUGUESE
)
499 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE
)
500 LANG_ENTRY_END( RHAETO_ROMANCE
)
501 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN
)
502 LANG_SUB_ENTRY( "RO", ROMANIAN
, ROMANIAN
)
503 LANG_SUB_ENTRY( "MD", ROMANIAN
, ROMANIAN_MOLDAVIA
)
504 LANG_ENTRY_END( ROMANIAN
)
505 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN
)
506 LANG_SUB_ENTRY( "RU", RUSSIAN
, RUSSIAN
)
507 LANG_SUB_ENTRY( "MD", RUSSIAN
, RUSSIAN_MOLDAVIA
)
508 LANG_ENTRY_END( RUSSIAN
)
509 /*x1a*/ if (!strcmp(lang
,"sh") || !strcmp(lang
,"hr") || !strcmp(lang
,"sr")) {
511 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, NEUTRAL
)
512 if (!strcmp(charset
,"ISO-8859-5"))
513 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN
)
514 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN
, CROATIAN
)
515 if (!strcmp(country
,"YU") && !strcmp(charset
,"ISO-8859-2"))
516 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
517 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN
, SERBIAN
)
518 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
520 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK
)
521 LANG_ENTRY_END( SLOVAK
)
522 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN
)
523 LANG_ENTRY_END( ALBANIAN
)
524 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH
)
525 LANG_SUB_ENTRY( "SE", SWEDISH
, SWEDISH
)
526 LANG_SUB_ENTRY( "FI", SWEDISH
, SWEDISH_FINLAND
)
527 LANG_ENTRY_END( SWEDISH
)
528 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI
)
529 LANG_ENTRY_END( THAI
)
530 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH
)
531 LANG_ENTRY_END( TURKISH
)
532 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU
)
533 LANG_ENTRY_END( URDU
)
534 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN
)
535 LANG_ENTRY_END( INDONESIAN
)
536 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN
)
537 LANG_ENTRY_END( UKRAINIAN
)
538 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN
)
539 LANG_ENTRY_END( BYELORUSSIAN
)
540 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN
)
541 LANG_ENTRY_END( SLOVENIAN
)
542 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN
)
543 LANG_ENTRY_END( ESTONIAN
)
544 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN
)
545 LANG_ENTRY_END( LATVIAN
)
546 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN
)
547 /* traditional sorting ? */
548 if (!strcmp(dialect
,"classic") || !strcmp(dialect
,"traditional"))
549 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN_CLASSIC
)
551 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN
)
552 LANG_ENTRY_END( LITHUANIAN
)
553 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI
)
554 LANG_ENTRY_END( MAORI
)
555 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI
)
556 LANG_ENTRY_END( FARSI
)
557 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE
)
558 LANG_ENTRY_END( VIETNAMESE
)
559 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN
)
560 LANG_ENTRY_END( ARMENIAN
)
561 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI
)
563 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
564 LANG_DIALECT_ENTRY( AZERI
, AZERI_CYRILLIC
)
566 LANG_DIALECT_ENTRY( AZERI
, AZERI
)
567 LANG_ENTRY_END( AZERI
)
568 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE
)
569 LANG_ENTRY_END( BASQUE
)
570 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
571 LANG_ENTRY_END( SORBIAN ) */
572 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN
)
573 LANG_ENTRY_END( MACEDONIAN
)
574 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
575 LANG_ENTRY_END( SUTU ) */
576 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA
)
577 LANG_ENTRY_END( TSONGA
)
578 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
579 LANG_ENTRY_END( TSWANA ) */
580 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
581 LANG_ENTRY_END( VENDA ) */
582 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA
)
583 LANG_ENTRY_END( XHOSA
)
584 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU
)
585 LANG_ENTRY_END( ZULU
)
586 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS
)
587 LANG_ENTRY_END( AFRIKAANS
)
588 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN
)
589 LANG_ENTRY_END( GEORGIAN
)
590 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE
)
591 LANG_ENTRY_END( FAEROESE
)
592 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI
)
593 LANG_ENTRY_END( HINDI
)
594 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE
)
595 LANG_ENTRY_END( MALTESE
)
596 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
597 LANG_ENTRY_END( SAAMI ) */
598 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC
)
599 LANG_DIALECT_ENTRY( GAELIC
, GAELIC
)
600 LANG_ENTRY_END( GAELIC
)
601 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC
)
602 LANG_DIALECT_ENTRY( GAELIC
, GAELIC_SCOTTISH
)
603 LANG_ENTRY_END( GAELIC
)
605 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY
)
606 LANG_SUB_ENTRY( "MY", MALAY
, MALAY
)
607 LANG_SUB_ENTRY( "BN", MALAY
, MALAY_BRUNEI_DARUSSALAM
)
608 LANG_ENTRY_END( MALAY
)
609 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH
)
610 LANG_ENTRY_END( KAZAKH
)
612 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI
)
613 LANG_ENTRY_END( SWAHILI
)
615 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK
)
617 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
618 LANG_DIALECT_ENTRY( UZBEK
, UZBEK_CYRILLIC
)
620 LANG_DIALECT_ENTRY( UZBEK
, UZBEK
)
621 LANG_ENTRY_END( UZBEK
)
622 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR
)
623 LANG_ENTRY_END( TATAR
)
624 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI
)
625 LANG_ENTRY_END( BENGALI
)
626 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI
)
627 LANG_ENTRY_END( PUNJABI
)
628 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI
)
629 LANG_ENTRY_END( GUJARATI
)
630 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA
)
631 LANG_ENTRY_END( ORIYA
)
632 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL
)
633 LANG_ENTRY_END( TAMIL
)
634 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU
)
635 LANG_ENTRY_END( TELUGU
)
636 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA
)
637 LANG_ENTRY_END( KANNADA
)
638 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM
)
639 LANG_ENTRY_END( MALAYALAM
)
640 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE
)
641 LANG_ENTRY_END( ASSAMESE
)
642 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI
)
643 LANG_ENTRY_END( MARATHI
)
644 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT
)
645 LANG_ENTRY_END( SANSKRIT
)
647 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
648 LANG_ENTRY_END( KONKANI ) */
650 LANG_ENTRY_BEGIN( "eo", ESPERANTO
) /* not official */
651 LANG_ENTRY_END( ESPERANTO
)
655 end_MAIN_GetLanguageID
:
656 if (Charset
) free(charset
);
662 /***********************************************************************
663 * MAIN_ParseLanguageOption
665 * Parse -language option.
667 void MAIN_ParseLanguageOption( char *arg
)
669 const WINE_LANGUAGE_DEF
*p
= Languages
;
671 /* for compatibility whith non-iso names previously used */
672 if (!strcmp("Sw",arg
)) { strcpy(arg
,"Sv"); FIXME(system
,"use 'Sv' instead of 'Sw'\n");}
673 if (!strcmp("Cz",arg
)) { strcpy(arg
,"Cs"); FIXME(system
,"use 'Cs' instead of 'Cz'\n");}
674 if (!strcmp("Po",arg
)) { strcpy(arg
,"Pt"); FIXME(system
,"use 'Pt' instead of 'Po'\n");}
676 Options
.language
= LANG_Xx
; /* First (dummy) language */
679 if (!lstrcmpiA( p
->name
, arg
))
681 WINE_LanguageId
= p
->langid
;
686 MSG( "Invalid language specified '%s'. Supported languages are: ", arg
);
687 for (p
= Languages
; p
->name
; p
++) MSG( "%s ", p
->name
);
693 /***********************************************************************
694 * MAIN_ParseModeOption
696 * Parse -mode option.
698 void MAIN_ParseModeOption( char *arg
)
700 if (!lstrcmpiA("enhanced", arg
)) Options
.mode
= MODE_ENHANCED
;
701 else if (!lstrcmpiA("standard", arg
)) Options
.mode
= MODE_STANDARD
;
704 MSG( "Invalid mode '%s' specified.\n", arg
);
705 MSG( "Valid modes are: 'standard', 'enhanced' (default).\n");
710 /***********************************************************************
713 * Parse command line options and open display.
715 static void MAIN_ParseOptions( int *argc
, char *argv
[] )
722 Options
.programName
= MAIN_GetProgramName( *argc
, argv
);
723 Options
.argv0
= argv
[0];
725 /* initialise Options.language to 0 to tell "no language choosen yet" */
726 Options
.language
= 0;
728 /* make sure there is no "." in Options.programName to confuse the X
729 resource database lookups */
730 if ((pcDot
= strchr(Options
.programName
, '.'))) *pcDot
= '\0';
732 for (i
= 1; i
< *argc
; i
++)
734 if (!strcmp( argv
[i
], "-v" ) || !strcmp( argv
[i
], "-version" ))
736 MSG( "%s\n", WINE_RELEASE_INFO
);
739 if (!strcmp( argv
[i
], "-h" ) || !strcmp( argv
[i
], "-help" ))
746 #ifndef X_DISPLAY_MISSING
747 X11DRV_MAIN_ParseOptions(argc
,argv
);
748 #else /* X_DISPLAY_MISSING */
749 TTYDRV_MAIN_ParseOptions(argc
,argv
);
750 #endif /* X_DISPLAY_MISSING */
753 /***********************************************************************
756 static void called_at_exit(void)
758 #ifndef X_DISPLAY_MISSING
759 X11DRV_MAIN_RestoreSetup();
760 #else /* X_DISPLAY_MISSING */
761 TTYDRV_MAIN_RestoreSetup();
762 #endif /* X_DISPLAY_MISSING */
765 /* FIXME: should check for other processes or threads */
766 DeleteCriticalSection( HEAP_SystemLock
);
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 atexit(called_at_exit
);
824 /***********************************************************************
825 * MessageBeep16 (USER.104)
827 void WINAPI
MessageBeep16( UINT16 i
)
833 /***********************************************************************
834 * MessageBeep32 (USER32.390)
836 BOOL WINAPI
MessageBeep( UINT i
)
838 TSXBell( display
, 0 );
843 /***********************************************************************
846 BOOL WINAPI
Beep( DWORD dwFreq
, DWORD dwDur
)
848 /* dwFreq and dwDur are ignored by Win95 */
854 /***********************************************************************
855 * GetTimerResolution (USER.14)
857 LONG WINAPI
GetTimerResolution16(void)
862 /***********************************************************************
863 * SystemParametersInfo32A (USER32.540)
865 BOOL WINAPI
SystemParametersInfoA( UINT uAction
, UINT uParam
,
866 LPVOID lpvParam
, UINT fuWinIni
)
870 XKeyboardState keyboard_state
;
874 TSXGetKeyboardControl(display
, &keyboard_state
);
875 if (keyboard_state
.bell_percent
== 0)
876 *(BOOL
*) lpvParam
= FALSE
;
878 *(BOOL
*) lpvParam
= TRUE
;
882 *(INT
*)lpvParam
= GetSystemMetrics( SM_CXFRAME
);
885 case SPI_GETDRAGFULLWINDOWS
:
886 *(BOOL
*) lpvParam
= FALSE
;
889 case SPI_SETDRAGFULLWINDOWS
:
892 case SPI_GETFASTTASKSWITCH
:
893 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
894 *(BOOL
*) lpvParam
= TRUE
;
896 *(BOOL
*) lpvParam
= FALSE
;
899 case SPI_GETGRIDGRANULARITY
:
900 *(INT
*)lpvParam
=GetProfileIntA("desktop","GridGranularity",1);
903 case SPI_GETICONTITLEWRAP
:
904 *(BOOL
*)lpvParam
=GetProfileIntA("desktop","IconTitleWrap",TRUE
);
907 case SPI_GETKEYBOARDDELAY
:
908 *(INT
*)lpvParam
=GetProfileIntA("keyboard","KeyboardDelay",1);
911 case SPI_GETKEYBOARDSPEED
:
912 *(DWORD
*)lpvParam
=GetProfileIntA("keyboard","KeyboardSpeed",30);
915 case SPI_GETMENUDROPALIGNMENT
:
916 *(BOOL
*)lpvParam
=GetSystemMetrics(SM_MENUDROPALIGNMENT
); /* XXX check this */
919 case SPI_GETSCREENSAVEACTIVE
:
920 if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
921 *(BOOL
*)lpvParam
= TRUE
;
923 *(BOOL
*)lpvParam
= FALSE
;
926 case SPI_GETSCREENSAVETIMEOUT
:
927 #ifndef X_DISPLAY_MISSING
928 TSXGetScreenSaver(display
, &timeout
, &temp
,&temp
,&temp
);
929 #else /* X_DISPLAY_MISSING */
930 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
931 #endif /* X_DISPLAY_MISSING */
932 *(INT
*) lpvParam
= timeout
* 1000;
935 case SPI_ICONHORIZONTALSPACING
:
936 /* FIXME Get/SetProfileInt */
937 if (lpvParam
== NULL
)
938 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
940 *(INT
*)lpvParam
=GetSystemMetrics(SM_CXICONSPACING
);
943 case SPI_ICONVERTICALSPACING
:
944 /* FIXME Get/SetProfileInt */
945 if (lpvParam
== NULL
)
946 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
948 *(INT
*)lpvParam
=GetSystemMetrics(SM_CYICONSPACING
);
951 case SPI_GETICONTITLELOGFONT
: {
952 LPLOGFONTA lpLogFont
= (LPLOGFONTA
)lpvParam
;
954 /* from now on we always have an alias for MS Sans Serif */
956 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
957 lpLogFont
->lfFaceName
, LF_FACESIZE
);
958 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 8);
959 lpLogFont
->lfWidth
= 0;
960 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
961 lpLogFont
->lfWeight
= FW_NORMAL
;
962 lpLogFont
->lfItalic
= FALSE
;
963 lpLogFont
->lfStrikeOut
= FALSE
;
964 lpLogFont
->lfUnderline
= FALSE
;
965 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
966 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
967 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
968 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
971 case SPI_GETWORKAREA
:
972 SetRect( (RECT
*)lpvParam
, 0, 0,
973 GetSystemMetrics( SM_CXSCREEN
),
974 GetSystemMetrics( SM_CYSCREEN
)
977 case SPI_GETNONCLIENTMETRICS
:
979 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
981 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICSA
) )
983 /* FIXME: initialize geometry entries */
985 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
986 (LPVOID
)&(lpnm
->lfCaptionFont
),0);
987 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
988 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
989 (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
990 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
991 (LPVOID
)&(lpnm
->lfMenuFont
),0);
992 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
993 (LPVOID
)&(lpnm
->lfStatusFont
),0);
994 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
995 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1000 case SPI_GETANIMATION
: {
1001 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1003 /* Tell it "disabled" */
1004 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1005 uParam
= sizeof(ANIMATIONINFO
);
1006 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1010 case SPI_SETANIMATION
: {
1011 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1014 WARN(system
, "SPI_SETANIMATION ignored.\n");
1015 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1016 uParam
= sizeof(ANIMATIONINFO
);
1020 case SPI_GETHIGHCONTRAST
:
1022 LPHIGHCONTRASTA lpHighContrastA
= (LPHIGHCONTRASTA
)lpvParam
;
1024 FIXME(system
,"SPI_GETHIGHCONTRAST not fully implemented\n");
1026 if ( lpHighContrastA
->cbSize
== sizeof( HIGHCONTRASTA
) )
1028 /* Indicate that there is no high contrast available */
1029 lpHighContrastA
->dwFlags
= 0;
1030 lpHighContrastA
->lpszDefaultScheme
= NULL
;
1041 return SystemParametersInfo16(uAction
,uParam
,lpvParam
,fuWinIni
);
1047 /***********************************************************************
1048 * SystemParametersInfo16 (USER.483)
1050 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
1051 LPVOID lpvParam
, UINT16 fuWinIni
)
1056 XKeyboardState keyboard_state
;
1057 XKeyboardControl keyboard_value
;
1062 TSXGetKeyboardControl(display
, &keyboard_state
);
1063 if (keyboard_state
.bell_percent
== 0)
1064 *(BOOL16
*) lpvParam
= FALSE
;
1066 *(BOOL16
*) lpvParam
= TRUE
;
1070 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXFRAME
);
1073 case SPI_GETFASTTASKSWITCH
:
1074 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1075 *(BOOL16
*) lpvParam
= TRUE
;
1077 *(BOOL16
*) lpvParam
= FALSE
;
1080 case SPI_GETGRIDGRANULARITY
:
1081 *(INT16
*) lpvParam
= GetProfileIntA( "desktop",
1086 case SPI_GETICONTITLEWRAP
:
1087 *(BOOL16
*) lpvParam
= GetProfileIntA( "desktop",
1092 case SPI_GETKEYBOARDDELAY
:
1093 *(INT16
*) lpvParam
= GetProfileIntA( "keyboard",
1094 "KeyboardDelay", 1 );
1097 case SPI_GETKEYBOARDSPEED
:
1098 *(WORD
*) lpvParam
= GetProfileIntA( "keyboard",
1103 case SPI_GETMENUDROPALIGNMENT
:
1104 *(BOOL16
*) lpvParam
= GetSystemMetrics16( SM_MENUDROPALIGNMENT
); /* XXX check this */
1107 case SPI_GETSCREENSAVEACTIVE
:
1108 if ( GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1 )
1109 *(BOOL16
*) lpvParam
= TRUE
;
1111 *(BOOL16
*) lpvParam
= FALSE
;
1114 case SPI_GETSCREENSAVETIMEOUT
:
1115 #ifndef X_DISPLAY_MISSING
1116 TSXGetScreenSaver(display
, &timeout
, &temp
,&temp
,&temp
);
1117 #else /* X_DISPLAY_MISSING */
1118 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1119 #endif /* X_DISPLAY_MISSING */
1120 *(INT16
*) lpvParam
= timeout
;
1123 case SPI_ICONHORIZONTALSPACING
:
1124 /* FIXME Get/SetProfileInt */
1125 if (lpvParam
== NULL
)
1126 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1128 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXICONSPACING
);
1131 case SPI_ICONVERTICALSPACING
:
1132 /* FIXME Get/SetProfileInt */
1133 if (lpvParam
== NULL
)
1134 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1136 *(INT16
*)lpvParam
= GetSystemMetrics16(SM_CYICONSPACING
);
1141 keyboard_value
.bell_percent
= -1;
1143 keyboard_value
.bell_percent
= 0;
1144 TSXChangeKeyboardControl(display
, KBBellPercent
,
1148 case SPI_SETSCREENSAVEACTIVE
:
1150 TSXActivateScreenSaver(display
);
1152 TSXResetScreenSaver(display
);
1155 case SPI_SETSCREENSAVETIMEOUT
:
1156 TSXSetScreenSaver(display
, uParam
, 60, DefaultBlanking
,
1160 case SPI_SETDESKWALLPAPER
:
1161 return (SetDeskWallPaper((LPSTR
) lpvParam
));
1164 case SPI_SETDESKPATTERN
:
1165 if ((INT16
)uParam
== -1) {
1166 GetProfileStringA("Desktop", "Pattern",
1167 "170 85 170 85 170 85 170 85",
1168 buffer
, sizeof(buffer
) );
1169 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1171 return (DESKTOP_SetPattern((LPSTR
) lpvParam
));
1174 case SPI_GETICONTITLELOGFONT
:
1176 LPLOGFONT16 lpLogFont
= (LPLOGFONT16
)lpvParam
;
1178 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1179 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1180 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 8);
1181 lpLogFont
->lfWidth
= 0;
1182 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1183 lpLogFont
->lfWeight
= FW_NORMAL
;
1184 lpLogFont
->lfItalic
= FALSE
;
1185 lpLogFont
->lfStrikeOut
= FALSE
;
1186 lpLogFont
->lfUnderline
= FALSE
;
1187 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1188 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1189 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1190 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1193 case SPI_GETNONCLIENTMETRICS
:
1195 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1196 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICS16
) )
1198 /* FIXME: initialize geometry entries */
1199 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1200 (LPVOID
)&(lpnm
->lfCaptionFont
),0);
1201 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1202 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1203 (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1204 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1205 (LPVOID
)&(lpnm
->lfMenuFont
),0);
1206 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1207 (LPVOID
)&(lpnm
->lfStatusFont
),0);
1208 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1209 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1211 else /* winfile 95 sets sbSize to 340 */
1212 SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
1216 case SPI_LANGDRIVER
:
1218 case SPI_SETDOUBLECLKHEIGHT
:
1219 case SPI_SETDOUBLECLICKTIME
:
1220 case SPI_SETDOUBLECLKWIDTH
:
1221 case SPI_SETFASTTASKSWITCH
:
1222 case SPI_SETKEYBOARDDELAY
:
1223 case SPI_SETKEYBOARDSPEED
:
1224 WARN(system
, "Option %d ignored.\n", uAction
);
1227 case SPI_GETWORKAREA
:
1228 SetRect16( (RECT16
*)lpvParam
, 0, 0,
1229 GetSystemMetrics16( SM_CXSCREEN
),
1230 GetSystemMetrics16( SM_CYSCREEN
) );
1234 WARN(system
, "Unknown option %d.\n", uAction
);
1240 /***********************************************************************
1241 * SystemParametersInfo32W (USER32.541)
1243 BOOL WINAPI
SystemParametersInfoW( UINT uAction
, UINT uParam
,
1244 LPVOID lpvParam
, UINT fuWinIni
)
1250 case SPI_SETDESKWALLPAPER
:
1253 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1254 return SetDeskWallPaper(buffer
);
1256 return SetDeskWallPaper(NULL
);
1258 case SPI_SETDESKPATTERN
:
1259 if ((INT
) uParam
== -1)
1261 GetProfileStringA("Desktop", "Pattern",
1262 "170 85 170 85 170 85 170 85",
1263 buffer
, sizeof(buffer
) );
1264 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1268 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1269 return DESKTOP_SetPattern(buffer
);
1271 return DESKTOP_SetPattern(NULL
);
1273 case SPI_GETICONTITLELOGFONT
:
1275 LPLOGFONTW lpLogFont
= (LPLOGFONTW
)lpvParam
;
1276 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1277 buffer
, sizeof(buffer
) );
1278 lstrcpynAtoW(lpLogFont
->lfFaceName
, buffer
,LF_FACESIZE
);
1279 lpLogFont
->lfHeight
= 10;
1280 lpLogFont
->lfWidth
= 0;
1281 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1282 lpLogFont
->lfWeight
= FW_NORMAL
;
1283 lpLogFont
->lfItalic
= lpLogFont
->lfStrikeOut
= lpLogFont
->lfUnderline
= FALSE
;
1284 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1285 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1286 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1287 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1290 case SPI_GETNONCLIENTMETRICS
: {
1291 /* FIXME: implement correctly */
1292 LPNONCLIENTMETRICSW lpnm
=(LPNONCLIENTMETRICSW
)lpvParam
;
1294 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfCaptionFont
),0);
1295 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1296 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1297 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMenuFont
),0);
1298 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfStatusFont
),0);
1299 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMessageFont
),0);
1303 case SPI_GETHIGHCONTRAST
:
1305 LPHIGHCONTRASTW lpHighContrastW
= (LPHIGHCONTRASTW
)lpvParam
;
1307 FIXME(system
,"SPI_GETHIGHCONTRAST not fully implemented\n");
1309 if ( lpHighContrastW
->cbSize
== sizeof( HIGHCONTRASTW
) )
1311 /* Indicate that there is no high contrast available */
1312 lpHighContrastW
->dwFlags
= 0;
1313 lpHighContrastW
->lpszDefaultScheme
= NULL
;
1324 return SystemParametersInfoA(uAction
,uParam
,lpvParam
,fuWinIni
);
1331 /***********************************************************************
1332 * FileCDR (KERNEL.130)
1334 FARPROC16 WINAPI
FileCDR16(FARPROC16 x
)
1336 FIXME(file
,"(0x%8x): stub\n", (int) x
);
1337 return (FARPROC16
)TRUE
;