mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
Merge back with main branch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/gnustep_testplant_branch@35813 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f018376f12
commit
aae0f7748c
14 changed files with 312 additions and 47 deletions
|
@ -44,6 +44,8 @@
|
|||
|
||||
- (void) handleExposeRect: (NSRect)rect;
|
||||
|
||||
- (BOOL) isDrawingToScreen;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -108,6 +108,13 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
CairoSurface *surface = nil;
|
||||
[CGSTATE GSCurrentSurface: &surface : NULL : NULL];
|
||||
return [surface isDrawingToScreen];
|
||||
}
|
||||
|
||||
- (void) flushGraphics
|
||||
{
|
||||
// FIXME: Why is this here? When is it called?
|
||||
|
@ -292,3 +299,5 @@
|
|||
@end
|
||||
|
||||
#undef _CAIRO_SURFACE_CLASSNAME
|
||||
#undef _CAIRO_GSTATE_CLASSNAME
|
||||
|
||||
|
|
|
@ -212,33 +212,71 @@ static NSArray *faFromFc(FcPattern *pat)
|
|||
- (NSString *) defaultSystemFontName
|
||||
{
|
||||
if ([allFontNames containsObject: @"Bitstream Vera Sans"])
|
||||
return @"Bitstream Vera Sans";
|
||||
{
|
||||
return @"Bitstream Vera Sans";
|
||||
}
|
||||
if ([allFontNames containsObject: @"FreeSans"])
|
||||
return @"FreeSans";
|
||||
{
|
||||
return @"FreeSans";
|
||||
}
|
||||
if ([allFontNames containsObject: @"DejaVu Sans"])
|
||||
return @"DejaVu Sans";
|
||||
{
|
||||
return @"DejaVu Sans";
|
||||
}
|
||||
if ([allFontNames containsObject: @"Tahoma"])
|
||||
{
|
||||
return @"Tahoma";
|
||||
}
|
||||
if ([allFontNames containsObject: @"Arial"])
|
||||
{
|
||||
return @"Arial";
|
||||
}
|
||||
return @"Helvetica";
|
||||
}
|
||||
|
||||
- (NSString *) defaultBoldSystemFontName
|
||||
{
|
||||
if ([allFontNames containsObject: @"Bitstream Vera Sans-Bold"])
|
||||
return @"Bitstream Vera Sans-Bold";
|
||||
{
|
||||
return @"Bitstream Vera Sans-Bold";
|
||||
}
|
||||
if ([allFontNames containsObject: @"FreeSans-Bold"])
|
||||
return @"FreeSans-Bold";
|
||||
{
|
||||
return @"FreeSans-Bold";
|
||||
}
|
||||
if ([allFontNames containsObject: @"DejaVu Sans-Bold"])
|
||||
return @"DejaVu Sans-Bold";
|
||||
{
|
||||
return @"DejaVu Sans-Bold";
|
||||
}
|
||||
if ([allFontNames containsObject: @"Tahoma-Bold"])
|
||||
{
|
||||
return @"Tahoma-Bold";
|
||||
}
|
||||
if ([allFontNames containsObject: @"Arial-Bold"])
|
||||
{
|
||||
return @"Arial-Bold";
|
||||
}
|
||||
return @"Helvetica-Bold";
|
||||
}
|
||||
|
||||
- (NSString *) defaultFixedPitchFontName
|
||||
{
|
||||
if ([allFontNames containsObject: @"Bitstream Vera Sans Mono"])
|
||||
return @"Bitstream Vera Sans Mono";
|
||||
{
|
||||
return @"Bitstream Vera Sans Mono";
|
||||
}
|
||||
if ([allFontNames containsObject: @"FreeMono"])
|
||||
return @"FreeMono";
|
||||
{
|
||||
return @"FreeMono";
|
||||
}
|
||||
if ([allFontNames containsObject: @"DejaVu Sans Mono"])
|
||||
return @"DejaVu Sans Mono";
|
||||
{
|
||||
return @"DejaVu Sans Mono";
|
||||
}
|
||||
if ([allFontNames containsObject: @"Courier New"])
|
||||
{
|
||||
return @"Courier New";
|
||||
}
|
||||
return @"Courier";
|
||||
}
|
||||
|
||||
|
|
|
@ -1260,7 +1260,7 @@ _set_op(cairo_t *ct, NSCompositingOperation op)
|
|||
cairo_pattern_t *cpattern;
|
||||
cairo_matrix_t source_matrix;
|
||||
|
||||
NSDebugLLog(@"CairoGState", @"%s:self: %@\n", __PRETTY_FUNCTION__, self);
|
||||
NSDebugMLLog(@"CairoGState", @"%self: %@\n", self);
|
||||
|
||||
if (!_ct || !source->_ct)
|
||||
{
|
||||
|
@ -1384,10 +1384,10 @@ doesn't support to use the receiver cairo target as the source. */
|
|||
cairo_matrix_t local_matrix;
|
||||
cairo_matrix_t source_matrix;
|
||||
|
||||
NSDebugLLog(@"CairoGState", @"%s - source: %@ fromRect: %@ toPoint: %@\n", __PRETTY_FUNCTION__,
|
||||
source,
|
||||
NSStringFromRect(aRect),
|
||||
NSStringFromPoint(aPoint));
|
||||
NSDebugMLLog(@"CairoGState", @"source: %@ fromRect: %@ toPoint: %@\n",
|
||||
source,
|
||||
NSStringFromRect(aRect),
|
||||
NSStringFromPoint(aPoint));
|
||||
|
||||
if (!_ct || !source->_ct)
|
||||
{
|
||||
|
|
|
@ -58,6 +58,11 @@
|
|||
cairo_pdf_surface_set_size(_surface, size.width, size.height);
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) writeComment: (NSString *)comment
|
||||
{
|
||||
}
|
||||
|
|
|
@ -62,4 +62,9 @@
|
|||
cairo_ps_surface_dsc_comment(_surface, [comment UTF8String]);
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -69,4 +69,9 @@
|
|||
{
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -319,6 +319,14 @@ fpfloat(FILE *stream, float f)
|
|||
}
|
||||
}
|
||||
|
||||
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs
|
||||
: (const NSSize *)advances
|
||||
: (size_t)length
|
||||
{
|
||||
// FIXME: Currently advances is ignored
|
||||
[self GSShowGlyphs: glyphs : length];
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* Gstate Handling */
|
||||
|
|
|
@ -1017,13 +1017,13 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
{
|
||||
TCHAR composition[length+sizeof(TCHAR)];
|
||||
length = ImmGetCompositionStringW(immc, GCS_RESULTSTR, &composition, length);
|
||||
NSString *uKeys = [NSString stringWithCharacters: (unichar*)composition length: length];
|
||||
{
|
||||
int index;
|
||||
for (index = 0; index < length; ++index)
|
||||
IMEDebugLog(@"%2.2X ", composition[index]);
|
||||
}
|
||||
IMEDebugLog(@"composition (uKeys): %@\n", uKeys);
|
||||
IMEDebugLog(@"composition (uKeys): %@\n",
|
||||
[NSString stringWithCharacters: (unichar*)composition length: length]);
|
||||
}
|
||||
ImmReleaseContext(hwnd, immc);
|
||||
}
|
||||
|
|
|
@ -71,39 +71,19 @@
|
|||
SetWindowLong(hwnd, GWL_USERDATA, (int)win);
|
||||
SetWindowLongPtr(hwnd, IME_INFO, (LONG)ime);
|
||||
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
if (type != NSBackingStoreNonretained)
|
||||
{
|
||||
HDC hdc, hdc2;
|
||||
HBITMAP hbitmap;
|
||||
RECT r;
|
||||
|
||||
GetClientRect((HWND)hwnd, &r);
|
||||
hdc = GetDC(hwnd);
|
||||
hdc2 = CreateCompatibleDC(hdc);
|
||||
hbitmap = CreateCompatibleBitmap(hdc, r.right - r.left,
|
||||
r.bottom - r.top);
|
||||
win->old = SelectObject(hdc2, hbitmap);
|
||||
|
||||
win->hdc = hdc2;
|
||||
|
||||
win->useHDC = YES;
|
||||
|
||||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
#endif
|
||||
[self windowbacking: type : (int)hwnd];
|
||||
|
||||
// Find the icon file, assume it has the same name as the "icon" which
|
||||
// was specified in the bundle's dictionary...
|
||||
iconName = [[bundle infoDictionary] objectForKey: @"NSIcon"];
|
||||
if(iconName == nil)
|
||||
if (iconName == nil)
|
||||
{
|
||||
iconName = [[bundle infoDictionary]
|
||||
objectForKey: @"CFBundleIconFile"];
|
||||
}
|
||||
|
||||
// If the icon name is set, get the path...
|
||||
if(iconName != nil)
|
||||
if (iconName != nil)
|
||||
{
|
||||
iconName = [iconName stringByDeletingPathExtension];
|
||||
iconPath = [[NSBundle mainBundle] pathForResource: iconName
|
||||
|
@ -113,7 +93,7 @@
|
|||
|
||||
// If the path is set, load the icon file and set it as the
|
||||
// icon on the window.
|
||||
if(iconPath != nil)
|
||||
if (iconPath != nil)
|
||||
{
|
||||
HICON icon = NULL;
|
||||
const char *cpath = [iconPath cString];
|
||||
|
|
|
@ -301,6 +301,13 @@ static XGGLContext *currentGLContext;
|
|||
return glx_context;
|
||||
}
|
||||
|
||||
- (void *)CGLContextObj
|
||||
{
|
||||
// FIXME: Until we have a wrapper library
|
||||
// return the underlying context directly
|
||||
return (void*)glx_context;
|
||||
}
|
||||
|
||||
- (void)clearDrawable
|
||||
{
|
||||
[self _detach];
|
||||
|
@ -360,6 +367,20 @@ static XGGLContext *currentGLContext;
|
|||
[self notImplemented: _cmd];
|
||||
}
|
||||
|
||||
- (id)initWithCGLContextObj: (void *)context
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
// FIXME: Need to set the pixelFormat ivar
|
||||
glx_context = context;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithFormat: (NSOpenGLPixelFormat *)_format
|
||||
shareContext: (NSOpenGLContext *)share
|
||||
{
|
||||
|
|
|
@ -4348,7 +4348,9 @@ xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data,
|
|||
}
|
||||
|
||||
// FIXME: Factor this out
|
||||
// Convert RGBA unpacked to BGRA packed
|
||||
// Convert RGBA unpacked to ARGB packed
|
||||
// NB Packed ARGB values are layed out as ARGB on big endian systems
|
||||
// and as BDRA on low endian systems
|
||||
{
|
||||
NSInteger stride;
|
||||
NSInteger x, y;
|
||||
|
@ -4362,14 +4364,16 @@ xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data,
|
|||
for (x = 0; x < w; x++)
|
||||
{
|
||||
NSInteger i = (y * stride) + (x * 4);
|
||||
#if GS_WORDS_BIGENDIAN
|
||||
unsigned char d = cdata[i + 3];
|
||||
|
||||
cdata[i + 3] = cdata[i + 2];
|
||||
cdata[i + 2] = cdata[i + 1];
|
||||
cdata[i + 1] = cdata[i];
|
||||
cdata[i] = d;
|
||||
#else
|
||||
unsigned char d = cdata[i];
|
||||
|
||||
#if GS_WORDS_BIGENDIAN
|
||||
cdata[i] = cdata[i + 1];
|
||||
cdata[i + 1] = cdata[i + 2];
|
||||
cdata[i + 2] = cdata[i + 3];
|
||||
cdata[i + 3] = d;
|
||||
#else
|
||||
cdata[i] = cdata[i + 2];
|
||||
//cdata[i + 1] = cdata[i + 1];
|
||||
cdata[i + 2] = d;
|
||||
|
|
172
configure
vendored
172
configure
vendored
|
@ -6385,6 +6385,178 @@ $as_echo "$FONTCONFIG_LIBS" >&6; }
|
|||
fi
|
||||
|
||||
|
||||
if test "$have_cairo" = no; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_create in -lcairo" >&5
|
||||
$as_echo_n "checking for cairo_create in -lcairo... " >&6; }
|
||||
if test "${ac_cv_lib_cairo_cairo_create+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcairo $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char cairo_create ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return cairo_create ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_cairo_cairo_create=yes
|
||||
else
|
||||
ac_cv_lib_cairo_cairo_create=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_cairo_cairo_create" >&5
|
||||
$as_echo "$ac_cv_lib_cairo_cairo_create" >&6; }
|
||||
if test "x$ac_cv_lib_cairo_cairo_create" = x""yes; then :
|
||||
have_cairo=yes
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$have_cairo_ft" = no; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_ft_font_face_create_for_ft_face in -lcairo" >&5
|
||||
$as_echo_n "checking for cairo_ft_font_face_create_for_ft_face in -lcairo... " >&6; }
|
||||
if test "${ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcairo $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char cairo_ft_font_face_create_for_ft_face ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return cairo_ft_font_face_create_for_ft_face ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face=yes
|
||||
else
|
||||
ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face=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_cairo_cairo_ft_font_face_create_for_ft_face" >&5
|
||||
$as_echo "$ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face" >&6; }
|
||||
if test "x$ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face" = x""yes; then :
|
||||
have_cairo_ft=yes
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$have_cairo_xlib" = no; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_xlib_surface_create in -lcairo" >&5
|
||||
$as_echo_n "checking for cairo_xlib_surface_create in -lcairo... " >&6; }
|
||||
if test "${ac_cv_lib_cairo_cairo_xlib_surface_create+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcairo $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char cairo_xlib_surface_create ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return cairo_xlib_surface_create ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_cairo_cairo_xlib_surface_create=yes
|
||||
else
|
||||
ac_cv_lib_cairo_cairo_xlib_surface_create=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_cairo_cairo_xlib_surface_create" >&5
|
||||
$as_echo "$ac_cv_lib_cairo_cairo_xlib_surface_create" >&6; }
|
||||
if test "x$ac_cv_lib_cairo_cairo_xlib_surface_create" = x""yes; then :
|
||||
have_cairo_xlib=yes
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$have_cairo_win32" = no; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_win32_surface_create in -lcairo" >&5
|
||||
$as_echo_n "checking for cairo_win32_surface_create in -lcairo... " >&6; }
|
||||
if test "${ac_cv_lib_cairo_cairo_win32_surface_create+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcairo $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char cairo_win32_surface_create ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return cairo_win32_surface_create ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_cairo_cairo_win32_surface_create=yes
|
||||
else
|
||||
ac_cv_lib_cairo_cairo_win32_surface_create=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_cairo_cairo_win32_surface_create" >&5
|
||||
$as_echo "$ac_cv_lib_cairo_cairo_win32_surface_create" >&6; }
|
||||
if test "x$ac_cv_lib_cairo_cairo_win32_surface_create" = x""yes; then :
|
||||
have_cairo_win32=yes
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# XRender support
|
||||
#--------------------------------------------------------------------
|
||||
|
|
16
configure.ac
16
configure.ac
|
@ -430,6 +430,22 @@ PKG_CHECK_MODULES(CAIRO_GLITZ, cairo-glitz, have_cairo_glitz=yes, have_cairo_gli
|
|||
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)
|
||||
fi
|
||||
|
||||
if test "$have_cairo_ft" = no; then
|
||||
AC_CHECK_LIB(cairo, cairo_ft_font_face_create_for_ft_face, have_cairo_ft=yes)
|
||||
fi
|
||||
|
||||
if test "$have_cairo_xlib" = no; then
|
||||
AC_CHECK_LIB(cairo, cairo_xlib_surface_create, have_cairo_xlib=yes)
|
||||
fi
|
||||
|
||||
if test "$have_cairo_win32" = no; then
|
||||
AC_CHECK_LIB(cairo, cairo_win32_surface_create, have_cairo_win32=yes)
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# XRender support
|
||||
#--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue