mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-22 19:31:19 +00:00
* ChangeLog
* config.h.in * configure * configure.ac * Headers/win32/WIN32Server.h * Source/cairo/CairoContext.m * Source/cairo/CairoGState.m * Source/cairo/CairoPDFSurface.m * Source/cairo/GNUmakefile * Source/cairo/Win32CairoSurface.m * Source/GSBackend.m * Source/gsc/GSGState.m * Source/win32/w32_create.m * Source/win32/w32_general.m * Source/win32/w32_GLcontext.m * Source/win32/w32_movesize.m * Source/win32/w32_windowdisplay.m * Source/win32/WIN32Server.m * Source/winlib/GNUmakefile.preamble: Merge of all testplant branch changes to trunk for Cairo changes. Did code cleanup to make the code conform to coding standards. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@35821 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6737892a4a
commit
02544402a5
19 changed files with 1567 additions and 570 deletions
72
ChangeLog
72
ChangeLog
|
@ -1,3 +1,32 @@
|
|||
2012-11-26 00:37-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* ChangeLog
|
||||
* config.h.in
|
||||
* configure
|
||||
* configure.ac
|
||||
* Headers/win32/WIN32Server.h
|
||||
* Source/cairo/CairoContext.m
|
||||
* Source/cairo/CairoGState.m
|
||||
* Source/cairo/CairoPDFSurface.m
|
||||
* Source/cairo/GNUmakefile
|
||||
* Source/cairo/Win32CairoSurface.m
|
||||
* Source/GSBackend.m
|
||||
* Source/gsc/GSGState.m
|
||||
* Source/win32/w32_create.m
|
||||
* Source/win32/w32_general.m
|
||||
* Source/win32/w32_GLcontext.m
|
||||
* Source/win32/w32_movesize.m
|
||||
* Source/win32/w32_windowdisplay.m
|
||||
* Source/win32/WIN32Server.m
|
||||
* Source/winlib/GNUmakefile.preamble: Merge of all testplant
|
||||
branch changes to trunk for Cairo changes. Did code cleanup to
|
||||
make the code conform to coding standards.
|
||||
|
||||
2012-10-24 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/win32/WIN32Server.m : Fix findWindowAt:windowRef:excluding:
|
||||
to skip windows with the ignoresMouseEvents property set.
|
||||
|
||||
2012-10-14 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call
|
||||
|
@ -15,6 +44,11 @@
|
|||
* Source/gsc/GSGState.m: Fix compiler warnings
|
||||
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>
|
||||
|
||||
2012-10-10 Jonathan Gillaspie <jonathan.gillaspie@testplant.com>
|
||||
|
||||
* Source/win32/WIN32Server.m : Fix for fatal exceptions when a
|
||||
nil mouse event tried to post
|
||||
|
||||
2012-09-28 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add
|
||||
|
@ -45,6 +79,30 @@
|
|||
* Source/x11/XGGLContext.m: Implement 10.6 methods to get/set the
|
||||
CGLContextObj.
|
||||
|
||||
2012-08-08 Marcian Lytwyn <marcian.lytwyn@advcsi.com>
|
||||
|
||||
*** Modifications/fixes for cairo support on win32 ***
|
||||
* Headers/win32/Win32CairoGState.h - NEW
|
||||
* Source/win32/Win32CairoGState.m - NEW
|
||||
* Headers/win32/WIN32Server.h
|
||||
* Source/gsc/GSGState.m: Fix compiler warnings
|
||||
* Source/win32/WIN32Server.m
|
||||
* Source/win32/w32_create.m
|
||||
* Source/win32/Win32CairoSurface.m
|
||||
* Source/cairo/GNUmakefile
|
||||
* Source/cairo/CairoContext.m
|
||||
* configure
|
||||
* configure.ac
|
||||
|
||||
2012-06-27 Marcian Lytwyn <marcian.lytwyn@advcsi.com>
|
||||
|
||||
*** Modifications to Win32 server backend to support multiple
|
||||
monitors.
|
||||
* Headers/win32/WIN32Server.h - Added a mutable array for storing
|
||||
multiple screen information from GDI screen lookup
|
||||
* Source/win32/WIN32Server.m - Added startup sequence to invoke
|
||||
GDI functions to look up multiple screen/monitor information
|
||||
|
||||
2012-06-21 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* configure.ac: use AC_CHECK_LIB to check for cairo if pkg-config
|
||||
|
@ -53,13 +111,13 @@
|
|||
|
||||
2012-05-14 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Source/gsc/GSContext.m (+initialize): Protected +initialize from being
|
||||
called multiple times because of subclasses. As a result, this
|
||||
eliminates a gtable memory leak (e.g. +initialize sent to both GSContext
|
||||
and CairoContext at backend initialization time), and prevents the
|
||||
gstate stack to be reset while still in use (e.g. the program enumerates
|
||||
classes at runtime and sends messages to them... +initialize might be
|
||||
sent to GSStreamContext in such a case).
|
||||
* Source/gsc/GSContext.m (+initialize): Protected +initialize from being
|
||||
called multiple times because of subclasses. As a result, this
|
||||
eliminates a gtable memory leak (e.g. +initialize sent to both GSContext
|
||||
and CairoContext at backend initialization time), and prevents the
|
||||
gstate stack to be reset while still in use (e.g. the program enumerates
|
||||
classes at runtime and sends messages to them... +initialize might be
|
||||
sent to GSStreamContext in such a case).
|
||||
|
||||
2012-05-12 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include <AppKit/NSImage.h>
|
||||
|
||||
#include <GNUstepGUI/GSDisplayServer.h>
|
||||
|
||||
#include <config.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*
|
||||
|
@ -76,10 +76,11 @@
|
|||
|
||||
DWORD windowStyleForGSStyle(unsigned int style);
|
||||
|
||||
typedef struct w32serverFlags {
|
||||
BOOL HOLD_MINI_FOR_SIZE; // override GS size event on miniturize
|
||||
BOOL _eventHandled; // did we handle the event?
|
||||
} serverFlags;
|
||||
typedef struct w32serverFlags
|
||||
{
|
||||
BOOL HOLD_MINI_FOR_SIZE; // override GS size event on miniturize
|
||||
BOOL _eventHandled; // did we handle the event?
|
||||
} serverFlags;
|
||||
|
||||
@interface WIN32Server : GSDisplayServer
|
||||
{
|
||||
|
@ -136,6 +137,7 @@ typedef struct w32serverFlags {
|
|||
- (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
|
||||
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
|
||||
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
|
||||
- (LRESULT) decodeWM_ENTERSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
|
||||
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
|
||||
- (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
|
||||
- (LRESULT) decodeWM_SIZINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
|
||||
|
@ -187,9 +189,31 @@ typedef struct w32serverFlags {
|
|||
|
||||
// Extra window data accessed via GetWindowLong
|
||||
|
||||
#define OFF_LEVEL 0
|
||||
#define OFF_ORDERED sizeof(DWORD)
|
||||
#define WIN_EXTRABYTES (2*sizeof(DWORD))
|
||||
enum _WIN_EXTRA_BYTES
|
||||
{
|
||||
OFF_LEVEL = 0,
|
||||
OFF_ORDERED = OFF_LEVEL + sizeof(DWORD),
|
||||
IME_INFO = OFF_ORDERED + sizeof(DWORD),
|
||||
WIN_EXTRABYTES = IME_INFO + sizeof(DWORD)
|
||||
};
|
||||
|
||||
|
||||
// Pointer to this struct set in IME_INFO extra bytes space for
|
||||
// handling IME composition processing between various windows...
|
||||
typedef struct IME_INFO_S
|
||||
{
|
||||
DWORD isOpened;
|
||||
BOOL isComposing;
|
||||
|
||||
LPVOID readString;
|
||||
DWORD readStringLength;
|
||||
LPVOID compString;
|
||||
DWORD compStringLength;
|
||||
|
||||
DWORD compositionMode;
|
||||
DWORD sentenceMode;
|
||||
} IME_INFO_T;
|
||||
|
||||
|
||||
// Extra window data allocated using objc_malloc in WM_CREATE and accessed via
|
||||
// the GWL_USERDATA pointer
|
||||
|
@ -200,7 +224,10 @@ typedef struct _win_intern {
|
|||
HDC hdc;
|
||||
HGDIOBJ old;
|
||||
MINMAXINFO minmax;
|
||||
NSBackingStoreType type;
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_cairo)
|
||||
void *surface;
|
||||
#endif
|
||||
} WIN_INTERN;
|
||||
|
||||
|
||||
#endif /* _WIN32Server_h_INCLUDE */
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
+ (void) initializeBackend
|
||||
{
|
||||
Class contextClass;
|
||||
NSString *context;
|
||||
NSString *context = nil;
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
/* Load in only one server */
|
||||
|
@ -70,23 +70,35 @@
|
|||
|
||||
/* The way the frontend is currently structured
|
||||
it's not possible to have more than one */
|
||||
context = [NSString stringWithCString: STRINGIFY(BUILD_GRAPHICS)];
|
||||
|
||||
/* What backend context? */
|
||||
if ([defs stringForKey: @"GSContext"])
|
||||
context = [defs stringForKey: @"GSContext"];
|
||||
|
||||
if ([context isEqual: @"xdps"])
|
||||
contextClass = NSClassFromString(@"NSDPSContext");
|
||||
else if ([context isEqual: @"art"])
|
||||
contextClass = NSClassFromString(@"ARTContext");
|
||||
else if ([context isEqual: @"winlib"])
|
||||
contextClass = NSClassFromString(@"WIN32Context");
|
||||
else if ([context isEqual: @"cairo"])
|
||||
contextClass = NSClassFromString(@"CairoContext");
|
||||
else
|
||||
contextClass = NSClassFromString(@"XGContext");
|
||||
|
||||
|
||||
if ((context == nil) || ([context length] == 0))
|
||||
{
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_xdps)
|
||||
context = @"NSDPSContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_art)
|
||||
context = @"ARTContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_xlib)
|
||||
context = @"XGContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
context = @"WIN32Context";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_cairo)
|
||||
context = @"CairoContext";
|
||||
#else
|
||||
#error INVALID build graphics type
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reference the requested build time class...
|
||||
contextClass = NSClassFromString(context);
|
||||
if (contextClass == nil)
|
||||
{
|
||||
NSLog(@"%s:Backend context class missing for: %@\n", __PRETTY_FUNCTION__, context);
|
||||
exit(1);
|
||||
}
|
||||
[contextClass initializeBackend];
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <AppKit/NSPrintOperation.h>
|
||||
|
||||
#include "cairo/CairoContext.h"
|
||||
#include "cairo/CairoGState.h"
|
||||
#include "cairo/CairoSurface.h"
|
||||
#include "cairo/CairoPSSurface.h"
|
||||
#include "cairo/CairoPDFSurface.h"
|
||||
|
@ -42,7 +41,9 @@
|
|||
#define CGSTATE ((CairoGState *)gstate)
|
||||
|
||||
#if BUILD_SERVER == SERVER_x11
|
||||
# include "cairo/CairoGState.h"
|
||||
# include "x11/XGServer.h"
|
||||
# define _CAIRO_GSTATE_CLASSNAME CairoGState
|
||||
# ifdef USE_GLITZ
|
||||
# define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface
|
||||
# include "cairo/XGCairoGlitzSurface.h"
|
||||
|
@ -57,7 +58,9 @@
|
|||
# include "x11/XGServerWindow.h"
|
||||
# include "x11/XWindowBuffer.h"
|
||||
#elif BUILD_SERVER == SERVER_win32
|
||||
# include "cairo/Win32CairoGState.h"
|
||||
# include <windows.h>
|
||||
# define _CAIRO_GSTATE_CLASSNAME Win32CairoGState
|
||||
# ifdef USE_GLITZ
|
||||
# define _CAIRO_SURFACE_CLASSNAME Win32CairoGlitzSurface
|
||||
# include "cairo/Win32CairoGlitzSurface.h"
|
||||
|
@ -92,7 +95,7 @@
|
|||
|
||||
+ (Class) GStateClass
|
||||
{
|
||||
return [CairoGState class];
|
||||
return [_CAIRO_GSTATE_CLASSNAME class];
|
||||
}
|
||||
|
||||
+ (BOOL) handlesPS
|
||||
|
@ -120,23 +123,27 @@
|
|||
#endif // BUILD_SERVER = SERVER_x11
|
||||
}
|
||||
|
||||
#if BUILD_SERVER == SERVER_x11
|
||||
|
||||
/* Private backend methods */
|
||||
+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver
|
||||
{
|
||||
#if BUILD_SERVER == SERVER_x11
|
||||
if ([(id)driver isKindOfClass: [XWindowBuffer class]])
|
||||
{
|
||||
// For XGCairoXImageSurface
|
||||
[(XWindowBuffer *)driver _exposeRect: rect];
|
||||
}
|
||||
else if ([(id)driver isKindOfClass: [CairoSurface class]])
|
||||
else
|
||||
#endif
|
||||
if ([(id)driver isKindOfClass: [CairoSurface class]])
|
||||
{
|
||||
// For XGCairoModernSurface
|
||||
[(CairoSurface *)driver handleExposeRect: rect];
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILD_SERVER == SERVER_x11
|
||||
|
||||
#ifdef XSHM
|
||||
|
||||
+ (void) _gotShmCompletion: (Drawable)d
|
||||
|
@ -292,3 +299,5 @@
|
|||
@end
|
||||
|
||||
#undef _CAIRO_SURFACE_CLASSNAME
|
||||
#undef _CAIRO_GSTATE_CLASSNAME
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
CairoGState.m
|
||||
|
||||
|
@ -124,8 +125,10 @@ static inline float floatToUserSpace(NSAffineTransform *ctm, double d)
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@ surface: %@ context: %p",
|
||||
[super description], _surface, _ct];
|
||||
NSMutableString *description = [[[super description] mutableCopy] autorelease];
|
||||
[description appendFormat: @" surface: %@",_surface];
|
||||
[description appendFormat: @" context: %p",_ct];
|
||||
return [[description copy] autorelease];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
|
@ -1257,6 +1260,8 @@ _set_op(cairo_t *ct, NSCompositingOperation op)
|
|||
cairo_pattern_t *cpattern;
|
||||
cairo_matrix_t source_matrix;
|
||||
|
||||
NSDebugMLLog(@"CairoGState", @"%self: %@\n", self);
|
||||
|
||||
if (!_ct || !source->_ct)
|
||||
{
|
||||
return;
|
||||
|
@ -1379,6 +1384,11 @@ doesn't support to use the receiver cairo target as the source. */
|
|||
cairo_matrix_t local_matrix;
|
||||
cairo_matrix_t source_matrix;
|
||||
|
||||
NSDebugMLLog(@"CairoGState", @"source: %@ fromRect: %@ toPoint: %@\n",
|
||||
source,
|
||||
NSStringFromRect(aRect),
|
||||
NSStringFromPoint(aPoint));
|
||||
|
||||
if (!_ct || !source->_ct)
|
||||
{
|
||||
NSLog(@"WARNING: -drawGState called with a NULL target context (%p) or source context (%p)",
|
||||
|
|
|
@ -58,13 +58,13 @@
|
|||
cairo_pdf_surface_set_size(_surface, size.width, size.height);
|
||||
}
|
||||
|
||||
- (void) writeComment: (NSString *)comment
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) writeComment: (NSString *)comment
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -49,7 +49,7 @@ else
|
|||
ifeq ($(WITH_GLITZ),yes)
|
||||
cairo_OBJC_FILES += Win32CairoGlitzSurface.m
|
||||
else
|
||||
cairo_OBJC_FILES += Win32CairoSurface.m
|
||||
cairo_OBJC_FILES += Win32CairoSurface.m Win32CairoGState.m
|
||||
# Win32CairoXImageSurface.m
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -27,47 +27,240 @@
|
|||
*/
|
||||
|
||||
#include "cairo/Win32CairoSurface.h"
|
||||
#include "win32/WIN32Geometry.h"
|
||||
#include <cairo-win32.h>
|
||||
|
||||
#define GSWINDEVICE ((HWND)gsDevice)
|
||||
|
||||
@implementation Win32CairoSurface
|
||||
|
||||
|
||||
- (id) initWithDevice: (void *)device
|
||||
{
|
||||
HDC hDC;
|
||||
WIN_INTERN *win;
|
||||
// Save/set initial state...
|
||||
gsDevice = device;
|
||||
|
||||
win = (WIN_INTERN *)GetWindowLong(GSWINDEVICE, GWL_USERDATA);
|
||||
if (win && win->useHDC)
|
||||
hDC = win->hdc;
|
||||
else
|
||||
hDC = GetDC(GSWINDEVICE);
|
||||
_surface = NULL;
|
||||
|
||||
if (!hDC)
|
||||
{
|
||||
NSLog(@"Win32CairoSurface : %d : no device context",__LINE__);
|
||||
exit(1);
|
||||
}
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(GSWINDEVICE, GWL_USERDATA);
|
||||
HDC hDC = GetDC(GSWINDEVICE);
|
||||
|
||||
_surface = cairo_win32_surface_create(hDC);
|
||||
if (!(win && win->useHDC))
|
||||
ReleaseDC(GSWINDEVICE, hDC);
|
||||
if (cairo_surface_status(_surface))
|
||||
if (hDC == NULL)
|
||||
{
|
||||
NSWarnMLog(@"Win32CairoSurface line: %d : no device context", __LINE__);
|
||||
|
||||
// And deallocate ourselves...
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create the cairo surfaces...
|
||||
// NSBackingStoreRetained works like Buffered since 10.5 (See apple docs)...
|
||||
// NOTE: According to Apple docs NSBackingStoreBuffered should be the only one
|
||||
// ever used anymore....others are NOT recommended...
|
||||
if (win && (win->type == NSBackingStoreNonretained))
|
||||
{
|
||||
// This is the raw DC surface...
|
||||
_surface = cairo_win32_surface_create(hDC);
|
||||
|
||||
// Check for error...
|
||||
if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
// Output the surface create error...
|
||||
cairo_status_t status = cairo_surface_status(_surface);
|
||||
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
|
||||
|
||||
// Destroy the initial surface created...
|
||||
cairo_surface_destroy(_surface);
|
||||
|
||||
// And deallocate ourselves...
|
||||
DESTROY(self);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSSize csize = [self size];
|
||||
|
||||
// This is the raw DC surface...
|
||||
cairo_surface_t *window = cairo_win32_surface_create(hDC);
|
||||
|
||||
// Check for error...
|
||||
if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
// Output the surface create error...
|
||||
cairo_status_t status = cairo_surface_status(window);
|
||||
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
|
||||
|
||||
// And deallocate ourselves...
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
// and this is the in-memory DC surface...surface owns its DC...
|
||||
// NOTE: For some reason we get an init sequence with zero width/height,
|
||||
// which creates problems in the cairo layer. It tries to clear
|
||||
// the 'similar' surface it's creating, and with a zero width/height
|
||||
// it incorrectly thinks the clear failed...so we will init with
|
||||
// a minimum size of 1 for width/height...
|
||||
_surface = cairo_surface_create_similar(window, CAIRO_CONTENT_COLOR_ALPHA,
|
||||
MAX(1, csize.width),
|
||||
MAX(1, csize.height));
|
||||
|
||||
// Check for error...
|
||||
if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
// Output the surface create error...
|
||||
cairo_status_t status = cairo_surface_status(_surface);
|
||||
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
|
||||
|
||||
// Destroy the surface created...
|
||||
cairo_surface_destroy(_surface);
|
||||
|
||||
// And deallocate ourselves...
|
||||
DESTROY(self);
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the initial surface created...
|
||||
cairo_surface_destroy(window);
|
||||
|
||||
// Release the device context...
|
||||
ReleaseDC(GSWINDEVICE, hDC);
|
||||
}
|
||||
|
||||
if (self)
|
||||
{
|
||||
// We need this for handleExposeEvent in WIN32Server...
|
||||
win->surface = (void*)self;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if ((_surface == NULL) || (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS))
|
||||
{
|
||||
NSWarnMLog(@"null surface or bad status\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cairo_win32_surface_get_dc(_surface) == NULL)
|
||||
{
|
||||
NSWarnMLog(@"HDC is NULL for surface: %@\n", self);
|
||||
}
|
||||
else
|
||||
{
|
||||
ReleaseDC(GSWINDEVICE, cairo_win32_surface_get_dc(_surface));
|
||||
}
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*) description
|
||||
{
|
||||
HDC shdc = NULL;
|
||||
if (_surface)
|
||||
{
|
||||
shdc = cairo_win32_surface_get_dc(_surface);
|
||||
}
|
||||
NSMutableString *description = AUTORELEASE([[super description] mutableCopy]);
|
||||
[description appendFormat: @" size: %@",NSStringFromSize([self size])];
|
||||
[description appendFormat: @" _surface: %p",_surface];
|
||||
[description appendFormat: @" surfDC: %p",shdc];
|
||||
return AUTORELEASE([description copy]);
|
||||
}
|
||||
|
||||
- (NSSize) size
|
||||
{
|
||||
RECT sz;
|
||||
RECT csize;
|
||||
|
||||
GetClientRect(GSWINDEVICE, &sz);
|
||||
return NSMakeSize(sz.right - sz.left, sz.top - sz.bottom);
|
||||
GetClientRect(GSWINDEVICE, &csize);
|
||||
return NSMakeSize(csize.right - csize.left, csize.bottom - csize.top);
|
||||
}
|
||||
|
||||
- (void) setSize: (NSSize)newSize
|
||||
{
|
||||
NSDebugMLLog(@"Win32CairoSurface", @"size: %@\n", NSStringFromSize(newSize));
|
||||
}
|
||||
|
||||
- (void) handleExposeRect: (NSRect)rect
|
||||
{
|
||||
// If the surface is buffered then we will have been invoked...
|
||||
HDC hdc = GetDC(GSWINDEVICE);
|
||||
|
||||
// Make sure we got a HDC...
|
||||
if (hdc == NULL)
|
||||
{
|
||||
NSWarnMLog(@"ERROR: cannot get a HDC for surface: %@\n", self);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a cairo surface for the hDC...
|
||||
cairo_surface_t *window = cairo_win32_surface_create(hdc);
|
||||
|
||||
// If the surface is buffered then...
|
||||
if (window == NULL)
|
||||
{
|
||||
NSWarnMLog(@"ERROR: cannot create cairo surface for: %@\n", self);
|
||||
}
|
||||
else
|
||||
{
|
||||
// First check the current status of the foreground surface...
|
||||
if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
NSWarnMLog(@"cairo initial window error status: %s\n",
|
||||
cairo_status_to_string(cairo_surface_status(window)));
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_t *context = cairo_create(window);
|
||||
|
||||
if (cairo_status(context) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
NSWarnMLog(@"cairo context create error - status: _surface: %s window: %s windowCtxt: %s (%d)",
|
||||
cairo_status_to_string(cairo_surface_status(_surface)),
|
||||
cairo_status_to_string(cairo_surface_status(window)),
|
||||
cairo_status_to_string(cairo_status(context)), cairo_get_reference_count(context));
|
||||
}
|
||||
else
|
||||
{
|
||||
double backupOffsetX = 0;
|
||||
double backupOffsetY = 0;
|
||||
RECT msRect = GSWindowRectToMS((WIN32Server*)GSCurrentServer(), GSWINDEVICE, rect);
|
||||
|
||||
// Need to save the device offset context...
|
||||
cairo_surface_get_device_offset(_surface, &backupOffsetX, &backupOffsetY);
|
||||
cairo_surface_set_device_offset(_surface, 0, 0);
|
||||
|
||||
cairo_rectangle(context, msRect.left, msRect.top, rect.size.width, rect.size.height);
|
||||
cairo_clip(context);
|
||||
cairo_set_source_surface(context, _surface, 0, 0);
|
||||
cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint(context);
|
||||
|
||||
if (cairo_status(context) != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
NSWarnMLog(@"cairo expose error - status: _surface: %s window: %s windowCtxt: %s",
|
||||
cairo_status_to_string(cairo_surface_status(_surface)),
|
||||
cairo_status_to_string(cairo_surface_status(window)),
|
||||
cairo_status_to_string(cairo_status(context)));
|
||||
}
|
||||
|
||||
// Cleanup...
|
||||
cairo_destroy(context);
|
||||
|
||||
// Restore device offset
|
||||
cairo_surface_set_device_offset(_surface, backupOffsetX, backupOffsetY);
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the surface...
|
||||
cairo_surface_destroy(window);
|
||||
}
|
||||
|
||||
// Release the aquired HDC...
|
||||
ReleaseDC(GSWINDEVICE, hdc);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
/* Designated initializer. */
|
||||
- initWithDrawContext: (GSContext *)drawContext
|
||||
{
|
||||
{
|
||||
self = [super init];
|
||||
if (!self)
|
||||
return nil;
|
||||
|
@ -103,8 +103,10 @@
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@ drawcontext: %@ ctm: %@",
|
||||
[super description], drawcontext, ctm];
|
||||
NSMutableString *description = [[super description] mutableCopy];
|
||||
[description appendFormat: @" drawcontext: %@",drawcontext];
|
||||
[description appendFormat: @" ctm: %@",ctm];
|
||||
return [description copy];
|
||||
}
|
||||
|
||||
- copyWithZone: (NSZone *)zone
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -337,18 +337,17 @@ static Win32GLContext *currentGLContext;
|
|||
- (id)initWithCGLContextObj: (void *)context
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Need to set the pixelFormat ivar
|
||||
wgl_context = context;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithFormat:(NSOpenGLPixelFormat *)aFormat
|
||||
- (id)initWithFormat:(NSOpenGLPixelFormat *)aFormat
|
||||
shareContext:(NSOpenGLContext *)share
|
||||
{
|
||||
NSDebugMLLog(@"WGL", @"will init with format %@", aFormat);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
|
@ -35,6 +36,7 @@
|
|||
|
||||
@implementation WIN32Server (w32_create)
|
||||
|
||||
|
||||
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam
|
||||
: (HWND)hwnd
|
||||
{
|
||||
|
@ -45,6 +47,7 @@
|
|||
: (HWND)hwnd
|
||||
{
|
||||
WIN_INTERN *win;
|
||||
IME_INFO_T *ime;
|
||||
NSBackingStoreType type = (NSBackingStoreType)((LPCREATESTRUCT)lParam)->lpCreateParams;
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *iconName = nil;
|
||||
|
@ -56,9 +59,17 @@
|
|||
is stored in the extra fields for this window. Drawing operations
|
||||
work on this buffer. */
|
||||
win = malloc(sizeof(WIN_INTERN));
|
||||
ime = malloc(sizeof(IME_INFO_T));
|
||||
|
||||
// Initialize win internals structure...
|
||||
memset(win, 0, sizeof(WIN_INTERN));
|
||||
memset(ime, 0, sizeof(IME_INFO_T));
|
||||
win->type = type;
|
||||
win->useHDC = NO;
|
||||
|
||||
// Save win internals structure pointer for window handle...
|
||||
SetWindowLong(hwnd, GWL_USERDATA, (int)win);
|
||||
SetWindowLongPtr(hwnd, IME_INFO, (LONG)ime);
|
||||
|
||||
[self windowbacking: type : (int)hwnd];
|
||||
|
||||
|
@ -91,7 +102,7 @@
|
|||
cpath,
|
||||
IMAGE_ICON,0,0,
|
||||
LR_DEFAULTSIZE|LR_LOADFROMFILE);
|
||||
SetClassLongPtr(hwnd,GCLP_HICON, (LONG_PTR)icon);
|
||||
SetClassLongPtr(hwnd,GCLP_HICON,(LONG_PTR)icon);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
DeleteDC(win->hdc);
|
||||
}
|
||||
free(win);
|
||||
free((IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO));
|
||||
flags._eventHandled=YES;
|
||||
|
||||
}
|
||||
|
|
|
@ -33,34 +33,37 @@
|
|||
|
||||
- (LRESULT) decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
|
||||
{
|
||||
NSPoint eventLocation;
|
||||
NSRect rect;
|
||||
RECT r;
|
||||
NSEvent *ev = nil;
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
rect = MSScreenRectToGS(r);
|
||||
eventLocation = rect.origin;
|
||||
|
||||
ev = [NSEvent otherEventWithType: NSAppKitDefined
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowMoved
|
||||
data1: rect.origin.x
|
||||
data2: rect.origin.y];
|
||||
|
||||
|
||||
//need native code here?
|
||||
[EVENT_WINDOW(hwnd) sendEvent: ev];
|
||||
|
||||
if (flags.HOLD_MINI_FOR_SIZE == FALSE)
|
||||
{
|
||||
NSPoint eventLocation;
|
||||
NSRect rect;
|
||||
RECT r;
|
||||
NSEvent *ev = nil;
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
rect = MSScreenRectToGS(r);
|
||||
eventLocation = rect.origin;
|
||||
|
||||
ev = [NSEvent otherEventWithType: NSAppKitDefined
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowMoved
|
||||
data1: rect.origin.x
|
||||
data2: rect.origin.y];
|
||||
|
||||
|
||||
//need native code here?
|
||||
[EVENT_WINDOW(hwnd) sendEvent: ev];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (LRESULT) decodeWM_SIZEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
|
||||
{
|
||||
{
|
||||
switch ((int)wParam)
|
||||
{
|
||||
case SIZE_MAXHIDE:
|
||||
|
@ -92,22 +95,22 @@
|
|||
NSRect rect;
|
||||
RECT r;
|
||||
NSEvent *ev =nil;
|
||||
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
rect = MSScreenRectToGS(r);
|
||||
eventLocation = rect.origin;
|
||||
|
||||
|
||||
// make event
|
||||
ev = [NSEvent otherEventWithType: NSAppKitDefined
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowResized
|
||||
data1: rect.size.width
|
||||
data2: rect.size.height];
|
||||
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowResized
|
||||
data1: rect.size.width
|
||||
data2: rect.size.height];
|
||||
|
||||
[EVENT_WINDOW(hwnd) sendEvent: ev];
|
||||
[self resizeBackingStoreFor: hwnd];
|
||||
// fixes part one of bug [5, 25] see notes
|
||||
|
@ -125,61 +128,13 @@
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
{
|
||||
// stub for future dev
|
||||
|
||||
/*NCCALCSIZE_PARAMS * newRects;
|
||||
|
||||
NSPoint eventLocation;
|
||||
NSRect rect;
|
||||
RECT drect;
|
||||
NSEvent *ev =nil;
|
||||
|
||||
if (wParam == TRUE)
|
||||
{
|
||||
// get first rect from NCCALCSIZE_PARAMS Structure
|
||||
newRects=(NCCALCSIZE_PARAMS *)lParam;
|
||||
// get rect 1 from array
|
||||
drect=newRects->rgrc[1];
|
||||
|
||||
//create a size event and send it to the window
|
||||
rect = MSScreenRectToGS(drect);
|
||||
eventLocation = rect.origin;
|
||||
|
||||
// make event
|
||||
ev = [NSEvent otherEventWithType: NSAppKitDefined
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowResized
|
||||
data1: rect.size.width
|
||||
data2: rect.size.height];
|
||||
|
||||
[EVENT_WINDOW(hwnd) sendEvent:ev];*/
|
||||
//[[EVENT_WINDOW(hwnd) contentView] display];
|
||||
//[self resizeBackingStoreFor:hwnd];
|
||||
|
||||
|
||||
/* ev = [NSEvent otherEventWithType: NSAppKitDefined
|
||||
location: eventLocation
|
||||
modifierFlags: 0
|
||||
timestamp: 0
|
||||
windowNumber: (int)hwnd
|
||||
context: GSCurrentContext()
|
||||
subtype: GSAppKitWindowMoved
|
||||
data1: rect.origin.x
|
||||
data2: rect.origin.y];
|
||||
|
||||
[EVENT_WINDOW(hwnd) sendEvent:ev];
|
||||
|
||||
//printf(" Rect 1 =\n%s", [[self MSRectDetails:drect] cString]);
|
||||
|
||||
}
|
||||
|
||||
//printf("wParam is %s\n", wParam ? "TRUE" : "FALSE");*/
|
||||
#if 0
|
||||
DefWindowProc(hwnd, WM_NCCALCSIZE, wParam, lParam);
|
||||
flags._eventHandled = YES;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
|
@ -196,34 +151,34 @@
|
|||
/* For debugging, log current window stack.
|
||||
*/
|
||||
if (GSDebugSet(@"WTrace") == YES)
|
||||
{
|
||||
NSString *s = @"Window list:\n";
|
||||
{
|
||||
NSString *s = @"Window list:\n";
|
||||
|
||||
hi = GetDesktopWindow();
|
||||
hi = GetWindow(hi, GW_CHILD);
|
||||
if (hi > 0)
|
||||
{
|
||||
hi = GetWindow(hi, GW_HWNDLAST);
|
||||
}
|
||||
while (hi > 0)
|
||||
{
|
||||
TCHAR buf[32];
|
||||
hi = GetDesktopWindow();
|
||||
hi = GetWindow(hi, GW_CHILD);
|
||||
if (hi > 0)
|
||||
{
|
||||
hi = GetWindow(hi, GW_HWNDLAST);
|
||||
}
|
||||
while (hi > 0)
|
||||
{
|
||||
TCHAR buf[32];
|
||||
|
||||
hi = GetNextWindow(hi, GW_HWNDPREV);
|
||||
hi = GetNextWindow(hi, GW_HWNDPREV);
|
||||
|
||||
if (hi > 0
|
||||
&& GetClassName(hi, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0)
|
||||
{
|
||||
if (GetWindowLong(hi, OFF_ORDERED) == 1)
|
||||
{
|
||||
hl = GetWindowLong(hi, OFF_LEVEL);
|
||||
s = [s stringByAppendingFormat: @"%d (%d)\n", hi, hl];
|
||||
}
|
||||
}
|
||||
}
|
||||
NSLog(@"window pos changed: %@", s);
|
||||
}
|
||||
if (hi > 0
|
||||
&& GetClassName(hi, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0)
|
||||
{
|
||||
if (GetWindowLong(hi, OFF_ORDERED) == 1)
|
||||
{
|
||||
hl = GetWindowLong(hi, OFF_LEVEL);
|
||||
s = [s stringByAppendingFormat: @"%d (%d)\n", hi, hl];
|
||||
}
|
||||
}
|
||||
}
|
||||
NSLog(@"window pos changed: %@", s);
|
||||
}
|
||||
|
||||
/* This window has changed its z-order, so we take the opportunity
|
||||
* to check that all the GNUstep windows are in the correct order
|
||||
|
@ -236,76 +191,76 @@
|
|||
hi = GetDesktopWindow();
|
||||
hi = GetWindow(hi, GW_CHILD);
|
||||
while (hi > 0)
|
||||
{
|
||||
TCHAR buf[32];
|
||||
{
|
||||
TCHAR buf[32];
|
||||
|
||||
/* Find a GNUstep window which is ordered in and above desktop
|
||||
*/
|
||||
while (hi > 0)
|
||||
{
|
||||
if (GetClassName(hi, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0
|
||||
&& GetWindowLong(hi, OFF_ORDERED) == 1
|
||||
&& (hl = GetWindowLong(hi, OFF_LEVEL))
|
||||
> NSDesktopWindowLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
hi = GetNextWindow(hi, GW_HWNDNEXT);
|
||||
}
|
||||
|
||||
if (hi > 0)
|
||||
{
|
||||
NSDebugLLog(@"WTrace", @"sort hi %d (%d)", hi, hl);
|
||||
/* Find the next (lower in z-order) GNUstep window which
|
||||
* is ordered in and above desktop
|
||||
*/
|
||||
lo = GetNextWindow(hi, GW_HWNDNEXT);
|
||||
while (lo > 0)
|
||||
{
|
||||
if (GetClassName(lo, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0
|
||||
&& GetWindowLong(lo, OFF_ORDERED) == 1
|
||||
&& (ll = GetWindowLong(lo, OFF_LEVEL))
|
||||
> NSDesktopWindowLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
lo = GetNextWindow(lo, GW_HWNDNEXT);
|
||||
}
|
||||
/* Find a GNUstep window which is ordered in and above desktop
|
||||
*/
|
||||
while (hi > 0)
|
||||
{
|
||||
if (GetClassName(hi, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0
|
||||
&& GetWindowLong(hi, OFF_ORDERED) == 1
|
||||
&& (hl = GetWindowLong(hi, OFF_LEVEL))
|
||||
> NSDesktopWindowLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
hi = GetNextWindow(hi, GW_HWNDNEXT);
|
||||
}
|
||||
|
||||
if (hi > 0)
|
||||
{
|
||||
NSDebugLLog(@"WTrace", @"sort hi %d (%d)", hi, hl);
|
||||
/* Find the next (lower in z-order) GNUstep window which
|
||||
* is ordered in and above desktop
|
||||
*/
|
||||
lo = GetNextWindow(hi, GW_HWNDNEXT);
|
||||
while (lo > 0)
|
||||
{
|
||||
if (GetClassName(lo, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0
|
||||
&& GetWindowLong(lo, OFF_ORDERED) == 1
|
||||
&& (ll = GetWindowLong(lo, OFF_LEVEL))
|
||||
> NSDesktopWindowLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
lo = GetNextWindow(lo, GW_HWNDNEXT);
|
||||
}
|
||||
|
||||
if (lo > 0)
|
||||
{
|
||||
NSDebugLLog(@"WTrace", @"sort lo %d (%d)", lo, ll);
|
||||
/* Check to see if the higher of the two windows should
|
||||
* actually be lower.
|
||||
*/
|
||||
if (hl < ll)
|
||||
{
|
||||
HWND higher;
|
||||
if (lo > 0)
|
||||
{
|
||||
NSDebugLLog(@"WTrace", @"sort lo %d (%d)", lo, ll);
|
||||
/* Check to see if the higher of the two windows should
|
||||
* actually be lower.
|
||||
*/
|
||||
if (hl < ll)
|
||||
{
|
||||
HWND higher;
|
||||
|
||||
/* Insert the low window before the high one.
|
||||
* ie after the window preceding the high one.
|
||||
*/
|
||||
higher = GetNextWindow(hi, GW_HWNDPREV);
|
||||
if (higher == 0)
|
||||
{
|
||||
higher = HWND_TOP;
|
||||
}
|
||||
NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
||||
SetWindowPos(lo, higher, 0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
|
||||
/* Insert the low window before the high one.
|
||||
* ie after the window preceding the high one.
|
||||
*/
|
||||
higher = GetNextWindow(hi, GW_HWNDPREV);
|
||||
if (higher == 0)
|
||||
{
|
||||
higher = HWND_TOP;
|
||||
}
|
||||
NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
||||
SetWindowPos(lo, higher, 0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
|
||||
|
||||
/* Done this iteration of the sort ... the next
|
||||
* iteration takes place when we get notified
|
||||
* that the swap we have just donew is complete.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
hi = lo;
|
||||
}
|
||||
}
|
||||
/* Done this iteration of the sort ... the next
|
||||
* iteration takes place when we get notified
|
||||
* that the swap we have just donew is complete.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
hi = lo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -321,9 +276,9 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
|||
* desktop level window is inserted below them.
|
||||
*/
|
||||
if (GetWindowLong(hwnd, OFF_LEVEL) <= NSDesktopWindowLevel)
|
||||
{
|
||||
inf->hwndInsertAfter = HWND_BOTTOM;
|
||||
}
|
||||
{
|
||||
inf->hwndInsertAfter = HWND_BOTTOM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,6 +299,11 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (LRESULT) decodeWM_ENTERSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
{
|
||||
return DefWindowProc(hwnd, WM_ENTERSIZEMOVE, wParam, lParam);
|
||||
}
|
||||
|
||||
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
{
|
||||
// may have a small bug here note it for follow up
|
||||
|
@ -352,11 +312,11 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
|||
no posting is needed.
|
||||
*/
|
||||
[self resizeBackingStoreFor: hwnd];
|
||||
[self decodeWM_MOVEParams:hwnd :wParam :lParam];
|
||||
[self decodeWM_SIZEParams:hwnd :wParam :lParam];
|
||||
|
||||
// [self decodeWM_MOVEParams:hwnd :wParam :lParam];
|
||||
// [self decodeWM_SIZEParams:hwnd :wParam :lParam];
|
||||
|
||||
//Make sure DefWindowProc gets called
|
||||
return 0;
|
||||
return DefWindowProc(hwnd, WM_EXITSIZEMOVE, wParam, lParam);
|
||||
}
|
||||
|
||||
- (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
|
||||
|
@ -367,10 +327,10 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
|
|||
|
||||
- (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
|
||||
{
|
||||
// stub for future dev
|
||||
[self decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam];
|
||||
// [self decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam];
|
||||
[EVENT_WINDOW(hwnd) display];
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -55,6 +55,7 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
|
|||
win->backingStoreEmpty = NO;
|
||||
}
|
||||
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
if (win->useHDC)
|
||||
{
|
||||
HDC hdc = GetDC((HWND)hwnd);
|
||||
|
@ -65,10 +66,11 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
|
|||
win->hdc, rect.left, rect.top, SRCCOPY);
|
||||
if (!result)
|
||||
{
|
||||
NSLog(@"validateWindow failed %d", GetLastError());
|
||||
NSWarnMLog(@"validateWindow failed %d", GetLastError());
|
||||
}
|
||||
ReleaseDC((HWND)hwnd, hdc);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@implementation WIN32Server (w32_windowdisplay)
|
||||
|
|
|
@ -47,7 +47,7 @@ ADDITIONAL_CFLAGS = -DWINVER=0x0500
|
|||
|
||||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS = -I../../Headers \
|
||||
-I$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS)
|
||||
-I$(GNUSTEP_TARGET_DIR) -I.. $(GRAPHIC_CFLAGS)
|
||||
|
||||
# Additional LDFLAGS to pass to the linker
|
||||
# ADDITIONAL_LDFLAGS =
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
|
||||
|
||||
/* Define to type of graphics context to build */
|
||||
|
|
159
configure
vendored
159
configure
vendored
|
@ -613,6 +613,8 @@ GLITZ_GLX_LIBS
|
|||
GLITZ_GLX_CFLAGS
|
||||
GLITZ_LIBS
|
||||
GLITZ_CFLAGS
|
||||
FONTCONFIG_LIBS
|
||||
FONTCONFIG_CFLAGS
|
||||
CAIRO_GLITZ_LIBS
|
||||
CAIRO_GLITZ_CFLAGS
|
||||
CAIRO_WIN32_LIBS
|
||||
|
@ -5584,6 +5586,45 @@ fi
|
|||
if test "$have_msimg32" = yes; then
|
||||
WIN32_LIBS="${WIN32_LIBS} -lmsimg32"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -limm32" >&5
|
||||
$as_echo_n "checking for main in -limm32... " >&6; }
|
||||
if ${ac_cv_lib_imm32_main+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-limm32 $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return main ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_imm32_main=yes
|
||||
else
|
||||
ac_cv_lib_imm32_main=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_imm32_main" >&5
|
||||
$as_echo "$ac_cv_lib_imm32_main" >&6; }
|
||||
if test "x$ac_cv_lib_imm32_main" = xyes; then :
|
||||
have_imm32=yes
|
||||
else
|
||||
have_imm32=no
|
||||
fi
|
||||
|
||||
if test "$have_imm32" = yes; then
|
||||
WIN32_LIBS="${WIN32_LIBS} -limm32"
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# WGL support
|
||||
|
@ -6251,6 +6292,106 @@ $as_echo "$CAIRO_GLITZ_LIBS" >&6; }
|
|||
have_cairo_glitz=no
|
||||
fi
|
||||
|
||||
PKG_FONTCONFIG=no
|
||||
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_PKG_CONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
|
||||
$as_echo "$PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "pkg-config script not be found"
|
||||
## We don't want the user to see this warning
|
||||
## echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
## echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
## echo "*** to the full path to pkg-config."
|
||||
## echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig" >&5
|
||||
$as_echo_n "checking for fontconfig... " >&6; }
|
||||
|
||||
if $PKG_CONFIG --exists "fontconfig" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
succeeded=yes
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FONTCONFIG_CFLAGS" >&5
|
||||
$as_echo_n "checking FONTCONFIG_CFLAGS... " >&6; }
|
||||
FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig"`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_CFLAGS" >&5
|
||||
$as_echo "$FONTCONFIG_CFLAGS" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FONTCONFIG_LIBS" >&5
|
||||
$as_echo_n "checking FONTCONFIG_LIBS... " >&6; }
|
||||
FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig"`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_LIBS" >&5
|
||||
$as_echo "$FONTCONFIG_LIBS" >&6; }
|
||||
else
|
||||
FONTCONFIG_CFLAGS=""
|
||||
FONTCONFIG_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "fontconfig"`
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
have_fontconfig=yes
|
||||
else
|
||||
have_fontconfig=no
|
||||
fi
|
||||
|
||||
|
||||
if test "$have_cairo" = no; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_create in -lcairo" >&5
|
||||
|
@ -6915,12 +7056,22 @@ $as_echo "$as_me: WARNING: can't find cairo, required for graphics=cairo!" >&2;}
|
|||
BUILD_GRAPHICS=art
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5
|
||||
$as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;}
|
||||
elif test $BUILD_SERVER = win32 -a "$have_fontconfig" = no ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find fontconfig, required for graphics=cairo!" >&5
|
||||
$as_echo "$as_me: WARNING: can't find fontconfig, required for graphics=cairo!" >&2;}
|
||||
BUILD_GRAPHICS=winlib
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5
|
||||
$as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;}
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Cairo backend" >&5
|
||||
$as_echo_n "checking Cairo backend... " >&6; }
|
||||
CAIRO_LIBS="$CAIRO_FT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_FT_CFLAGS"
|
||||
if test $BUILD_SERVER = win32; then
|
||||
CAIRO_LIBS="$CAIRO_LIBS $FONTCONFIG_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS"
|
||||
fi
|
||||
|
||||
if test "$have_xrender" = yes; then
|
||||
if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
|
||||
|
@ -6957,10 +7108,8 @@ $as_echo "$as_me: WARNING: **** Are you a backend developer ?" >&2;}
|
|||
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: winlib" >&5
|
||||
$as_echo "winlib" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** Cairo backend on win32 is experimental and is not supported." >&5
|
||||
$as_echo "$as_me: WARNING: **** Cairo backend on win32 is experimental and is not supported." >&2;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** Are you a backend developer ?" >&5
|
||||
$as_echo "$as_me: WARNING: **** Are you a backend developer ?" >&2;}
|
||||
#AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.])
|
||||
#AC_MSG_WARN([**** Are you a backend developer ?])
|
||||
elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
|
||||
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS"
|
||||
|
@ -7057,7 +7206,7 @@ _ACEOF
|
|||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define BUILD_GRAPHICS $BUILD_GRAPHICS
|
||||
#define BUILD_GRAPHICS GRAPHICS_$BUILD_GRAPHICS
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
|
31
configure.ac
31
configure.ac
|
@ -354,6 +354,10 @@ AC_CHECK_LIB(msimg32, main, have_msimg32=yes, have_msimg32=no)
|
|||
if test "$have_msimg32" = yes; then
|
||||
WIN32_LIBS="${WIN32_LIBS} -lmsimg32"
|
||||
fi
|
||||
AC_CHECK_LIB(imm32, main, have_imm32=yes, have_imm32=no)
|
||||
if test "$have_imm32" = yes; then
|
||||
WIN32_LIBS="${WIN32_LIBS} -limm32"
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# WGL support
|
||||
|
@ -423,6 +427,8 @@ PKG_CAIRO_WIN32=no
|
|||
PKG_CHECK_MODULES(CAIRO_WIN32, cairo-win32, have_cairo_win32=yes, have_cairo_win32=no)
|
||||
PKG_CAIRO_GLITZ=no
|
||||
PKG_CHECK_MODULES(CAIRO_GLITZ, cairo-glitz, have_cairo_glitz=yes, have_cairo_glitz=no)
|
||||
PKG_FONTCONFIG=no
|
||||
PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fontconfig=yes, have_fontconfig=no)
|
||||
|
||||
if test "$have_cairo" = no; then
|
||||
AC_CHECK_LIB(cairo, cairo_create, have_cairo=yes)
|
||||
|
@ -551,11 +557,19 @@ if test x"$BUILD_GRAPHICS" = "xcairo"; then
|
|||
BUILD_GRAPHICS=art
|
||||
fi
|
||||
AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS])
|
||||
elif test $BUILD_SERVER = win32 -a "$have_fontconfig" = no ; then
|
||||
AC_MSG_WARN([can't find fontconfig, required for graphics=cairo!])
|
||||
BUILD_GRAPHICS=winlib
|
||||
AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS])
|
||||
else
|
||||
AC_MSG_CHECKING(Cairo backend)
|
||||
CAIRO_LIBS="$CAIRO_FT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_FT_CFLAGS"
|
||||
|
||||
if test $BUILD_SERVER = win32; then
|
||||
CAIRO_LIBS="$CAIRO_LIBS $FONTCONFIG_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS"
|
||||
fi
|
||||
|
||||
if test "$have_xrender" = yes; then
|
||||
if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
|
||||
AC_DEFINE(XRENDER,1,[Define if you have X11 XRender extension])
|
||||
|
@ -583,8 +597,8 @@ if test x"$BUILD_GRAPHICS" = "xcairo"; then
|
|||
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_WIN32_LIBS $WIN32_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS"
|
||||
AC_MSG_RESULT(winlib)
|
||||
AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.])
|
||||
AC_MSG_WARN([**** Are you a backend developer ?])
|
||||
#AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.])
|
||||
#AC_MSG_WARN([**** Are you a backend developer ?])
|
||||
elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
|
||||
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS"
|
||||
|
@ -667,12 +681,17 @@ if test $BUILD_SERVER = win32; then
|
|||
fi
|
||||
|
||||
AH_TOP([
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
])
|
||||
AC_DEFINE_UNQUOTED(BUILD_SERVER,SERVER_$BUILD_SERVER,
|
||||
[Define to type of window server to build])
|
||||
AC_DEFINE_UNQUOTED(BUILD_GRAPHICS,$BUILD_GRAPHICS,
|
||||
AC_DEFINE_UNQUOTED(BUILD_GRAPHICS,GRAPHICS_$BUILD_GRAPHICS,
|
||||
[Define to type of graphics context to build])
|
||||
AC_SUBST(BUILD_GRAPHICS)
|
||||
AC_SUBST(BUILD_SERVER)
|
||||
|
|
Loading…
Reference in a new issue