* 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:
Gregory John Casamento 2012-11-26 05:39:22 +00:00
parent 6737892a4a
commit 02544402a5
19 changed files with 1567 additions and 570 deletions

View file

@ -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> 2012-10-14 Fred Kiefer <FredKiefer@gmx.de>
* Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call * Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call
@ -15,6 +44,11 @@
* Source/gsc/GSGState.m: Fix compiler warnings * Source/gsc/GSGState.m: Fix compiler warnings
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com> 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> 2012-09-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add * Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add
@ -45,6 +79,30 @@
* Source/x11/XGGLContext.m: Implement 10.6 methods to get/set the * Source/x11/XGGLContext.m: Implement 10.6 methods to get/set the
CGLContextObj. 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> 2012-06-21 Eric Wasylishen <ewasylishen@gmail.com>
* configure.ac: use AC_CHECK_LIB to check for cairo if pkg-config * configure.ac: use AC_CHECK_LIB to check for cairo if pkg-config

View file

@ -53,7 +53,7 @@
#include <AppKit/NSImage.h> #include <AppKit/NSImage.h>
#include <GNUstepGUI/GSDisplayServer.h> #include <GNUstepGUI/GSDisplayServer.h>
#include <config.h>
#include <windows.h> #include <windows.h>
/* /*
@ -76,10 +76,11 @@
DWORD windowStyleForGSStyle(unsigned int style); DWORD windowStyleForGSStyle(unsigned int style);
typedef struct w32serverFlags { typedef struct w32serverFlags
{
BOOL HOLD_MINI_FOR_SIZE; // override GS size event on miniturize BOOL HOLD_MINI_FOR_SIZE; // override GS size event on miniturize
BOOL _eventHandled; // did we handle the event? BOOL _eventHandled; // did we handle the event?
} serverFlags; } serverFlags;
@interface WIN32Server : GSDisplayServer @interface WIN32Server : GSDisplayServer
{ {
@ -136,6 +137,7 @@ typedef struct w32serverFlags {
- (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (void) decodeWM_WINDOWPOSCHANGEDParams: (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_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_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd;
- (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; - (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam;
- (LRESULT) decodeWM_SIZINGParams: (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 // Extra window data accessed via GetWindowLong
#define OFF_LEVEL 0 enum _WIN_EXTRA_BYTES
#define OFF_ORDERED sizeof(DWORD) {
#define WIN_EXTRABYTES (2*sizeof(DWORD)) 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 // Extra window data allocated using objc_malloc in WM_CREATE and accessed via
// the GWL_USERDATA pointer // the GWL_USERDATA pointer
@ -200,7 +224,10 @@ typedef struct _win_intern {
HDC hdc; HDC hdc;
HGDIOBJ old; HGDIOBJ old;
MINMAXINFO minmax; MINMAXINFO minmax;
NSBackingStoreType type;
#if (BUILD_GRAPHICS==GRAPHICS_cairo)
void *surface;
#endif
} WIN_INTERN; } WIN_INTERN;
#endif /* _WIN32Server_h_INCLUDE */ #endif /* _WIN32Server_h_INCLUDE */

View file

@ -55,7 +55,7 @@
+ (void) initializeBackend + (void) initializeBackend
{ {
Class contextClass; Class contextClass;
NSString *context; NSString *context = nil;
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
/* Load in only one server */ /* Load in only one server */
@ -70,23 +70,35 @@
/* The way the frontend is currently structured /* The way the frontend is currently structured
it's not possible to have more than one */ it's not possible to have more than one */
context = [NSString stringWithCString: STRINGIFY(BUILD_GRAPHICS)];
/* What backend context? */ /* What backend context? */
if ([defs stringForKey: @"GSContext"]) if ([defs stringForKey: @"GSContext"])
context = [defs stringForKey: @"GSContext"]; context = [defs stringForKey: @"GSContext"];
if ([context isEqual: @"xdps"]) if ((context == nil) || ([context length] == 0))
contextClass = NSClassFromString(@"NSDPSContext"); {
else if ([context isEqual: @"art"]) #if (BUILD_GRAPHICS==GRAPHICS_xdps)
contextClass = NSClassFromString(@"ARTContext"); context = @"NSDPSContext";
else if ([context isEqual: @"winlib"]) #elif (BUILD_GRAPHICS==GRAPHICS_art)
contextClass = NSClassFromString(@"WIN32Context"); context = @"ARTContext";
else if ([context isEqual: @"cairo"]) #elif (BUILD_GRAPHICS==GRAPHICS_xlib)
contextClass = NSClassFromString(@"CairoContext"); context = @"XGContext";
else #elif (BUILD_GRAPHICS==GRAPHICS_winlib)
contextClass = NSClassFromString(@"XGContext"); 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]; [contextClass initializeBackend];
} }

View file

@ -31,7 +31,6 @@
#include <AppKit/NSPrintOperation.h> #include <AppKit/NSPrintOperation.h>
#include "cairo/CairoContext.h" #include "cairo/CairoContext.h"
#include "cairo/CairoGState.h"
#include "cairo/CairoSurface.h" #include "cairo/CairoSurface.h"
#include "cairo/CairoPSSurface.h" #include "cairo/CairoPSSurface.h"
#include "cairo/CairoPDFSurface.h" #include "cairo/CairoPDFSurface.h"
@ -42,7 +41,9 @@
#define CGSTATE ((CairoGState *)gstate) #define CGSTATE ((CairoGState *)gstate)
#if BUILD_SERVER == SERVER_x11 #if BUILD_SERVER == SERVER_x11
# include "cairo/CairoGState.h"
# include "x11/XGServer.h" # include "x11/XGServer.h"
# define _CAIRO_GSTATE_CLASSNAME CairoGState
# ifdef USE_GLITZ # ifdef USE_GLITZ
# define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface # define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface
# include "cairo/XGCairoGlitzSurface.h" # include "cairo/XGCairoGlitzSurface.h"
@ -57,7 +58,9 @@
# include "x11/XGServerWindow.h" # include "x11/XGServerWindow.h"
# include "x11/XWindowBuffer.h" # include "x11/XWindowBuffer.h"
#elif BUILD_SERVER == SERVER_win32 #elif BUILD_SERVER == SERVER_win32
# include "cairo/Win32CairoGState.h"
# include <windows.h> # include <windows.h>
# define _CAIRO_GSTATE_CLASSNAME Win32CairoGState
# ifdef USE_GLITZ # ifdef USE_GLITZ
# define _CAIRO_SURFACE_CLASSNAME Win32CairoGlitzSurface # define _CAIRO_SURFACE_CLASSNAME Win32CairoGlitzSurface
# include "cairo/Win32CairoGlitzSurface.h" # include "cairo/Win32CairoGlitzSurface.h"
@ -92,7 +95,7 @@
+ (Class) GStateClass + (Class) GStateClass
{ {
return [CairoGState class]; return [_CAIRO_GSTATE_CLASSNAME class];
} }
+ (BOOL) handlesPS + (BOOL) handlesPS
@ -120,23 +123,27 @@
#endif // BUILD_SERVER = SERVER_x11 #endif // BUILD_SERVER = SERVER_x11
} }
#if BUILD_SERVER == SERVER_x11
/* Private backend methods */ /* Private backend methods */
+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver
{ {
#if BUILD_SERVER == SERVER_x11
if ([(id)driver isKindOfClass: [XWindowBuffer class]]) if ([(id)driver isKindOfClass: [XWindowBuffer class]])
{ {
// For XGCairoXImageSurface // For XGCairoXImageSurface
[(XWindowBuffer *)driver _exposeRect: rect]; [(XWindowBuffer *)driver _exposeRect: rect];
} }
else if ([(id)driver isKindOfClass: [CairoSurface class]]) else
#endif
if ([(id)driver isKindOfClass: [CairoSurface class]])
{ {
// For XGCairoModernSurface // For XGCairoModernSurface
[(CairoSurface *)driver handleExposeRect: rect]; [(CairoSurface *)driver handleExposeRect: rect];
} }
} }
#if BUILD_SERVER == SERVER_x11
#ifdef XSHM #ifdef XSHM
+ (void) _gotShmCompletion: (Drawable)d + (void) _gotShmCompletion: (Drawable)d
@ -292,3 +299,5 @@
@end @end
#undef _CAIRO_SURFACE_CLASSNAME #undef _CAIRO_SURFACE_CLASSNAME
#undef _CAIRO_GSTATE_CLASSNAME

