Minimal code for dummy graphics backend now implemented for Opal backend.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36757 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ivan Vučica 2013-06-25 17:13:37 +00:00
parent 248caad5d0
commit c1cd79d4af
13 changed files with 529 additions and 0 deletions

View file

@ -1,3 +1,18 @@
2013-06-25 Ivan Vucica <ivan@vucica.net>
* Source/opal/OpalFontInfo.m:
* Source/opal/OpalContext.m:
* Source/opal/OpalGState.m:
* Source/opal/OpalFontEnumerator.m:
* Source/opal/OpalSurface.m:
* Headers/opal/OpalFontInfo.h:
* Headers/opal/OpalContext.h:
* Headers/opal/OpalGState.h:
* Headers/opal/OpalFontEnumerator.h:
* Headers/opal/OpalSurface.h:
Minimal code for dummy graphics backend now implemented for
Opal backend.
2013-06-23 Ivan Vucica <ivan@vucica.net>
* config.h.in:

View file

View file

@ -0,0 +1,45 @@
/*
OpalContext.h
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef OpalContext_h_defined
#define OpalContext_h_defined
#import "gsc/GSContext.h"
@interface OpalContext : GSContext
{
}
+ (void) initializeBackend;
+ (Class) GStateClass;
- (void) GSSetDevice: (void *)device
: (int)x
: (int)y;
@end
#endif

View file

@ -0,0 +1,43 @@
/*
OpalFontEnumerator.h
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef OpalFontEnumerator_h_defined
#define OpalFontEnumerator_h_defined
#import <GNUstepGUI/GSFontInfo.h>
@interface OpalFontEnumerator : GSFontEnumerator
{
}
- (void) enumerateFontsAndFamilies;
@end
#endif

View file

@ -0,0 +1,45 @@
/*
OpalFontInfo.h
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef OpalFontInfo_h_defined
#define OpalFontInfo_h_defined
#import <GNUstepGUI/GSFontInfo.h>
@interface OpalFontInfo : GSFontInfo
{
}
- (id) initWithFontName: (NSString *)name
matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)p_screenFont;
@end
#endif

36
Headers/opal/OpalGState.h Normal file
View file

@ -0,0 +1,36 @@
/*
OpalGState.h
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "gsc/GSGState.h"
@interface OpalGState : GSGState
{
}
- (void) DPSinitclip;
@end

View file

@ -0,0 +1,36 @@
/*
OpalSurface.h
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import <Foundation/Foundation.h>
@interface OpalSurface : NSObject
{
}
- (id) initWithDevice: (void *)device;
@end

View file

@ -0,0 +1,52 @@
#
# GNUmakefile.preamble
#
# Copyright (C) 2002 Free Software Foundation, Inc.
#
# Author: Adam Fedor <fedor@gnu.org>
#
# This file is part of the GNUstep Backend.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; see the file COPYING.LIB.
# If not, see <http://www.gnu.org/licenses/> or write to the
# Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# Flags dealing with compiling and linking
#
# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS)
# Additional flags to pass to the Objective-C compiler
#ADDITIONAL_OBJCFLAGS =
# Additional flags to pass to the C compiler
#ADDITIONAL_CFLAGS =
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS = -I../../Headers \
-I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) \
# Additional LDFLAGS to pass to the linker
#ADDITIONAL_LDFLAGS =
# Additional library directories the linker should search
#ADDITIONAL_LIB_DIRS =
#
# Flags dealing with installing and uninstalling
#

View file

@ -0,0 +1,67 @@
/*
OpalContext.m
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "opal/OpalContext.h"
#import "opal/OpalFontInfo.h"
#import "opal/OpalFontEnumerator.h"
#import "opal/OpalSurface.h"
#import "opal/OpalGState.h"
#define OGSTATE ((OpalGState *)gstate)
@implementation OpalContext
+ (void) initializeBackend
{
[NSGraphicsContext setDefaultContextClass: self];
[GSFontEnumerator setDefaultClass: [OpalFontEnumerator class]];
[GSFontInfo setDefaultClass: [OpalFontInfo class]];
}
+ (Class) GStateClass
{
return [OpalGState class];
}
- (void) GSSetDevice: (void *)device
: (int)x
: (int)y
{
OpalSurface *surface;
surface = [[OpalSurface alloc] initWithDevice: device];
/*
[OGSTATE GSSetSurface: surface
: x
: y];
*/
[surface release];
}
@end

View file

@ -0,0 +1,37 @@
/*
OpalFontEnumerator.m
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "opal/OpalFontEnumerator.h"
@implementation OpalFontEnumerator
- (void) enumerateFontsAndFamilies
{
}
@end

View file

@ -0,0 +1,39 @@
/*
OpalFontInfo.m
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "opal/OpalFontInfo.h"
@implementation OpalFontInfo
- (id) initWithFontName: (NSString *)name
matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)p_screenFont
{
return [super init];
}
@end

View file

@ -0,0 +1,77 @@
/*
OpalGState.m
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "opal/OpalGState.h"
@implementation OpalGState
- (void) DPSinitclip
{
}
- (void) DPSclip
{
}
- (void) DPSfill
{
}
- (void) DPSimage: (NSAffineTransform *)matrix
: (NSInteger)pixelsWide
: (NSInteger)pixelsHigh
: (NSInteger)bitsPerSample
: (NSInteger)samplesPerPixel
: (NSInteger)bitsPerPixel
: (NSInteger)bytesPerRow
: (BOOL)isPlanar
: (BOOL)hasAlpha
: (NSString *)colorSpaceName
: (const unsigned char *const[5])data
{
}
- (void) compositeGState: (OpalGState *)source
fromRect: (NSRect)srcRect
toPoint: (NSPoint)destPoint
op: (NSCompositingOperation)op
fraction: (CGFloat)delta
{
}
- (void) compositerect: (NSRect)aRect
op: (NSCompositingOperation)op
{
}
@end

View file

@ -0,0 +1,37 @@
/*
OpalSurface.m
Copyright (C) 2013 Free Software Foundation, Inc.
Author: Ivan Vucica <ivan@vucica.net>
Date: June 2013
This file is part of GNUstep.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "opal/OpalSurface.h"
@implementation OpalSurface
- (id) initWithDevice: (void *)device
{
return [super init];
}
@end