Thu Jan 13 11:45:13 1994 John Richardson <jrichard@cs.uml.edu> * [window/win.c] Added functions EnableWindow, IsWindowEnabled, and helper WIN_SetSensitive. * [window/event.c] Added checks for WS_DISABLED windows in EVENT_key, EVENT_MotionNotify, EVENT_ButtonPress, EVENT_ButtonRelease, EVENT_ConfigureNotify, EVENT_FocusIn, EVENT_FocusOut, and EVENT_EnterNotify. Key and button presses beep for a disabled window. If anyone finds better places for these checks, please tell me. Jan 17, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [misc/message.c] Cleanup on buttons answer value returned. * [control/combo.c] Now use OBM_COMBO bitmap dropdown button. Mon Jan 17 21:56:45 1994 Erik Bos (erik@trashcan.hacktic.nl) * [misc/comm/c] A few bugfixes. Tue Jan 18 06:36:48 1994 julliard@di.epfl.ch (Alexandre Julliard) * [loader/cursor.c] Added X cursor for IDC_SIZENS and IDC_SIZEWE. * [include/options.h] [misc/main.c] (New files) Rewrote main() function to get rid of Xt application context, and added command-line option parsing. * [objects/color.c] Use of a private map now configurable with command-line option. * [windows/defwnd.c] Added WM_SYSCOMMAND handling, and better WM_SETCURSOR handling. * [windows/event.c] Removed ConfigureNotify event handler (no longer needed). * [windows/message.c] Send WM_SETCURSOR message on mouse events. * [windows/nonclient.c] Use OEM bitmaps for the drawing of the non-client area. Added caption bar buttons handling, and moving and resizing of the window via the window frame (bypassing the window manager). * [windows/painting.c] Bug fix in BeginPaint(). * [windows/win.c] Set the override_redirect flag for windows (to bypass window manager). * [windows/winpos.c] Implemented WindowFromPoint(), ChildWindowFromPoint(), BringWindowToTop(), Get/SetInternalWindowPos(), Get/SetWindowPlacement(). Mon Jan 17 20:48:24 1994 Bob Amstadt (bob@pooh) * [memory/heap.c] Added support for multiple local heaps.
120 lines
3.1 KiB
C
120 lines
3.1 KiB
C
/*
|
|
* Main function.
|
|
*
|
|
* Copyright 1994 Alexandre Julliard
|
|
*/
|
|
|
|
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
|
|
|
|
#include <stdio.h>
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xresource.h>
|
|
|
|
#include "windows.h"
|
|
#include "options.h"
|
|
|
|
|
|
Display * XT_display; /* To be removed */
|
|
Screen * XT_screen; /* To be removed */
|
|
|
|
Display * display;
|
|
Screen * screen;
|
|
|
|
|
|
struct options Options =
|
|
{ /* default options */
|
|
NULL, /* spyFilename */
|
|
FALSE, /* usePrivateMap */
|
|
FALSE, /* synchronous */
|
|
SW_SHOWNORMAL /* cmdShow */
|
|
};
|
|
|
|
|
|
static XrmOptionDescRec optionsTable[] =
|
|
{
|
|
{ "-display", ".display", XrmoptionSepArg, (caddr_t)NULL },
|
|
{ "-iconic", ".iconic", XrmoptionNoArg, (caddr_t)"on" },
|
|
{ "-privatemap", ".privatemap", XrmoptionNoArg, (caddr_t)"on" },
|
|
{ "-synchronous", ".synchronous", XrmoptionNoArg, (caddr_t)"on" },
|
|
{ "-spy", ".spy", XrmoptionSepArg, (caddr_t)NULL }
|
|
};
|
|
|
|
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
|
|
|
|
|
|
/***********************************************************************
|
|
* MAIN_Usage
|
|
*/
|
|
static void MAIN_Usage( char *name )
|
|
{
|
|
fprintf( stderr,"Usage: %s [-display name] [-iconic] [-privatemap]\n"
|
|
" [-synchronous] [-spy file] program [arguments]\n",
|
|
name );
|
|
exit(1);
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* MAIN_ParseOptions
|
|
*
|
|
* Parse command line options and open display.
|
|
*/
|
|
static void MAIN_ParseOptions( int *argc, char *argv[] )
|
|
{
|
|
char *dummy, *display_name;
|
|
XrmValue value;
|
|
XrmDatabase db = NULL;
|
|
|
|
XrmParseCommand( &db, optionsTable, NB_OPTIONS, "wine", argc, argv );
|
|
if (*argc < 2) MAIN_Usage( argv[0] );
|
|
|
|
if (XrmGetResource( db, "wine.display", "Wine.display", &dummy, &value ))
|
|
display_name = value.addr;
|
|
else display_name = NULL;
|
|
|
|
if (!(display = XOpenDisplay( display_name )))
|
|
{
|
|
fprintf( stderr, "%s: Can't open display: %s\n",
|
|
argv[0], display_name ? display_name : "" );
|
|
exit(1);
|
|
}
|
|
|
|
if (XrmGetResource(db,"wine.iconic","Wine.iconic",&dummy,&value))
|
|
Options.cmdShow = SW_SHOWMINIMIZED;
|
|
if (XrmGetResource(db,"wine.privatemap","Wine.privatemap",&dummy,&value))
|
|
Options.usePrivateMap = TRUE;
|
|
if (XrmGetResource(db,"wine.synchronous","Wine.synchronous",&dummy,&value))
|
|
Options.synchronous = TRUE;
|
|
if (XrmGetResource(db,"wine.spy","Wine.spy",&dummy,&value))
|
|
Options.spyFilename = value.addr;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* main
|
|
*/
|
|
int main( int argc, char *argv[] )
|
|
{
|
|
|
|
XrmInitialize();
|
|
|
|
MAIN_ParseOptions( &argc, argv );
|
|
|
|
screen = DefaultScreenOfDisplay( display );
|
|
XT_display = display;
|
|
XT_screen = screen;
|
|
if (Options.synchronous) XSynchronize( display, True );
|
|
|
|
DOS_InitFS();
|
|
Comm_Init();
|
|
return _WinMain( argc, argv );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* MessageBeep (USER.104)
|
|
*/
|
|
void MessageBeep( WORD i )
|
|
{
|
|
XBell( display, 100 );
|
|
}
|