View file

@ -1,3 +1,4 @@
/* /*
CairoGState.m CairoGState.m
@ -124,8 +125,10 @@ static inline float floatToUserSpace(NSAffineTransform *ctm, double d)
- (NSString*) description - (NSString*) description
{ {
return [NSString stringWithFormat: @"%@ surface: %@ context: %p", NSMutableString *description = [[[super description] mutableCopy] autorelease];
[super description], _surface, _ct]; [description appendFormat: @" surface: %@",_surface];
[description appendFormat: @" context: %p",_ct];
return [[description copy] autorelease];
} }
- (id) copyWithZone: (NSZone *)zone - (id) copyWithZone: (NSZone *)zone
@ -1257,6 +1260,8 @@ _set_op(cairo_t *ct, NSCompositingOperation op)
cairo_pattern_t *cpattern; cairo_pattern_t *cpattern;
cairo_matrix_t source_matrix; cairo_matrix_t source_matrix;
NSDebugMLLog(@"CairoGState", @"%self: %@\n", self);
if (!_ct || !source->_ct) if (!_ct || !source->_ct)
{ {
return; 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 local_matrix;
cairo_matrix_t source_matrix; cairo_matrix_t source_matrix;
NSDebugMLLog(@"CairoGState", @"source: %@ fromRect: %@ toPoint: %@\n",
source,
NSStringFromRect(aRect),
NSStringFromPoint(aPoint));
if (!_ct || !source->_ct) if (!_ct || !source->_ct)
{ {
NSLog(@"WARNING: -drawGState called with a NULL target context (%p) or source context (%p)", NSLog(@"WARNING: -drawGState called with a NULL target context (%p) or source context (%p)",

View file

@ -58,13 +58,13 @@
cairo_pdf_surface_set_size(_surface, size.width, size.height); cairo_pdf_surface_set_size(_surface, size.width, size.height);
} }
- (void) writeComment: (NSString *)comment
{
}
- (BOOL) isDrawingToScreen - (BOOL) isDrawingToScreen
{ {
return NO; return NO;
} }
- (void) writeComment: (NSString *)comment
{
}
@end @end

View file

@ -49,7 +49,7 @@ else
ifeq ($(WITH_GLITZ),yes) ifeq ($(WITH_GLITZ),yes)
cairo_OBJC_FILES += Win32CairoGlitzSurface.m cairo_OBJC_FILES += Win32CairoGlitzSurface.m
else else
cairo_OBJC_FILES += Win32CairoSurface.m cairo_OBJC_FILES += Win32CairoSurface.m Win32CairoGState.m
# Win32CairoXImageSurface.m # Win32CairoXImageSurface.m
endif endif
endif endif

View file

@ -27,47 +27,240 @@
*/ */
#include "cairo/Win32CairoSurface.h" #include "cairo/Win32CairoSurface.h"
#include "win32/WIN32Geometry.h"
#include <cairo-win32.h> #include <cairo-win32.h>
#define GSWINDEVICE ((HWND)gsDevice) #define GSWINDEVICE ((HWND)gsDevice)
@implementation Win32CairoSurface @implementation Win32CairoSurface
- (id) initWithDevice: (void *)device - (id) initWithDevice: (void *)device
{ {
HDC hDC; // Save/set initial state...
WIN_INTERN *win;
gsDevice = device; gsDevice = device;
_surface = NULL;
win = (WIN_INTERN *)GetWindowLong(GSWINDEVICE, GWL_USERDATA); WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(GSWINDEVICE, GWL_USERDATA);
if (win && win->useHDC) HDC hDC = GetDC(GSWINDEVICE);
hDC = win->hdc;
else
hDC = GetDC(GSWINDEVICE);
if (!hDC) if (hDC == NULL)
{ {
NSLog(@"Win32CairoSurface : %d : no device context",__LINE__); NSWarnMLog(@"Win32CairoSurface line: %d : no device context", __LINE__);
exit(1);
}
_surface = cairo_win32_surface_create(hDC); // And deallocate ourselves...
if (!(win && win->useHDC))
ReleaseDC(GSWINDEVICE, hDC);
if (cairo_surface_status(_surface))
{
DESTROY(self); 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; 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 - (NSSize) size
{ {
RECT sz; RECT csize;
GetClientRect(GSWINDEVICE, &sz); GetClientRect(GSWINDEVICE, &csize);
return NSMakeSize(sz.right - sz.left, sz.top - sz.bottom); 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 @end

View file

@ -103,8 +103,10 @@
- (NSString*) description - (NSString*) description
{ {
return [NSString stringWithFormat: @"%@ drawcontext: %@ ctm: %@", NSMutableString *description = [[super description] mutableCopy];
[super description], drawcontext, ctm]; [description appendFormat: @" drawcontext: %@",drawcontext];
[description appendFormat: @" ctm: %@",ctm];
return [description copy];
} }
- copyWithZone: (NSZone *)zone - copyWithZone: (NSZone *)zone

File diff suppressed because it is too large Load diff

View file

@ -337,7 +337,6 @@ static Win32GLContext *currentGLContext;
- (id)initWithCGLContextObj: (void *)context - (id)initWithCGLContextObj: (void *)context
{ {
self = [super init]; self = [super init];
if (!self) if (!self)
{ {
return nil; return nil;

View file

@ -26,6 +26,7 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#include "config.h"
#include <AppKit/NSEvent.h> #include <AppKit/NSEvent.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
#include <Foundation/NSBundle.h> #include <Foundation/NSBundle.h>
@ -35,6 +36,7 @@
@implementation WIN32Server (w32_create) @implementation WIN32Server (w32_create)
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam - (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd : (HWND)hwnd
{ {
@ -45,6 +47,7 @@
: (HWND)hwnd : (HWND)hwnd
{ {
WIN_INTERN *win; WIN_INTERN *win;
IME_INFO_T *ime;
NSBackingStoreType type = (NSBackingStoreType)((LPCREATESTRUCT)lParam)->lpCreateParams; NSBackingStoreType type = (NSBackingStoreType)((LPCREATESTRUCT)lParam)->lpCreateParams;
NSBundle *bundle = [NSBundle mainBundle]; NSBundle *bundle = [NSBundle mainBundle];
NSString *iconName = nil; NSString *iconName = nil;
@ -56,9 +59,17 @@
is stored in the extra fields for this window. Drawing operations is stored in the extra fields for this window. Drawing operations
work on this buffer. */ work on this buffer. */
win = malloc(sizeof(WIN_INTERN)); win = malloc(sizeof(WIN_INTERN));
ime = malloc(sizeof(IME_INFO_T));
// Initialize win internals structure...
memset(win, 0, sizeof(WIN_INTERN)); memset(win, 0, sizeof(WIN_INTERN));
memset(ime, 0, sizeof(IME_INFO_T));
win->type = type;
win->useHDC = NO; win->useHDC = NO;
// Save win internals structure pointer for window handle...
SetWindowLong(hwnd, GWL_USERDATA, (int)win); SetWindowLong(hwnd, GWL_USERDATA, (int)win);
SetWindowLongPtr(hwnd, IME_INFO, (LONG)ime);
[self windowbacking: type : (int)hwnd]; [self windowbacking: type : (int)hwnd];
@ -91,7 +102,7 @@
cpath, cpath,
IMAGE_ICON,0,0, IMAGE_ICON,0,0,
LR_DEFAULTSIZE|LR_LOADFROMFILE); LR_DEFAULTSIZE|LR_LOADFROMFILE);
SetClassLongPtr(hwnd,GCLP_HICON, (LONG_PTR)icon); SetClassLongPtr(hwnd,GCLP_HICON,(LONG_PTR)icon);
} }
return 0; return 0;

View file

@ -75,6 +75,7 @@
DeleteDC(win->hdc); DeleteDC(win->hdc);
} }
free(win); free(win);
free((IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO));
flags._eventHandled=YES; flags._eventHandled=YES;
} }

View file

@ -33,6 +33,8 @@
- (LRESULT) decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam - (LRESULT) decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{ {
if (flags.HOLD_MINI_FOR_SIZE == FALSE)
{
NSPoint eventLocation; NSPoint eventLocation;
NSRect rect; NSRect rect;
RECT r; RECT r;
@ -55,6 +57,7 @@
//need native code here? //need native code here?
[EVENT_WINDOW(hwnd) sendEvent: ev]; [EVENT_WINDOW(hwnd) sendEvent: ev];
}
return 0; return 0;
} }
@ -127,59 +130,11 @@
- (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd - (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{ {
// stub for future dev #if 0
DefWindowProc(hwnd, WM_NCCALCSIZE, wParam, lParam);
/*NCCALCSIZE_PARAMS * newRects; flags._eventHandled = YES;
#endif
NSPoint eventLocation; return;
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");*/
} }
- (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd - (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
@ -292,7 +247,7 @@
{ {
higher = HWND_TOP; higher = HWND_TOP;
} }
NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll); NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
SetWindowPos(lo, higher, 0, 0, 0, 0, SetWindowPos(lo, higher, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
@ -344,6 +299,11 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
return 0; 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 - (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{ {
// may have a small bug here note it for follow up // 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. no posting is needed.
*/ */
[self resizeBackingStoreFor: hwnd]; [self resizeBackingStoreFor: hwnd];
[self decodeWM_MOVEParams:hwnd :wParam :lParam]; // [self decodeWM_MOVEParams:hwnd :wParam :lParam];
[self decodeWM_SIZEParams:hwnd :wParam :lParam]; // [self decodeWM_SIZEParams:hwnd :wParam :lParam];
//Make sure DefWindowProc gets called //Make sure DefWindowProc gets called
return 0; return DefWindowProc(hwnd, WM_EXITSIZEMOVE, wParam, lParam);
} }
- (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam - (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
@ -367,8 +327,8 @@ NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll);
- (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam - (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;
} }

View file

@ -55,6 +55,7 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
win->backingStoreEmpty = NO; win->backingStoreEmpty = NO;
} }
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
if (win->useHDC) if (win->useHDC)
{ {
HDC hdc = GetDC((HWND)hwnd); HDC hdc = GetDC((HWND)hwnd);
@ -65,10 +66,11 @@ invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
win->hdc, rect.left, rect.top, SRCCOPY); win->hdc, rect.left, rect.top, SRCCOPY);
if (!result) if (!result)
{ {
NSLog(@"validateWindow failed %d", GetLastError()); NSWarnMLog(@"validateWindow failed %d", GetLastError());
} }
ReleaseDC((HWND)hwnd, hdc); ReleaseDC((HWND)hwnd, hdc);
} }
#endif
} }
@implementation WIN32Server (w32_windowdisplay) @implementation WIN32Server (w32_windowdisplay)

View file

@ -47,7 +47,7 @@ ADDITIONAL_CFLAGS = -DWINVER=0x0500
# Additional include directories the compiler should search # Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ 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 to pass to the linker
# ADDITIONAL_LDFLAGS = # ADDITIONAL_LDFLAGS =

View file

@ -3,6 +3,11 @@
#define SERVER_x11 1 #define SERVER_x11 1
#define SERVER_win32 2 #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 */ /* Define to type of graphics context to build */

159
configure vendored
View file

@ -613,6 +613,8 @@ GLITZ_GLX_LIBS
GLITZ_GLX_CFLAGS GLITZ_GLX_CFLAGS
GLITZ_LIBS GLITZ_LIBS
GLITZ_CFLAGS GLITZ_CFLAGS
FONTCONFIG_LIBS
FONTCONFIG_CFLAGS
CAIRO_GLITZ_LIBS CAIRO_GLITZ_LIBS
CAIRO_GLITZ_CFLAGS CAIRO_GLITZ_CFLAGS
CAIRO_WIN32_LIBS CAIRO_WIN32_LIBS
@ -5584,6 +5586,45 @@ fi
if test "$have_msimg32" = yes; then if test "$have_msimg32" = yes; then
WIN32_LIBS="${WIN32_LIBS} -lmsimg32" WIN32_LIBS="${WIN32_LIBS} -lmsimg32"
fi 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 # WGL support
@ -6251,6 +6292,106 @@ $as_echo "$CAIRO_GLITZ_LIBS" >&6; }
have_cairo_glitz=no have_cairo_glitz=no
fi 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 if test "$have_cairo" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_create in -lcairo" >&5 { $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 BUILD_GRAPHICS=art
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 { $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;} $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;}
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Cairo backend" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Cairo backend" >&5
$as_echo_n "checking Cairo backend... " >&6; } $as_echo_n "checking Cairo backend... " >&6; }
CAIRO_LIBS="$CAIRO_FT_LIBS" CAIRO_LIBS="$CAIRO_FT_LIBS"
CAIRO_CFLAGS="$CAIRO_FT_CFLAGS" 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 "$have_xrender" = yes; then
if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; 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" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: winlib" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: winlib" >&5
$as_echo "winlib" >&6; } $as_echo "winlib" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** Cairo backend on win32 is experimental and is not supported." >&5 #AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.])
$as_echo "$as_me: WARNING: **** Cairo backend on win32 is experimental and is not supported." >&2;} #AC_MSG_WARN([**** Are you a backend developer ?])
{ $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;}
elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS" CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS"
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS"
@ -7057,7 +7206,7 @@ _ACEOF
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define BUILD_GRAPHICS $BUILD_GRAPHICS #define BUILD_GRAPHICS GRAPHICS_$BUILD_GRAPHICS
_ACEOF _ACEOF

View file

@ -354,6 +354,10 @@ AC_CHECK_LIB(msimg32, main, have_msimg32=yes, have_msimg32=no)
if test "$have_msimg32" = yes; then if test "$have_msimg32" = yes; then
WIN32_LIBS="${WIN32_LIBS} -lmsimg32" WIN32_LIBS="${WIN32_LIBS} -lmsimg32"
fi 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 # 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_CHECK_MODULES(CAIRO_WIN32, cairo-win32, have_cairo_win32=yes, have_cairo_win32=no)
PKG_CAIRO_GLITZ=no PKG_CAIRO_GLITZ=no
PKG_CHECK_MODULES(CAIRO_GLITZ, cairo-glitz, have_cairo_glitz=yes, have_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 if test "$have_cairo" = no; then
AC_CHECK_LIB(cairo, cairo_create, have_cairo=yes) AC_CHECK_LIB(cairo, cairo_create, have_cairo=yes)
@ -551,10 +557,18 @@ if test x"$BUILD_GRAPHICS" = "xcairo"; then
BUILD_GRAPHICS=art BUILD_GRAPHICS=art
fi fi
AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) 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 else
AC_MSG_CHECKING(Cairo backend) AC_MSG_CHECKING(Cairo backend)
CAIRO_LIBS="$CAIRO_FT_LIBS" CAIRO_LIBS="$CAIRO_FT_LIBS"
CAIRO_CFLAGS="$CAIRO_FT_CFLAGS" 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 "$have_xrender" = yes; then
if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
@ -583,8 +597,8 @@ if test x"$BUILD_GRAPHICS" = "xcairo"; then
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_WIN32_LIBS $WIN32_LIBS" CAIRO_LIBS="$CAIRO_LIBS $CAIRO_WIN32_LIBS $WIN32_LIBS"
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS"
AC_MSG_RESULT(winlib) AC_MSG_RESULT(winlib)
AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.]) #AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.])
AC_MSG_WARN([**** Are you a backend developer ?]) #AC_MSG_WARN([**** Are you a backend developer ?])
elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS" CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS"
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS"
@ -669,10 +683,15 @@ fi
AH_TOP([ AH_TOP([
#define SERVER_x11 1 #define SERVER_x11 1
#define SERVER_win32 2 #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, AC_DEFINE_UNQUOTED(BUILD_SERVER,SERVER_$BUILD_SERVER,
[Define to type of window server to build]) [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]) [Define to type of graphics context to build])
AC_SUBST(BUILD_GRAPHICS) AC_SUBST(BUILD_GRAPHICS)
AC_SUBST(BUILD_SERVER) AC_SUBST(BUILD_SERVER)