Screen handling

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@13524 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-04-22 15:45:10 +00:00
parent 5a9f41a919
commit 433edb9c86
6 changed files with 114 additions and 7 deletions

View file

@ -1,3 +1,14 @@
2002-04-22 Adam Fedor <fedor@gnu.org>
* configure.in: Check for gdi32.
* Source/win32/WIN32Server.m (window::::): Update for new interface -
frame is frame rect, not content rect.
* Source/x11/XGServer.m (-_initXContext): Look for
display attributes in server_info.
* Source/x11/XGServerWindow.m (-window::::): Update for new interface.
2002-04-21 Fred Kiefer <FredKiefer@gmx.de>
* Headers/win32

View file

@ -269,11 +269,13 @@ DWORD windowStyleForGSStyle(int style)
@implementation WIN32Server (WindowOps)
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
: (int) screen
{
HWND hwnd;
RECT r;
DWORD wstyle = windowStyleForGSStyle(style);
frame = [NSWindow contentRectForFrameRect: frame styleMask: _styleMask];
r = GSScreenRectToMS(frame);
AdjustWindowRectEx(&r, wstyle, NO, 0);

View file

@ -118,12 +118,27 @@ extern int XGErrorHandler(Display *display, XErrorEvent *err);
Display *dpy;
int screen_number;
NSString *display_name;
NSRange disnum;
RContext *rcontext;
RContextAttributes *attribs;
XColor testColor;
unsigned char r, g, b;
display_name = [server_info objectForKey: @"DisplayName"];
display_name = [server_info objectForKey: GSDisplayName];
if (display_name == nil)
{
NSString *dn = [server_info objectForKey: GSDisplayNumber];
NSString *sn = [server_info objectForKey: GSScreenNumber];
if (dn || sn)
{
if (dn == NULL)
dn = @"0";
if (sn == NULL)
sn = @"0";
display_name = [NSString stringWithFormat: @":%@.%@", dn, sn];
}
}
if (display_name == nil)
{
NSString *host;
@ -214,6 +229,13 @@ extern int XGErrorHandler(Display *display, XErrorEvent *err);
else
NSDebugLog(@"Opened display %@", display_name);
[server_info setObject: display_name forKey: GSDisplayName];
disnum = [display_name rangeOfString: @":"];
if (disnum.location >= 0)
[server_info setObject: [display_name substringFromIndex: disnum.location]
forKey: GSDisplayNumber];
[server_info setObject: [display_name pathExtension] forKey: GSScreenNumber];
/* Get the visual information */
attribs = NULL;
//attribs = [self _getXDefaults];
@ -325,8 +347,8 @@ extern int XGErrorHandler(Display *display, XErrorEvent *err);
*/
- (id) initWithAttributes: (NSDictionary *)info
{
[self _initXContext];
[super initWithAttributes: info];
[self _initXContext];
[self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode];
[self setupRunLoopInputSourcesForMode: NSConnectionReplyMode];

View file

@ -879,6 +879,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
}
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
: (int)screen
{
static int last_win_num = 0;
gswindow_device_t *window;
@ -890,6 +891,8 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
NSDebugLLog(@"XGTrace", @"DPSwindow: %@ %d", NSStringFromRect(frame), type);
root = [self _rootWindowForScreen: XSCR];
frame = [NSWindow contentRectForFrameRect: frame styleMask: style];
/* We're not allowed to create a zero rect window */
if (NSWidth(frame) <= 0 || NSHeight(frame) <= 0)
{

62
configure vendored
View file

@ -2720,6 +2720,59 @@ fi
CPPFLAGS="$save_CPPFLAGS"
#--------------------------------------------------------------------
# Window's graphics library
#--------------------------------------------------------------------
save_header=${CPPFLAGS}
save_libs=${LIBS}
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}"
LIBS="${GRAPHIC_LIBS} ${LIBS}"
echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
echo "configure:2732: checking for main in -lgdi32" >&5
ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lgdi32 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2740 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_gdi32=yes
else
echo "$ac_t""no" 1>&6
have_gdi32=no
fi
if test "$have_gdi32" = yes; then
GRAPHIC_LIBS="-lgdi32 ${GRAPHIC_LIBS}"
fi
CPPFLAGS="${save_header}"
LIBS="${save_libs}"
#--------------------------------------------------------------------
# Set definitions
#--------------------------------------------------------------------
WITH_WRASTER=no
if test $gs_cv_have_wraster = yes -a $set_x_paths = no; then
cat >> confdefs.h <<\EOF
@ -2788,7 +2841,7 @@ fi
echo $ac_n "checking Backend Server""... $ac_c" 1>&6
echo "configure:2792: checking Backend Server" >&5
echo "configure:2845: checking Backend Server" >&5
if test "x$enable_win32" = "xyes"; then
BUILD_WIN32=yes
@ -2811,7 +2864,7 @@ EOF
fi
echo $ac_n "checking Backend Graphics""... $ac_c" 1>&6
echo "configure:2815: checking Backend Graphics" >&5
echo "configure:2868: checking Backend Graphics" >&5
if test "x$enable_winlib" = "xyes"; then
BUILD_WINLIB=yes
@ -2819,8 +2872,7 @@ if test "x$enable_winlib" = "xyes"; then
#define BUILD_WINLIB 1
EOF
echo "$ac_t""winlib" 1>&6
GRAPHIC_LIBS=-lgdi32
echo "$ac_t""win32" 1>&6
enable_xdps=no
enable_xlib=no
fi
@ -2855,7 +2907,7 @@ if test "${with_name+set}" = set; then
fi
echo $ac_n "checking Backend name""... $ac_c" 1>&6
echo "configure:2858: checking Backend name" >&5
echo "configure:2911: checking Backend name" >&5
if test "x$with_name" = "x"; then
BACKEND_NAME=back
else

View file

@ -360,6 +360,23 @@ CPPFLAGS="$CPPFLAGS $GRAPHIC_CFLAGS"
AC_CHECK_HEADER(X11/extensions/XShm.h, AC_DEFINE(XSHM))
CPPFLAGS="$save_CPPFLAGS"
#--------------------------------------------------------------------
# Window's graphics library
#--------------------------------------------------------------------
save_header=${CPPFLAGS}
save_libs=${LIBS}
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}"
LIBS="${GRAPHIC_LIBS} ${LIBS}"
AC_CHECK_LIB(gdi32, main, have_gdi32=yes, have_gdi32=no)
if test "$have_gdi32" = yes; then
GRAPHIC_LIBS="-lgdi32 ${GRAPHIC_LIBS}"
fi
CPPFLAGS="${save_header}"
LIBS="${save_libs}"
#--------------------------------------------------------------------
# Set definitions
#--------------------------------------------------------------------
WITH_WRASTER=no
if test $gs_cv_have_wraster = yes -a $set_x_paths = no; then
AC_DEFINE(WITH_WRASTER)