mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
Add back-art.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@14304 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4800699534
commit
024087627d
9 changed files with 6256 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-08-20 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Headers/art/, Source/art/: Add back-art, a backend based on
|
||||
libart and freetype.
|
||||
|
||||
2002-08-15 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* configure.ac: Add NetBSD header/ldflag support (Patch from
|
||||
|
|
8
Headers/art/ARTContext.h
Normal file
8
Headers/art/ARTContext.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef ARTContext_h
|
||||
#define ARTContext_h
|
||||
|
||||
@interface ARTContext : GSContext
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
2968
Source/art/ARTContext.m
Normal file
2968
Source/art/ARTContext.m
Normal file
File diff suppressed because it is too large
Load diff
55
Source/art/GNUmakefile
Normal file
55
Source/art/GNUmakefile
Normal file
|
@ -0,0 +1,55 @@
|
|||
#
|
||||
# Main makefile for back-art
|
||||
#
|
||||
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Alexander Malmberg <alexander@malmberg.org>
|
||||
# Original 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 Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# If you are interested in a warranty or support for this source code,
|
||||
# contact Scott Christley at scottc@net-community.com
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB.
|
||||
# If not, write to the Free Software Foundation,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
|
||||
|
||||
GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
|
||||
|
||||
GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
include ../../config.make
|
||||
|
||||
SUBPROJECT_NAME=art
|
||||
|
||||
# The Objective-C source files to be compiled
|
||||
art_OBJC_FILES = \
|
||||
ARTContext.m blit.m ftfont.m
|
||||
|
||||
art_HEADER_FILES_DIR = ../../Headers/art
|
||||
art_HEADER_FILES_INSTALL_DIR = gnustep/art
|
||||
|
||||
art_HEADER_FILES = \
|
||||
ARTContext.h
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/subproject.make
|
||||
|
||||
-include GNUmakefile.postamble
|
||||
|
51
Source/art/GNUmakefile.preamble
Normal file
51
Source/art/GNUmakefile.preamble
Normal file
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# 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 Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB.
|
||||
# If not, write to the Free Software Foundation,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
|
||||
#
|
||||
|
156
Source/art/blit.h
Normal file
156
Source/art/blit.h
Normal file
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
copyright 2002 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
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 Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef blit_h
|
||||
#define blit_h
|
||||
|
||||
|
||||
/* TODO!!! */
|
||||
#include "config.h"
|
||||
#if BUILD_SERVER == SERVER_rds
|
||||
#define RDS
|
||||
#endif
|
||||
|
||||
|
||||
#include <libart_lgpl/libart.h>
|
||||
|
||||
/** Information about how we draw stuff **/
|
||||
|
||||
|
||||
typedef struct render_run_s
|
||||
{
|
||||
unsigned char r,g,b,a,real_a;
|
||||
unsigned char *dst,*dsta;
|
||||
|
||||
/* the following fields are only used by the svp rendering helpers */
|
||||
int x0,x1;
|
||||
int rowstride,arowstride,bpp;
|
||||
void (*run_alpha)(struct render_run_s *ri,int num);
|
||||
void (*run_opaque)(struct render_run_s *ri,int num);
|
||||
} render_run_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char *dst,*dsta;
|
||||
unsigned char *src,*srca;
|
||||
} composite_run_t;
|
||||
|
||||
|
||||
typedef struct draw_info_s
|
||||
{
|
||||
int how;
|
||||
#define DI_FALLBACK 0
|
||||
|
||||
/* counting from lsb */
|
||||
#define DI_16_B5_G5_R5_A1 1
|
||||
#define DI_16_B5_G6_R5 2
|
||||
|
||||
#define DI_24_RGB 3
|
||||
#define DI_24_BGR 4
|
||||
#define DI_32_RGBA 5
|
||||
#define DI_32_BGRA 6
|
||||
#define DI_32_ARGB 7
|
||||
#define DI_32_ABGR 8
|
||||
|
||||
#define DI_NUM 9
|
||||
|
||||
int bytes_per_pixel;
|
||||
int drawing_depth;
|
||||
int inline_alpha,inline_alpha_ofs;
|
||||
|
||||
|
||||
void (*render_run_alpha)(render_run_t *ri,int num);
|
||||
void (*render_run_opaque)(render_run_t *ri,int num);
|
||||
void (*render_run_alpha_a)(render_run_t *ri,int num);
|
||||
void (*render_run_opaque_a)(render_run_t *ri,int num);
|
||||
|
||||
void (*render_blit_alpha_opaque)(unsigned char *dst,
|
||||
const unsigned char *src,
|
||||
unsigned char r,unsigned char g,unsigned char b,int num);
|
||||
void (*render_blit_mono_opaque)(unsigned char *dst,
|
||||
const unsigned char *src,int src_ofs,
|
||||
unsigned char r,unsigned char g,unsigned char b,
|
||||
int num);
|
||||
|
||||
void (*render_blit_alpha)(unsigned char *dst,const unsigned char *src,
|
||||
unsigned char r,unsigned char g,unsigned char b,
|
||||
unsigned char alpha,int num);
|
||||
void (*render_blit_mono)(unsigned char *dst,
|
||||
const unsigned char *src,int src_ofs,
|
||||
unsigned char r,unsigned char g,unsigned char b,
|
||||
unsigned char alpha,int num);
|
||||
|
||||
|
||||
void (*composite_sover_aa)(composite_run_t *c,int num);
|
||||
void (*composite_sover_ao)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_sin_aa)(composite_run_t *c,int num);
|
||||
void (*composite_sin_oa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_sout_aa)(composite_run_t *c,int num);
|
||||
void (*composite_sout_oa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_satop_aa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_dover_aa)(composite_run_t *c,int num);
|
||||
void (*composite_dover_oa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_din_aa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_dout_aa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_datop_aa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_xor_aa)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_plusl_aa)(composite_run_t *c,int num);
|
||||
void (*composite_plusl_oa)(composite_run_t *c,int num);
|
||||
void (*composite_plusl_ao)(composite_run_t *c,int num);
|
||||
void (*composite_plusl_oo)(composite_run_t *c,int num);
|
||||
|
||||
void (*composite_plusd_aa)(composite_run_t *c,int num);
|
||||
void (*composite_plusd_oa)(composite_run_t *c,int num);
|
||||
void (*composite_plusd_ao)(composite_run_t *c,int num);
|
||||
void (*composite_plusd_oo)(composite_run_t *c,int num);
|
||||
} draw_info_t;
|
||||
|
||||
#define RENDER_RUN_ALPHA (DI.render_run_alpha)
|
||||
#define RENDER_RUN_OPAQUE (DI.render_run_opaque)
|
||||
#define RENDER_RUN_ALPHA_A (DI.render_run_alpha_a)
|
||||
#define RENDER_RUN_OPAQUE_A (DI.render_run_opaque_a)
|
||||
|
||||
#define RENDER_BLIT_ALPHA_OPAQUE (DI.render_blit_alpha_opaque)
|
||||
#define RENDER_BLIT_MONO_OPAQUE DI.render_blit_mono_opaque
|
||||
#define RENDER_BLIT_ALPHA DI.render_blit_alpha
|
||||
#define RENDER_BLIT_MONO DI.render_blit_mono
|
||||
|
||||
void artcontext_setup_draw_info(draw_info_t *di,
|
||||
unsigned int red_mask,unsigned int green_mask,unsigned int blue_mask,
|
||||
int bpp);
|
||||
|
||||
void artcontext_render_svp(const ArtSVP *svp,int x0,int y0,int x1,int y1,
|
||||
unsigned char r,unsigned char g,unsigned char b,unsigned char a,
|
||||
unsigned char *dst,int rowstride,
|
||||
unsigned char *dsta,int arowstride,int has_alpha,
|
||||
draw_info_t *di);
|
||||
|
||||
#endif
|
||||
|
1664
Source/art/blit.m
Normal file
1664
Source/art/blit.m
Normal file
File diff suppressed because it is too large
Load diff
51
Source/art/ftfont.h
Normal file
51
Source/art/ftfont.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
copyright 2002 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
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 Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef ftfont_h
|
||||
#define ftfont_h
|
||||
|
||||
@class NSAffineTransform;
|
||||
|
||||
@protocol FTFontInfo
|
||||
-(void) drawString: (const char *)s
|
||||
at: (int)x:(int)y
|
||||
to: (int)x0:(int)y0:(int)x1:(int)y1:(unsigned char *)buf:(int)bpl
|
||||
color:(unsigned char)r:(unsigned char)g:(unsigned char)b:(unsigned char)alpha
|
||||
transform: (NSAffineTransform *)transform
|
||||
drawinfo: (struct draw_info_s *)di;
|
||||
|
||||
-(void) drawString: (const char *)s
|
||||
at: (int)x:(int)y
|
||||
to: (int)x0:(int)y0:(int)x1:(int)y1:(unsigned char *)buf:(int)bpl
|
||||
color:(unsigned char)r:(unsigned char)g:(unsigned char)b:(unsigned char)alpha
|
||||
transform: (NSAffineTransform *)transform
|
||||
deltas: (const float *)delta_data : (int)delta_size : (int)delta_flags;
|
||||
|
||||
-(void) outlineString: (const char *)s
|
||||
at: (float)x:(float)y
|
||||
gstate: (void *)func_param;
|
||||
|
||||
+(void) initializeBackend;
|
||||
@end
|
||||
|
||||
@class FTFontInfo;
|
||||
|
||||
#endif
|
||||
|
1298
Source/art/ftfont.m
Normal file
1298
Source/art/ftfont.m
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue