4 * Copyright 1994 Alexandre Julliard
6 static char Copyright[] = "Copyright Alexandre Julliard, 1994";
13 #ifdef MALLOC_DEBUGGING
17 #include <X11/Xresource.h>
18 #include <X11/Xutil.h>
19 #include <X11/cursorfont.h>
29 #include "prototypes.h"
33 #define DEBUG_DEFINE_VARIABLES
37 extern ButtonTexts ButtonText
;
39 static const char people
[] = "Wine is available thanks to the work of "\
40 "Bob Amstadt, Dag Asheim, Martin Ayotte, Erik Bos, John Brezak, "\
41 "Andrew Bulhak, John Burton, Paul Falstad, Peter Galbavy, Jeffrey Hsu, "\
42 "Miguel de Icaza, Alexandre Julliard, Jon Konrath, Scott A. Laird, "\
43 "Martin von Loewis, Kenneth MacDonald, Peter MacDonald, David Metcalfe, "\
44 "Michael Patra, John Richardson, Johannes Ruscheinski, Yngvi Sigurjonsson, "\
45 "Rick Sladkey, William Smith, Jon Tombs, Linus Torvalds, Carl Williams, "\
46 "Karl Guenter Wuensch, and Eric Youngdale.";
48 #define WINE_CLASS "Wine" /* Class name for resources */
50 typedef struct tagENVENTRY
{
54 struct tagENVENTRY
*Prev
;
55 struct tagENVENTRY
*Next
;
57 typedef ENVENTRY
*LPENVENTRY
;
59 LPENVENTRY lpEnvList
= NULL
;
64 int screenWidth
= 0, screenHeight
= 0; /* Desktop window dimensions */
65 int screenDepth
= 0; /* Screen depth to use */
66 int desktopX
= 0, desktopY
= 0; /* Desktop window position (if any) */
68 struct options Options
=
69 { /* default options */
70 NULL
, /* spyFilename */
71 NULL
, /* desktopGeometry */
72 NULL
, /* programName */
73 FALSE
, /* usePrivateMap */
74 FALSE
, /* synchronous */
75 FALSE
, /* backing store */
76 SW_SHOWNORMAL
, /* cmdShow */
78 FALSE
/* AllowReadOnly */
82 static XrmOptionDescRec optionsTable
[] =
84 { "-backingstore", ".backingstore", XrmoptionNoArg
, (caddr_t
)"on" },
85 { "-desktop", ".desktop", XrmoptionSepArg
, (caddr_t
)NULL
},
86 { "-depth", ".depth", XrmoptionSepArg
, (caddr_t
)NULL
},
87 { "-display", ".display", XrmoptionSepArg
, (caddr_t
)NULL
},
88 { "-iconic", ".iconic", XrmoptionNoArg
, (caddr_t
)"on" },
89 { "-name", ".name", XrmoptionSepArg
, (caddr_t
)NULL
},
90 { "-privatemap", ".privatemap", XrmoptionNoArg
, (caddr_t
)"on" },
91 { "-synchronous", ".synchronous", XrmoptionNoArg
, (caddr_t
)"on" },
92 { "-spy", ".spy", XrmoptionSepArg
, (caddr_t
)NULL
},
93 { "-debug", ".debug", XrmoptionNoArg
, (caddr_t
)"on" },
94 { "-debugmsg", ".debugmsg", XrmoptionSepArg
, (caddr_t
)NULL
},
95 { "-dll", ".dll", XrmoptionSepArg
, (caddr_t
)NULL
},
96 { "-allowreadonly", ".allowreadonly", XrmoptionNoArg
, (caddr_t
)"on" }
99 #define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
102 "Usage: %s [options] program_name [arguments]\n" \
105 " -depth n Change the depth to use for multiple-depth screens\n" \
106 " -desktop geom Use a desktop window of the given geometry\n" \
107 " -display name Use the specified display\n" \
108 " -iconic Start as an icon\n" \
109 " -debug Enter debugger before starting application\n" \
110 " -name name Set the application name\n" \
111 " -privatemap Use a private color map\n" \
112 " -synchronous Turn on synchronous display mode\n" \
113 " -backingstore Turn on backing store\n" \
114 " -spy file Turn on message spying to the specified file\n" \
115 " -relaydbg Obsolete. Use -debugmsg +relay instead\n" \
116 " -debugmsg name Turn debugging-messages on or off\n" \
117 " -dll name Enable or disable built-in DLLs\n" \
118 " -allowreadonly Read only files may be opened in write mode\n"
122 /***********************************************************************
125 static void MAIN_Usage( char *name
)
127 fprintf( stderr
, USAGE
, name
);
132 /***********************************************************************
133 * MAIN_GetProgramName
135 * Get the program name. The name is specified by (in order of precedence):
136 * - the option '-name'.
137 * - the environment variable 'WINE_NAME'.
138 * - the last component of argv[0].
140 static char *MAIN_GetProgramName( int argc
, char *argv
[] )
145 for (i
= 1; i
< argc
-1; i
++)
146 if (!strcmp( argv
[i
], "-name" )) return argv
[i
+1];
147 if ((p
= getenv( "WINE_NAME" )) != NULL
) return p
;
148 if ((p
= strrchr( argv
[0], '/' )) != NULL
) return p
+1;
153 /***********************************************************************
156 * Fetch the value of resource 'name' using the correct instance name.
157 * 'name' must begin with '.' or '*'
159 static int MAIN_GetResource( XrmDatabase db
, char *name
, XrmValue
*value
)
161 char *buff_instance
, *buff_class
;
165 buff_instance
= (char *)malloc(strlen(Options
.programName
)+strlen(name
)+1);
166 buff_class
= (char *)malloc( strlen(WINE_CLASS
) + strlen(name
) + 1 );
168 strcpy( buff_instance
, Options
.programName
);
169 strcat( buff_instance
, name
);
170 strcpy( buff_class
, WINE_CLASS
);
171 strcat( buff_class
, name
);
172 retval
= XrmGetResource( db
, buff_instance
, buff_class
, &dummy
, value
);
173 free( buff_instance
);
179 /***********************************************************************
182 * Fetch the value of resource 'name' using the correct instance name.
183 * 'name' must begin with '.' or '*'
185 * The address of the string got from the XResoure is stored in Button.Label.
186 * The corresponding hotkey is taken from this string.
189 static void MAIN_GetButtonText( XrmDatabase db
, char *name
, ButtonDesc
*Button
)
194 if (MAIN_GetResource( db
, name
, &value
))
196 Button
->Label
= value
.addr
;
197 i
= strchr(Button
->Label
,'&');
199 Button
->Hotkey
= '\0';
200 else if ( i
++ == '\0' )
201 Button
->Hotkey
= '\0';
205 Button
->Hotkey
= toupper(Button
->Hotkey
);
208 /***********************************************************************
209 * MAIN_GetAllButtonTexts
211 * Read all Button-labels from X11-resources if they exist.
214 static void MAIN_GetAllButtonTexts(XrmDatabase db
)
216 MAIN_GetButtonText(db
, ".YesLabel", &ButtonText
.Yes
);
217 MAIN_GetButtonText(db
, ".NoLabel", &ButtonText
.No
);
218 MAIN_GetButtonText(db
, ".OkLabel", &ButtonText
.Ok
);
219 MAIN_GetButtonText(db
, ".CancelLabel", &ButtonText
.Cancel
);
220 MAIN_GetButtonText(db
, ".AbortLabel", &ButtonText
.Abort
);
221 MAIN_GetButtonText(db
, ".RetryLabel", &ButtonText
.Retry
);
222 MAIN_GetButtonText(db
, ".IgnoreLabel", &ButtonText
.Ignore
);
223 MAIN_GetButtonText(db
, ".CancelLabel", &ButtonText
.Cancel
);
226 /***********************************************************************
229 * Turns specific debug messages on or off, according to "options".
230 * Returns TRUE if parsing was successfull
234 BOOL
ParseDebugOptions(char *options
)
237 if (strlen(options
)<3)
241 if ((*options
!='+')&&(*options
!='-'))
243 if (strchr(options
,','))
244 l
=strchr(options
,',')-options
;
247 if (!strncasecmp(options
+1,"all",l
-1))
250 for (i
=0;i
<sizeof(debug_msg_enabled
)/sizeof(short);i
++)
251 debug_msg_enabled
[i
]=(*options
=='+');
256 for (i
=0;i
<sizeof(debug_msg_enabled
)/sizeof(short);i
++)
257 if (debug_msg_name
&& (!strncasecmp(options
+1,debug_msg_name
[i
],l
-1)))
259 debug_msg_enabled
[i
]=(*options
=='+');
262 if (i
==sizeof(debug_msg_enabled
)/sizeof(short))
267 while((*options
==',')&&(*(++options
)));
276 /***********************************************************************
277 * MAIN_ParseDLLOptions
279 * Set runtime DLL usage flags
281 static BOOL
MAIN_ParseDLLOptions(char *options
)
285 if (strlen(options
)<3)
289 if ((*options
!='+')&&(*options
!='-'))
291 if (strchr(options
,','))
292 l
=strchr(options
,',')-options
;
293 else l
=strlen(options
);
294 for (i
=0;i
<N_BUILTINS
;i
++)
295 if (!strncasecmp(options
+1,dll_builtin_table
[i
].dll_name
,l
-1))
297 dll_builtin_table
[i
].dll_is_used
=(*options
=='+');
304 while((*options
==',')&&(*(++options
)));
313 /***********************************************************************
316 * Parse command line options and open display.
318 static void MAIN_ParseOptions( int *argc
, char *argv
[] )
322 XrmDatabase db
= XrmGetFileDatabase("/usr/lib/X11/app-defaults/Wine");
324 /* Parse command line */
325 Options
.programName
= MAIN_GetProgramName( *argc
, argv
);
326 XrmParseCommand( &db
, optionsTable
, NB_OPTIONS
,
327 Options
.programName
, argc
, argv
);
330 /* Need to assemble command line and pass it to WinMain */
332 if (*argc
< 2 || strcasecmp(argv
[1], "-h") == 0)
333 MAIN_Usage( argv
[0] );
338 if (MAIN_GetResource( db
, ".display", &value
)) display_name
= value
.addr
;
339 else display_name
= NULL
;
341 if (!(display
= XOpenDisplay( display_name
)))
343 fprintf( stderr
, "%s: Can't open display: %s\n",
344 argv
[0], display_name
? display_name
: "" );
348 /* Get all options */
349 if (MAIN_GetResource( db
, ".iconic", &value
))
350 Options
.cmdShow
= SW_SHOWMINIMIZED
;
351 if (MAIN_GetResource( db
, ".privatemap", &value
))
352 Options
.usePrivateMap
= TRUE
;
353 if (MAIN_GetResource( db
, ".synchronous", &value
))
354 Options
.synchronous
= TRUE
;
355 if (MAIN_GetResource( db
, ".backingstore", &value
))
356 Options
.backingstore
= TRUE
;
357 if (MAIN_GetResource( db
, ".debug", &value
))
358 Options
.debug
= TRUE
;
359 if (MAIN_GetResource( db
, ".allowreadonly", &value
))
360 Options
.allowReadOnly
= TRUE
;
361 if (MAIN_GetResource( db
, ".spy", &value
))
362 Options
.spyFilename
= value
.addr
;
363 if (MAIN_GetResource( db
, ".depth", &value
))
364 screenDepth
= atoi( value
.addr
);
365 if (MAIN_GetResource( db
, ".desktop", &value
))
366 Options
.desktopGeometry
= value
.addr
;
368 if (MAIN_GetResource( db
, ".debugoptions", &value
))
369 ParseDebugOptions((char*)value
.addr
);
371 if (MAIN_GetResource( db
, ".debugmsg", &value
))
373 #ifndef DEBUG_RUNTIME
374 fprintf(stderr
,"%s: Option \"-debugmsg\" not implemented.\n" \
375 " Recompile with DEBUG_RUNTIME in include/stddebug.h defined.\n",
379 if (ParseDebugOptions((char*)value
.addr
)==FALSE
)
382 fprintf(stderr
,"%s: Syntax: -debugmsg +xxx,... or -debugmsg -xxx,...\n",argv
[0]);
383 fprintf(stderr
,"Example: -debugmsg +all,-heap turn on all messages except heap messages\n");
384 fprintf(stderr
,"Available message types:\n");
385 fprintf(stderr
,"%-9s ","all");
386 for(i
=0;i
<sizeof(debug_msg_enabled
)/sizeof(short);i
++)
387 if(debug_msg_name
[i
])
388 fprintf(stderr
,"%-9s%c",debug_msg_name
[i
],
389 (((i
+2)%8==0)?'\n':' '));
390 fprintf(stderr
,"\n\n");
396 if(MAIN_GetResource( db
, ".dll", &value
))
397 if(MAIN_ParseDLLOptions((char*)value
.addr
)==FALSE
)
400 fprintf(stderr
,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv
[0]);
401 fprintf(stderr
,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
402 fprintf(stderr
,"Available DLLs\n");
403 for(i
=0;i
<N_BUILTINS
;i
++)
404 fprintf(stderr
,"%-9s%c",dll_builtin_table
[i
].dll_name
,
405 (((i
+2)%8==0)?'\n':' '));
406 fprintf(stderr
,"\n\n");
410 /* MAIN_GetAllButtonTexts(db); */
415 /***********************************************************************
418 static void MAIN_CreateDesktop( int argc
, char *argv
[] )
421 unsigned int width
= 640, height
= 480; /* Default size = 640x480 */
422 char *name
= "Wine desktop";
423 XSizeHints
*size_hints
;
425 XClassHint
*class_hints
;
426 XSetWindowAttributes win_attr
;
427 XTextProperty window_name
;
429 flags
= XParseGeometry( Options
.desktopGeometry
,
430 &desktopX
, &desktopY
, &width
, &height
);
432 screenHeight
= height
;
436 win_attr
.event_mask
= ExposureMask
| KeyPressMask
| KeyReleaseMask
|
437 PointerMotionMask
| ButtonPressMask
|
438 ButtonReleaseMask
| EnterWindowMask
|
440 win_attr
.cursor
= XCreateFontCursor( display
, XC_top_left_arrow
);
442 rootWindow
= XCreateWindow( display
, DefaultRootWindow(display
),
443 desktopX
, desktopY
, width
, height
, 0,
444 CopyFromParent
, InputOutput
, CopyFromParent
,
445 CWEventMask
| CWCursor
, &win_attr
);
447 /* Set window manager properties */
449 size_hints
= XAllocSizeHints();
450 wm_hints
= XAllocWMHints();
451 class_hints
= XAllocClassHint();
452 if (!size_hints
|| !wm_hints
|| !class_hints
)
454 fprintf( stderr
, "Not enough memory for window manager hints.\n" );
457 size_hints
->min_width
= size_hints
->max_width
= width
;
458 size_hints
->min_height
= size_hints
->max_height
= height
;
459 size_hints
->flags
= PMinSize
| PMaxSize
;
460 if (flags
& (XValue
| YValue
)) size_hints
->flags
|= USPosition
;
461 if (flags
& (WidthValue
| HeightValue
)) size_hints
->flags
|= USSize
;
462 else size_hints
->flags
|= PSize
;
464 wm_hints
->flags
= InputHint
| StateHint
;
465 wm_hints
->input
= True
;
466 wm_hints
->initial_state
= NormalState
;
467 class_hints
->res_name
= argv
[0];
468 class_hints
->res_class
= "Wine";
470 XStringListToTextProperty( &name
, 1, &window_name
);
471 XSetWMProperties( display
, rootWindow
, &window_name
, &window_name
,
472 argv
, argc
, size_hints
, wm_hints
, class_hints
);
475 XFree( class_hints
);
479 XMapWindow( display
, rootWindow
);
483 XKeyboardState keyboard_state
;
485 /***********************************************************************
488 static void MAIN_SaveSetup(void)
490 XGetKeyboardControl(display
, &keyboard_state
);
493 /***********************************************************************
496 static void MAIN_RestoreSetup(void)
498 XKeyboardControl keyboard_value
;
500 keyboard_value
.key_click_percent
= keyboard_state
.key_click_percent
;
501 keyboard_value
.bell_percent
= keyboard_state
.bell_percent
;
502 keyboard_value
.bell_pitch
= keyboard_state
.bell_pitch
;
503 keyboard_value
.bell_duration
= keyboard_state
.bell_duration
;
504 keyboard_value
.auto_repeat_mode
= keyboard_state
.global_auto_repeat
;
506 XChangeKeyboardControl(display
, KBKeyClickPercent
| KBBellPercent
|
507 KBBellPitch
| KBBellDuration
| KBAutoRepeatMode
, &keyboard_value
);
510 static void malloc_error()
512 fprintf(stderr
,"malloc is not feeling well. Good bye\n");
516 static void called_at_exit(void)
524 /***********************************************************************
527 int main( int argc
, char *argv
[] )
533 setlocale(LC_CTYPE
,"");
537 MAIN_ParseOptions( &argc
, argv
);
539 #ifdef MALLOC_DEBUGGING
542 char *trace
=getenv("MALLOC_TRACE");
545 dprintf_malloc(stddeb
,"MALLOC_TRACE not set. No trace generated\n");
548 dprintf_malloc(stddeb
,"malloc trace goes to %s\n",trace
);
551 mcheck(malloc_error
);
555 screen
= DefaultScreenOfDisplay( display
);
556 screenWidth
= WidthOfScreen( screen
);
557 screenHeight
= HeightOfScreen( screen
);
558 if (screenDepth
) /* -depth option specified */
560 depth_list
= XListDepths(display
,DefaultScreen(display
),&depth_count
);
561 for (i
= 0; i
< depth_count
; i
++)
562 if (depth_list
[i
] == screenDepth
) break;
564 if (i
>= depth_count
)
566 fprintf( stderr
, "%s: Depth %d not supported on this screen.\n",
567 Options
.programName
, screenDepth
);
571 else screenDepth
= DefaultDepthOfScreen( screen
);
572 if (Options
.synchronous
) XSynchronize( display
, True
);
573 if (Options
.desktopGeometry
) MAIN_CreateDesktop( argc
, argv
);
574 else rootWindow
= DefaultRootWindow( display
);
583 atexit(called_at_exit
);
585 on_exit (called_at_exit
, 0);
588 ret_val
= _WinMain( argc
, argv
);
593 /***********************************************************************
594 * MessageBeep (USER.104)
596 void MessageBeep(WORD i
)
601 /***********************************************************************
602 * GetVersion (KERNEL.3)
604 LONG
GetVersion(void)
606 return( 0x03300a03 ); /* dos 3.30 & win 3.10 */
609 /***********************************************************************
610 * GetWinFlags (KERNEL.132)
612 LONG
GetWinFlags(void)
614 return (WF_STANDARD
| WF_CPU286
| WF_PMODE
| WF_80x87
);
617 /***********************************************************************
618 * SetEnvironment (GDI.132)
620 int SetEnvironment(LPSTR lpPortName
, LPSTR lpEnviron
, WORD nCount
)
623 LPENVENTRY lpEnv
= lpEnvList
;
624 printf("SetEnvironnement('%s', '%s', %d) !\n",
625 lpPortName
, lpEnviron
, nCount
);
626 if (lpPortName
== NULL
) return -1;
627 while (lpEnv
!= NULL
) {
628 if (lpEnv
->Name
!= NULL
&& strcmp(lpEnv
->Name
, lpPortName
) == 0) {
629 if (nCount
== 0 || lpEnviron
== NULL
) {
630 if (lpEnv
->Prev
!= NULL
) lpEnv
->Prev
->Next
= lpEnv
->Next
;
631 if (lpEnv
->Next
!= NULL
) lpEnv
->Next
->Prev
= lpEnv
->Prev
;
635 printf("SetEnvironnement() // entry deleted !\n");
639 lpEnv
->Value
= malloc(nCount
);
640 if (lpEnv
->Value
== NULL
) {
641 printf("SetEnvironment() // Error allocating entry value !\n");
644 memcpy(lpEnv
->Value
, lpEnviron
, nCount
);
645 lpEnv
->wSize
= nCount
;
646 printf("SetEnvironnement() // entry modified !\n");
649 if (lpEnv
->Next
== NULL
) break;
652 if (nCount
== 0 || lpEnviron
== NULL
) return -1;
653 printf("SetEnvironnement() // new entry !\n");
654 lpNewEnv
= malloc(sizeof(ENVENTRY
));
655 if (lpNewEnv
== NULL
) {
656 printf("SetEnvironment() // Error allocating new entry !\n");
659 if (lpEnvList
== NULL
) {
660 lpEnvList
= lpNewEnv
;
661 lpNewEnv
->Prev
= NULL
;
664 lpEnv
->Next
= lpNewEnv
;
665 lpNewEnv
->Prev
= lpEnv
;
667 lpNewEnv
->Next
= NULL
;
668 lpNewEnv
->Name
= malloc(strlen(lpPortName
) + 1);
669 if (lpNewEnv
->Name
== NULL
) {
670 printf("SetEnvironment() // Error allocating entry name !\n");
673 strcpy(lpNewEnv
->Name
, lpPortName
);
674 lpNewEnv
->Value
= malloc(nCount
);
675 if (lpNewEnv
->Value
== NULL
) {
676 printf("SetEnvironment() // Error allocating entry value !\n");
679 memcpy(lpNewEnv
->Value
, lpEnviron
, nCount
);
680 lpNewEnv
->wSize
= nCount
;
684 /***********************************************************************
685 * GetEnvironment (GDI.134)
687 int GetEnvironment(LPSTR lpPortName
, LPSTR lpEnviron
, WORD nMaxSiz
)
690 LPENVENTRY lpEnv
= lpEnvList
;
691 printf("GetEnvironnement('%s', '%s', %d) !\n",
692 lpPortName
, lpEnviron
, nMaxSiz
);
693 while (lpEnv
!= NULL
) {
694 if (lpEnv
->Name
!= NULL
&& strcmp(lpEnv
->Name
, lpPortName
) == 0) {
695 nCount
= min(nMaxSiz
, lpEnv
->wSize
);
696 memcpy(lpEnviron
, lpEnv
->Value
, nCount
);
697 printf("GetEnvironnement() // found '%s' !\n", lpEnviron
);
702 printf("GetEnvironnement() // not found !\n");
706 /***********************************************************************
707 * GetTimerResolution (USER.14)
709 LONG
GetTimerResolution(void)
714 /***********************************************************************
715 * SystemParametersInfo (USER.483)
717 BOOL
SystemParametersInfo (UINT uAction
, UINT uParam
, void FAR
*lpvParam
, UINT fuWinIni
)
721 XKeyboardState keyboard_state
;
722 XKeyboardControl keyboard_value
;
725 fprintf(stderr
, "SystemParametersInfo: action %d, param %x, flag %x\n",
726 uAction
, uParam
, fuWinIni
);
730 XGetKeyboardControl(display
, &keyboard_state
);
731 if (keyboard_state
.bell_percent
== 0)
732 *(BOOL
*) lpvParam
= FALSE
;
734 *(BOOL
*) lpvParam
= TRUE
;
738 *(INT
*) lpvParam
= 1;
741 case SPI_GETFASTTASKSWITCH
:
742 *(BOOL
*) lpvParam
= FALSE
;
745 case SPI_GETGRIDGRANULARITY
:
746 *(INT
*) lpvParam
= 1;
749 case SPI_GETICONTITLEWRAP
:
750 *(BOOL
*) lpvParam
= FALSE
;
753 case SPI_GETKEYBOARDDELAY
:
754 *(INT
*) lpvParam
= 1;
757 case SPI_GETKEYBOARDSPEED
:
758 *(WORD
*) lpvParam
= 30;
761 case SPI_GETMENUDROPALIGNMENT
:
762 *(BOOL
*) lpvParam
= FALSE
;
765 case SPI_GETSCREENSAVEACTIVE
:
766 *(BOOL
*) lpvParam
= FALSE
;
769 case SPI_GETSCREENSAVETIMEOUT
:
770 XGetScreenSaver(display
, &timeout
, &temp
,&temp
,&temp
);
771 *(INT
*) lpvParam
= timeout
* 1000;
774 case SPI_ICONHORIZONTALSPACING
:
775 if (lpvParam
== NULL
)
776 fprintf(stderr
, "SystemParametersInfo: Horizontal icon spacing set to %d\n.", uParam
);
778 *(INT
*) lpvParam
= 50;
781 case SPI_ICONVERTICALSPACING
:
782 if (lpvParam
== NULL
)
783 fprintf(stderr
, "SystemParametersInfo: Vertical icon spacing set to %d\n.", uParam
);
785 *(INT
*) lpvParam
= 50;
790 keyboard_value
.bell_percent
= -1;
792 keyboard_value
.bell_percent
= 0;
793 XChangeKeyboardControl(display
, KBBellPercent
,
797 case SPI_SETSCREENSAVEACTIVE
:
799 XActivateScreenSaver(display
);
801 XResetScreenSaver(display
);
804 case SPI_SETSCREENSAVETIMEOUT
:
805 XSetScreenSaver(display
, uParam
, 60, DefaultBlanking
,
809 case SPI_SETDESKWALLPAPER
:
810 return (SetDeskWallPaper((LPSTR
) lpvParam
));
813 case SPI_SETDESKPATTERN
:
814 if ((INT
) uParam
== -1) {
815 GetProfileString("Desktop", "Pattern",
816 "170 85 170 85 170 85 170 85",
817 buffer
, sizeof(buffer
) );
818 return (DESKTOP_SetPattern((LPSTR
) buffer
));
820 return (DESKTOP_SetPattern((LPSTR
) lpvParam
));
825 case SPI_SETDOUBLECLKHEIGHT
:
826 case SPI_SETDOUBLECLICKTIME
:
827 case SPI_SETDOUBLECLKWIDTH
:
828 case SPI_SETFASTTASKSWITCH
:
829 case SPI_SETKEYBOARDDELAY
:
830 case SPI_SETKEYBOARDSPEED
:
831 fprintf(stderr
, "SystemParametersInfo: option %d ignored.\n", uParam
);
835 fprintf(stderr
, "SystemParametersInfo: unknown option %d.\n", uParam
);
841 /***********************************************************************
842 * HMEMCPY (KERNEL.348)
844 void hmemcpy(void FAR
*hpvDest
, const void FAR
*hpvSource
, long cbCopy
)
846 memcpy(hpvDest
, hpvSource
, cbCopy
);
849 /***********************************************************************
852 void Copy(LPVOID lpSource
, LPVOID lpDest
, WORD nBytes
)
854 memcpy(lpDest
, lpSource
, nBytes
);
857 /***********************************************************************
858 * SWAPMOUSEBUTTON (USER.186)
860 BOOL
SwapMouseButton(BOOL fSwap
)
862 return 0; /* don't swap */
865 /***********************************************************************
866 * ISROMMODULE (KERNEL.323)
868 BOOL
IsRomModule(HANDLE x
)
870 /* I don't know the prototype, I assume that it returns true
871 if the dll is located in rom */
876 /***********************************************************************
877 * FileCDR (KERNEL.130)
879 void FileCDR(FARPROC x
)
881 printf("FileCDR(%8x)\n", (int) x
);