Hi!
I have set up an API for libblt from the few responses I got.
If you think, there is something missing, then let me know.
If anything is unclear for you, then feel free to ask.
CU,
Christoph Egger
E-Mail: [EMAIL PROTECTED]
/*
******************************************************************************
LibBLT: extension API header file
Copyright (C) 2001 Christoph Egger [[EMAIL PROTECTED]]
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************
*/
#ifndef _GGI_BLT_H
#define _GGI_BLT_H
#ifndef _GGI_INTERNAL_GII_H
#include <ggi/ggi.h>
#endif
__BEGIN_DECLS
#include <ggi/galloc.h>
/* Extension management
*/
int ggiBltInit(void);
int ggiBltExit(void);
int ggiBltAttach(ggi_visual_t vis, ggiGA_resource_list *reqlist);
int ggiBltDetach(ggi_visual_t vis);
/* Structure
*/
#ifdef HAVE_STRUCT_BLT
typedef struct ggiBlt *ggiBlt_t;
#else
struct ggiBlt { };
typedef struct ggiBlt *ggiBlt_t;
#endif
enum ggiBlt_rops {
BLT_NONE = 0x00000000,
BLT_AND = 0x00000001,
BLT_OR = 0x00000002,
BLT_XOR = 0x00000004,
BLT_NOT = 0x00000008,
};
struct ggiBlt_source {
ggiBlt_t blt;
ggi_visual_t vis;
enum ggiBlt_rops rop;
/* 0 means to use vis as blt-source and
* non-zero to use blt as blt-source
*/
int flag;
};
typedef ggiBlt_source *ggiBlt_source_list;
/* SYNC/ASYNC mode. Blits instantly or when thw HW likes to. Default is sync */
#define BLTFLAG_SYNC 0x0000
#define BLTFLAG_ASYNC GGIFLAG_ASYNC
/* API functions
*/
int ggiBltAddBob(ggiGA_resource_list *reqlist,
struct GA_ResourceProperties *props,
ggiGA_resource_handle *handle);
ggiBlt_t ggiBltTie(ggiGA_resource_handle handle);
int ggiBltUntie(ggiBlt_t *blt);
ggiBlt_t ggiBltCreateBob(ggi_visual_t vis,
struct GA_ResourceProperties *props);
int ggiBltDestroyBob(ggiBlt_t *blt);
/* Set the default base for the coordinates: Either pixels or dots
*/
int ggiBltSetCoordBase(ggiBlt_t blt, enum ggiGA_coord_mode cm);
int ggiBltSetSyncMode(ggiBlt_t blt, ggi_flags sync);
/* Does all blitting operations, if it is in ASYNC -mode */
int ggiBltFlush(ggiBlt_t blt);
/* Set the given image (vis) to the blt-area with grabbing the image
* from a visual at pos (x,y)
*/
int ggiBltSetImage(ggiBlt_t blt, ggi_visual_t vis,
int x, int y, unsigned char *alpha);
/* Multi-Source blitting operation. Blits all bobs from
* the source-list into blt using the given rop from the list.
* It performs stretching, if width and height are != 0
*/
int ggiBltCrossBlit(ggiBlt_source_list src, size_t nmemb,
ggiBlt_t blt, int width, int height);
int ggiBltBlit(ggiBlt_t src, ggiBlt_t dst,
int width, int height,
enum ggiBlt_rops rop);
int ggiBltBlit2Vis(ggiBlt_t blt, ggi_visual_t vis,
int dx, int dy, int width, int height,
enum ggiBlt_rops rop, enum ggiGA_coord_mode cm);
int ggiBltVis2Vis(ggi_visual_t *src, size_t nmemb,
ggi_visual_t dst, int dx, int dy, int width, int height,
enum ggiBlt_rops *rop, enum ggiGA_coord_mode cm);
__END_DECLS
#endif /* _GGI_BLT_H */