/package/fltk/fltk-1.1.9-directfb-support.patch
http://buildroot.googlecode.com/ · Patch · 2177 lines · 2156 code · 21 blank · 0 comment · 0 complexity · d3d89cc0465b62ae921600156a3024d4 MD5 · raw file
Large files are truncated click here to view the full file
- diff -Nwrup -x.git fltk-1.1.9/configh.in FLTK_1.x-DirectFB/configh.in
- --- fltk-1.1.9/configh.in 2007-02-08 15:14:30.000000000 -0500
- +++ FLTK_1.x-DirectFB/configh.in 2009-11-28 15:48:05.869153408 -0500
- @@ -131,6 +131,15 @@
- #undef __APPLE_QD__
-
- /*
- + * DIRECTFB:
- + *
- + * All drawing function use DirectFB library.
- + *
- + */
- +
- +#define DIRECTFB 0
- +
- +/*
- * HAVE_OVERLAY:
- *
- * Use the X overlay extension? FLTK will try to use an overlay
- diff -Nwrup -x.git fltk-1.1.9/configure FLTK_1.x-DirectFB/configure
- --- fltk-1.1.9/configure 2008-04-27 04:28:21.000000000 -0400
- +++ FLTK_1.x-DirectFB/configure 2009-11-28 15:48:05.872152486 -0500
- @@ -1316,6 +1316,7 @@ Optional Features:
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-cygwin use the CygWin libraries default=no
- --enable-debug turn on debugging default=no
- + --enable-directfb turn on DirectFB support default=no
- --enable-gl turn on OpenGL support default=yes
- --enable-shared turn on shared libraries default=no
- --enable-threads enable multi-threading support
- @@ -1859,6 +1860,12 @@ else
- DEBUGFLAG=""
- fi
-
- +# Check whether --enable-directfb was given.
- +if test "${enable_directfb+set}" = set; then
- + enableval=$enable_directfb;
- +fi
- +
- +
- # Check whether --enable-gl was given.
- if test "${enable_gl+set}" = set; then
- enableval=$enable_gl;
- @@ -9217,6 +9224,17 @@ _ACEOF
- THREADS="threads"
- fi
-
- + if test x$enable_directfb == xyes; then
- + cat >>confdefs.h <<\_ACEOF
- +#define DIRECTFB 1
- +_ACEOF
- +
- + cat >>confdefs.h <<\_ACEOF
- +#define USE_COLORMAP 0
- +_ACEOF
- +
- + LIBS="$LIBS -ldirect -ldirectfb -lfusion $X_EXTRA_LIBS"
- + else
- { echo "$as_me:$LINENO: checking for X" >&5
- echo $ECHO_N "checking for X... $ECHO_C" >&6; }
-
- @@ -10544,6 +10562,7 @@ echo "$as_me: WARNING: Ignoring librarie
- fi
-
- LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
- + fi
- CFLAGS="$CFLAGS $X_CFLAGS"
- CXXFLAGS="$CXXFLAGS $X_CFLAGS"
- LDFLAGS="$X_LIBS $LDFLAGS"
- @@ -12001,6 +12020,9 @@ case $uname in
- fi
- ;;
- *)
- + if test x$enable_directfb = xyes; then
- + graphics="DirectFB"
- + else
- graphics="X11"
- if test x$enable_xft = xyes; then
- graphics="$graphics+Xft"
- @@ -12011,6 +12033,7 @@ case $uname in
- if test x$enable_xinerama = xyes; then
- graphics="$graphics+Xinerama"
- fi
- + fi
- ;;
- esac
-
- diff -Nwrup -x.git fltk-1.1.9/configure.in FLTK_1.x-DirectFB/configure.in
- --- fltk-1.1.9/configure.in 2008-04-11 12:53:01.000000000 -0400
- +++ FLTK_1.x-DirectFB/configure.in 2009-11-28 15:48:05.873159527 -0500
- @@ -117,6 +117,8 @@ else
- DEBUGFLAG=""
- fi
-
- +AC_ARG_ENABLE(directfb, [ --enable-directfb turn on DirectFB support [default=no]])
- +
- AC_ARG_ENABLE(gl, [ --enable-gl turn on OpenGL support [default=yes]])
-
- AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]])
- @@ -696,6 +698,11 @@ case $uname in
- THREADS="threads"
- fi
-
- + if test x$enable_directfb == xyes; then
- + AC_DEFINE(DIRECTFB,1)
- + AC_DEFINE(USE_COLORMAP,0)
- + LIBS="$LIBS -ldirect -ldirectfb -lfusion $X_EXTRA_LIBS"
- + else
- dnl Check for X11...
- AC_PATH_XTRA
-
- @@ -708,6 +715,7 @@ case $uname in
- fi
-
- LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
- + fi
- CFLAGS="$CFLAGS $X_CFLAGS"
- CXXFLAGS="$CXXFLAGS $X_CFLAGS"
- LDFLAGS="$X_LIBS $LDFLAGS"
- @@ -1091,6 +1099,9 @@ case $uname in
- fi
- ;;
- *)
- + if test x$enable_directfb = xyes; then
- + graphics="DirectFB"
- + else
- graphics="X11"
- if test x$enable_xft = xyes; then
- graphics="$graphics+Xft"
- @@ -1101,6 +1112,7 @@ case $uname in
- if test x$enable_xinerama = xyes; then
- graphics="$graphics+Xinerama"
- fi
- + fi
- ;;
- esac
-
- diff -Nwrup -x.git fltk-1.1.9/FL/DirectFB.H FLTK_1.x-DirectFB/FL/DirectFB.H
- --- fltk-1.1.9/FL/DirectFB.H 1969-12-31 19:00:00.000000000 -0500
- +++ FLTK_1.x-DirectFB/FL/DirectFB.H 2009-11-28 15:48:05.842154085 -0500
- @@ -0,0 +1,667 @@
- +//
- +// "$Id: DirectFB.H,v 1.3 2006-10-31 09:31:14 nikego Exp $"
- +//
- +// DirectFB header file for the Fast Light Tool Kit (FLTK).
- +//
- +// Copyright 1998-2005 by Bill Spitzak and others.
- +//
- +// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- +// USA.
- +//
- +// Please report all bugs and problems on the following page:
- +//
- +// http://www.fltk.org/str.php
- +//
- +
- +// Do not directly include this file, instead use <FL/x.H>. It will
- +// include this file if DIRECTFB is defined. This is to encourage
- +// portability of even the system-specific code...
- +
- +#ifndef Fl_X_H
- +# error "Never use <DirectFB.H> directly; include <FL/x.H> instead."
- +#endif // !Fl_X_H
- +
- +#include <config.h>
- +
- +// to make debug version uncomment the next line
- +//#define DEBUG 1
- +
- +#ifdef DEBUG
- +// to enable DirectFB's debug tracing
- +# define DIRECT_ENABLE_DEBUG (1)
- +#endif
- +
- +#include <directfb.h>
- +#include <directfb_version.h>
- +#include <FL/xutils.h>
- +
- +// In some of the distributions, the gcc header files are missing some stuff:
- +#ifndef LPMINMAXINFO
- +#define LPMINMAXINFO MINMAXINFO*
- +#endif
- +#ifndef VK_LWIN
- +#define VK_LWIN 0x5B
- +#define VK_RWIN 0x5C
- +#define VK_APPS 0x5D
- +#endif
- +
- +#include <stdio.h>
- +
- +// This is the super interface, it's the entry point to all functionality.
- +extern IDirectFB* fl_dfb;
- +extern IDirectFBDisplayLayer* fl_display_layer;
- +extern GC fl_screen; //The primary surface, i.e. the "screen".
- +
- +void print_last_dump();
- +
- +#ifdef DEBUG
- +
- +#define DFBCHECK(x...)\
- + {\
- + DFBResult err = x;\
- + if (err != DFB_OK){\
- + fprintf( stderr, "Error '%s' occured in %s <%d>:\n\t", DirectFBErrorString(err), __FILE__, __LINE__ );\
- + fprintf( stderr, #x );\
- + print_last_dump();\
- + /* DirectFBErrorFatal( #x, err );*/\
- + }\
- + }
- +
- +#else
- +
- + #define DFBCHECK(x...) x
- +
- +#endif
- +
- +/******************************************************/
- +/* DirectFB's assist functions */
- +/******************************************************/
- +
- +static inline int
- +get_caps( GC gc ){
- + DFBSurfaceCapabilities ret_caps = DSCAPS_NONE;
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->GetCapabilities(gc->surface, &ret_caps));
- + return ret_caps;
- +}
- +
- +static inline int
- +get_pixel_format(GC gc){
- + DFBSurfacePixelFormat pixel_format = DSPF_UNKNOWN;
- + if (gc && gc->surface)
- + gc->surface->GetPixelFormat(gc->surface, &pixel_format);
- + return (int)pixel_format;
- +}
- +
- +static inline void
- +get_size(GC gc, int* width, int* height ){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->GetSize(gc->surface, width, height));
- +}
- +
- +static inline void
- +get_visible_rectangle( GC gc, DFBRectangle* rect ){
- + if (gc && gc->surface)
- + DFBCHECK( gc->surface->GetVisibleRectangle( gc->surface, rect ) );
- +}
- +
- +// summary
- +static inline int
- +get_surface_description(GC gc, DFBSurfaceDescription* desc){
- + if (gc && gc->surface) {
- + desc->flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT);
- + desc->caps = (DFBSurfaceCapabilities)get_caps( gc );
- + get_size( gc, &desc->width , &desc->height );
- + desc->pixelformat = (DFBSurfacePixelFormat)get_pixel_format( gc );
- + return DFB_OK;
- + }
- + return DFB_INVARG;
- +}
- +
- +static inline void
- +get_palette(GC gc, IDirectFBPalette** pal){
- + if (gc && gc->surface)
- + DFBCHECK( gc->surface->GetPalette( gc->surface, pal ) );
- +}
- +
- +static inline void*
- +lock_surface(GC gc, int flags, int *ret_pitch){
- + void* buffer = 0;
- + if (gc && gc->surface)
- + if (DFB_OK == gc->surface->Lock(gc->surface, (DFBSurfaceLockFlags)flags,\
- + &buffer, ret_pitch))
- + return buffer;
- + return 0;
- +}
- +
- +static inline void
- +unlock_surface(GC gc){
- + if (gc && gc->surface)
- + gc->surface->Unlock( gc->surface );
- +}
- +
- +static inline void
- +flip_gc(GC gc, DFBRegion *region, int flags){
- + DFBCHECK(gc->surface->Flip( gc->surface, region,( DFBSurfaceFlipFlags)flags ) );
- +}
- +
- +static inline void
- +clear_gc(GC gc, uchar red, uchar green, uchar blue, uchar alpha){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->Clear(gc->surface, red, green, blue, alpha));
- +}
- +
- +static inline int
- +set_clip(GC gc, DFBRegion* reg){
- + if (gc && gc->surface){
- + if( reg ){
- + DFBRegion r = *reg;
- + if (r.x2) r.x2--;
- + if (r.y2) r.y2--;
- + return gc->surface->SetClip( gc->surface, &r );
- + }else
- + return gc->surface->SetClip( gc->surface, reg );
- + }
- + return DFB_INVARG;
- +}
- +
- +static inline int
- +get_clip(GC gc, DFBRegion* reg){
- + if (gc && gc->surface)
- + if (reg){
- + return gc->surface->GetClip(gc->surface, reg);
- + }
- + return DFB_INVARG;
- +}
- +
- +inline void
- +set_drawing_flags(GC gc, int flags){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->SetDrawingFlags(gc->surface, (DFBSurfaceDrawingFlags)flags));
- +}
- +
- +static inline void
- +set_src_blend_function( GC gc, int func ){
- + if (gc && gc->surface)
- + gc->surface->SetSrcBlendFunction( gc->surface, (DFBSurfaceBlendFunction) func );
- +}
- +
- +static inline void
- +set_dst_blend_function( GC gc, int func ){
- + if (gc && gc->surface)
- + gc->surface->SetDstBlendFunction( gc->surface, (DFBSurfaceBlendFunction) func );
- +}
- +
- +static inline void
- +set_porter_duff(GC gc, int rule){
- + if (gc && gc->surface)
- + gc->surface->SetPorterDuff( gc->surface, (DFBSurfacePorterDuffRule)rule );
- +}
- +
- +static inline void
- +set_blitting_flags(GC gc, int flags){
- + DFBCHECK( gc->surface->SetBlittingFlags(gc->surface, (DFBSurfaceBlittingFlags)flags ) );
- +}
- +
- +static inline void
- +blit(GC dest,GC src, DFBRectangle* rect, int x , int y){
- + if (src && dest && dest->surface && src->surface)
- + DFBCHECK(dest->surface->Blit(dest->surface,src->surface, rect, x, y));
- +}
- +
- +static inline void
- +set_surface_font(GC gc, IDirectFBFont* font){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->SetFont(gc->surface, font));
- +}
- +
- +static inline IDirectFBFont*
- +get_surface_font(GC gc){
- + IDirectFBFont* ret_font = 0;
- + if (gc && gc->surface)
- + gc->surface->GetFont(gc->surface, &ret_font);
- + return ret_font;
- +}
- +
- +static inline int
- +set_color(GC gc, u8 _r,u8 _g,u8 _b,u8 _a){
- + if (gc && gc->surface)
- + {
- + gc->r = _r;
- + gc->g = _g;
- + gc->b = _b;
- + gc->a = _a;
- + DFBCHECK( gc->surface->SetColor( gc->surface,_r,_g,_b,_a ) );
- + }
- + return 0;
- +}
- +
- +/*static inline int
- +set_color(GC gc, u8 _color){
- + if (gc && gc->surface)
- + DFBCHECK( gc->surface->SetColorIndex(gc->surface, _color));
- + return 0;
- +}*/
- +
- +static inline int
- +set_src_color_key(GC gc, u8 _color){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->SetSrcColorKeyIndex(gc->surface, _color));
- + return 0;
- +}
- +
- +static inline int
- +set_src_color_key(GC gc, u8 r, u8 g, u8 b){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->SetSrcColorKey( gc->surface, r, g, b));
- + return 0;
- +}
- +
- +static inline int
- +set_dst_color_key( GC gc, u8 _color ){
- + DFBCHECK(gc->surface->SetDstColorKeyIndex(gc->surface, _color ));
- + return 0;
- +}
- +
- +static inline int
- +set_dst_color_key(GC gc, u8 r, u8 g , u8 b ){
- + if (gc && gc->surface)
- + DFBCHECK(gc->surface->SetDstColorKey(gc->surface, r, g, b));
- + return 0;
- +}
- +
- +void
- +draw_lines(GC gc, Region reg, int n );
- +
- +void
- +draw_string(GC gc, const char* str, int n, int x, int y, DFBSurfaceTextFlags flags );
- +
- +void
- +get_string_width(IDirectFBFont *font, const char* s, int n, int * width);
- +
- +int
- +set_clip_mask(Pixmap mask);
- +
- +/*********************************************************************
- + * window's functions
- + * */
- +
- +static inline DFBWindowID
- +get_id( IDirectFBWindow* window ){
- + DFBWindowID ret_id;
- + if ( window && ( DFB_OK == window->GetID( window, &ret_id ) ) )
- + return ret_id;
- + return 0;
- +}
- +
- +static inline void
- +set_opacity(IDirectFBWindow* window, int opacity){
- + if (window)
- + DFBCHECK( window->SetOpacity( window, opacity ) );
- +}
- +
- +static inline int
- +get_opacity(IDirectFBWindow* window){
- + uchar ret_op;
- + if (window)
- + DFBCHECK(window->GetOpacity(window, &ret_op));
- + return ret_op;
- +}
- +
- +static inline void
- +get_size(IDirectFBWindow* window, int* width, int* height){
- + if (window)
- + DFBCHECK(window->GetSize(window, width, height));
- +}
- +
- +static inline void
- +resize( IDirectFBWindow* window, int width, int height){
- + if (window)
- + DFBCHECK(window->ResizeSurface(window, width, height));
- +}
- +
- +static inline void
- +get_position(IDirectFBWindow* window,int* x, int* y){
- + if (window)
- + DFBCHECK(window->GetPosition(window, x, y));
- +}
- +
- +static inline void
- +set_cursor_shape(IDirectFBDisplayLayer* layer, GC cursor, int hot_x, int hot_y){
- + if (layer)
- + DFBCHECK(layer->SetCursorShape(layer, cursor ? cursor->surface : 0, hot_x, hot_y));
- +}
- +
- +static inline void
- +raise_to_top(IDirectFBWindow* window){
- + if (window)
- + DFBCHECK(window->RaiseToTop(window));
- +}
- +
- +
- +/**********************************************************************/
- +
- +static inline void
- +wait_for_event_with_timeout(IDirectFBEventBuffer* buffer, unsigned sec, unsigned msec){
- + if (buffer)
- + DFBCHECK( buffer->WaitForEventWithTimeout( buffer, sec, msec ) );
- +}
- +
- +static inline void
- +set_cursor_opacity(IDirectFBDisplayLayer* layer, int opacity){
- + if (layer)
- + DFBCHECK(layer->SetCursorOpacity(layer, opacity));
- +}
- +
- +static inline void
- +get_cursor_position(IDirectFBDisplayLayer* layer, int* xx, int* yy){
- + if (layer)
- + DFBCHECK( layer->GetCursorPosition( layer, xx, yy ) );
- +}
- +
- +GC
- +create_gc(const DFBSurfaceDescription* desc);
- +
- +GC
- +create_gc(IDirectFBWindow* window);
- +
- +GC
- +create_gc(GC parent_gc, const DFBRectangle* rect);
- +
- +GC
- +create_gc(int caps, int flags, int pixelformat, int width, int height);
- +
- +IDirectFBWindow*
- +create_window(const DFBWindowDescription* desc);
- +
- +IDirectFBWindow*
- +get_window( DFBWindowID xid );
- +
- +static inline void
- +grab_pointer(IDirectFBWindow* window){
- + if (window)
- + DFBCHECK( window->GrabPointer( window ) );
- +}
- +
- +static inline void
- +ungrab_pointer(IDirectFBWindow* window){
- + if (window)
- + DFBCHECK(window->UngrabPointer(window));
- +}
- +
- +static inline void
- +set_win_cursor_shape(IDirectFBWindow* win, GC cursor, int hot_x, int hot_y){
- + if (win)
- + DFBCHECK(win->SetCursorShape(win, cursor ? cursor->surface : 0, hot_x, hot_y));
- +}
- +
- +
- +static inline void
- +set_options(IDirectFBWindow* window, int opts){
- + if (window)
- + DFBCHECK(window->SetOptions(window, (DFBWindowOptions)opts));
- +}
- +
- +static inline int
- +create_font(const char* filename, const DFBFontDescription* desc, IDirectFBFont** ret_interface){
- + if (fl_dfb)
- + fl_dfb->CreateFont(fl_dfb, filename, desc, ret_interface);
- + return 0;
- +}
- +
- +static inline int
- +get_font_height( IDirectFBFont* font ){
- + int height=0;
- + if (font && ( DFB_OK == font->GetHeight(font, &height)))
- + return height;
- + return 0;
- +}
- +
- +static inline int
- +get_font_descender( IDirectFBFont* font ){
- + int descender=0;
- + if( font && ( DFB_OK == font->GetDescender( font, &descender ) ) )
- + return -descender;
- + return 0;
- +}
- +
- +static inline int
- +get_surface_description( IDirectFBImageProvider* image_provider, DFBSurfaceDescription* desc ){
- + if (image_provider)
- + image_provider->GetSurfaceDescription( image_provider, desc );
- + return DFB_OK;
- +}
- +
- +static inline IDirectFBImageProvider*
- +create_image_provider(const char *name){
- + IDirectFBImageProvider *image_provider;
- + if (fl_dfb && (DFB_OK == fl_dfb->CreateImageProvider(fl_dfb, name, &image_provider)) )
- + return image_provider;
- + return 0;
- +}
- +
- +static inline void
- +render_to( IDirectFBImageProvider *image_provider, GC gc, DFBRectangle* rect ){
- + if (image_provider)
- + image_provider->RenderTo( image_provider, gc->surface, rect );
- +}
- +
- +static inline void
- +release( IDirectFBSurface* s ){
- + if (s && fl_dfb)
- + s->Release( s );
- +}
- +
- +static inline void
- +release( IDirectFBWindow *w ){
- + if (w && fl_dfb)
- + w->Release( w );
- +}
- +
- +static inline void
- +release( IDirectFBInputDevice* d ){
- + if (d && fl_dfb)
- + d->Release( d );
- +}
- +
- +extern void print_gc_list();
- +extern void free_gc_list();
- +extern void fl_free_cursors();
- +extern void _fl_show_cursor(int);
- +
- +#define fl_display fl_display_layer
- +#define xdisplay fl_display_layer
- +#define Fl_Region Region
- +#define display_layer fl_display_layer
- +
- +static inline int
- +pixel_format(){
- + extern u32 pixf_;
- + return pixf_;
- +}
- +
- +static inline bool
- +have_lut(){
- + extern bool lut_;
- + return lut_;
- +}
- +
- +int fl_init_dfb(int argc, char **argv);
- +
- +FL_EXPORT void fl_clip_region(Fl_Region);
- +
- +#include "Fl_Window.H"
- +// this object contains all directfb-specific stuff about a window:
- +// Warning: this object is highly subject to change!
- +FL_EXPORT void fl_open_display();
- +FL_EXPORT void fl_open_display(Display*);
- +FL_EXPORT void fl_close_display();
- +
- +extern VisualInfo visual_info;
- +extern FL_EXPORT dfbWindow fl_message_window;
- +extern FL_EXPORT VisualInfo* fl_visual;
- +extern FL_EXPORT Colormap fl_colormap;
- +extern FL_EXPORT Surface fl_gc;
- +extern FL_EXPORT Window fl_window;
- +extern FL_EXPORT IDirectFBFont* fl_xfont;
- +
- +extern FL_EXPORT ulong fl_xpixel(Fl_Color i);
- +extern FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b);
- +extern FL_EXPORT void fl_clip_region(Fl_Region);
- +extern FL_EXPORT Fl_Region fl_clip_region();
- +
- +// feed events into fltk:
- +FL_EXPORT int fl_handle(const DFBWindowEvent&);
- +
- +// you can use these in Fl::add_handler() to look at events:
- +//extern FL_EXPORT const DFBWindowEvent* fl_xevent;
- +extern FL_EXPORT ulong fl_event_time;
- +
- +// flip a rectangle of screen
- +FL_EXPORT void fl_flip( GC surf, int x, int y, int w, int h );
- +FL_EXPORT void fl_flip( int x, int y, int w, int h );
- +FL_EXPORT void fl_flip( GC surf, Region r );
- +
- +/*******************************************************/
- +// off-screen pixmaps: create, destroy, draw into, copy to window:
- +
- +typedef Pixmap Fl_Offscreen;
- +
- +Fl_Offscreen fl_create_offscreen(int w,int h);
- +Fl_Offscreen fl_create_offscreen_argb(int w,int h);//with alpha mask
- +
- +void fl_delete_offscreen(Fl_Offscreen);
- +
- +// begin/end are functions that save the old state in global variables:
- +
- +void fl_begin_offscreen(Fl_Offscreen);
- +void fl_end_offscreen();
- +void fl_copy_offscreen(int _x,int _y,int _w,int _h,Fl_Offscreen offscreen,int srcx,int srcy);
- +void fl_copy_offscreen_bk(int _x,int _y,int _w,int _h,Fl_Offscreen offscreen,int srcx,int srcy,ulong bkcolor );
- +//void fl_copy_offscreen_with_mask(int _x, int _y, int _w, int _h, void* offscreen, int srcx, int srcy, void* mask );
- +void fl_draw_abgr_to_argb(const uchar* array, int x, int y, int w, int h);
- +
- +
- +#if 0 //FIXME SetDstColorKeyIndex is not working !
- + extern int _dstcol_Blit( GC,GC,DFBRectangle*, int,int,int );
- +# define __Blit( s ,i, r, x ,y, c ) _dstcol_Blit( s ,i, r, x ,y, c )
- +#else
- +# define __Blit( s ,i, r, x ,y, c ) _Blit( s ,i, r, x ,y )
- +#endif
- +
- +GC
- +fl_load_image( const char *infname, int& w, int& h, GC* mask );
- +
- +uchar*
- +fl_load_image( const char *infname, int& w, int& h, int& d );
- +
- +int
- +BitBlit( GC dest, int dest_x, int dest_y, int width, int height,GC src, int src_x,int src_y );
- +
- +/*************************************************************************************/
- +/* Bitmap masks */
- +
- +typedef Fl_Offscreen Fl_Bitmask;
- +
- +extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
- +extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
- +extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
- +
- +#define CHILD_ID 0x8000
- +
- +/*************************************************************************************/
- +// this object contains all X-specific stuff about a window:
- +// Warning: this object is highly subject to change! It's definition
- +// is only here so that fl_xid can be declared inline:
- +class FL_EXPORT Fl_X {
- +public:
- + XID xid;
- + dfbWindow _xid;
- + Fl_Window* w;
- + Fl_Region region;
- + GC gc; //client's context
- + GC win_gc;//window's context
- +
- + char wait_for_expose;
- + char backbuffer_bad; // used for XDBE
- +
- + static Fl_X* first;
- + Fl_X *next;
- + static Fl_X* i(const Fl_Window* wi) {return wi->i;}
- +/*------------------------------------------------------------------------*/
- + void setwindow( Fl_Window* wi ) {w=wi; wi->i=this;}
- + void sendxjunk();
- + static Fl_X* make_xid(Fl_Window*);
- + static Fl_X* set_xid(Fl_Window*, dfbWindow);
- + char first_draw;//FIXME it's a flag to show the window after first drawing
- + // kludges to get around protection:
- + void flush();
- + static void x(Fl_Window* wi, int X) {wi->x(X);}
- + static void y(Fl_Window* wi, int Y) {wi->y(Y);}
- + static void release();
- +
- + Fl_Window *header;
- + void draw_window_frame();
- + void enter_window(bool);
- + void set_gc(int W=-1,int H=-1);
- + DFBRectangle origin_size;
- + int minimize_;
- + int maximize(){return origin_size.w!=0;};
- + void set_maximize();
- + int minimize(){return minimize_;}
- + void delete_icon();
- + void set_minimize();
- + void restore_size(int X=-1,int Y=-1,int W=-1,int H=-1);
- + short minw,minh,maxw,maxh,dw,dh;
- + Cursor cursors[2];
- +};
- +
- +//compatibitily with FLTK2
- +#define CreatedWindow Fl_X
- +
- +// convert xid <-> Fl_Window:
- +/*static inline WindowID fl_wnd(const Fl_Window* w){
- + return Fl_X::i(w)->_xid;
- +}*/
- +static inline Window fl_xid(const Fl_Window* w){
- + return Fl_X::i(w)->xid;
- +}
- +
- +FL_EXPORT Fl_Window* fl_find( Window xid );
- +FL_EXPORT Fl_Window* fl_find( dfbWindow _xid );
- +
- +Fl_X *get_parent_xid( Fl_Widget* w );
- +
- +void delete_icon( Fl_Window* win );
- +
- +extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid()
- +extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid()
- +
- +// Dummy function to register a function for opening files via the window manager...
- +static inline void fl_open_callback(void (*)(const char *)) {
- +}
- +
- +extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b);
- +extern FL_EXPORT void fl_free_dfbfonts();
- +
- +void fl_deinit_dfb(void);
- +
- +#if USE_COLORMAP
- +void init_xcolormap();
- +#endif
- +
- +//
- +// End of "$Id: DirectFB.H,v 1.3 2006-10-31 09:31:14 nikego Exp $".
- +//
- diff -Nwrup -x.git fltk-1.1.9/FL/Fl_GIF_Image.H FLTK_1.x-DirectFB/FL/Fl_GIF_Image.H
- --- fltk-1.1.9/FL/Fl_GIF_Image.H 2005-04-15 20:13:17.000000000 -0400
- +++ FLTK_1.x-DirectFB/FL/Fl_GIF_Image.H 2009-11-28 15:48:05.845154140 -0500
- @@ -1,5 +1,5 @@
- //
- -// "$Id: Fl_GIF_Image.H 4288 2005-04-16 00:13:17Z mike $"
- +// "$Id: Fl_GIF_Image.H,v 1.1 2006-04-06 14:01:27 nikego Exp $"
- //
- // GIF image header file for the Fast Light Tool Kit (FLTK).
- //
- @@ -28,8 +28,15 @@
- #ifndef Fl_GIF_Image_H
- #define Fl_GIF_Image_H
- # include "Fl_Pixmap.H"
- +#include <config.h>
-
- -class FL_EXPORT Fl_GIF_Image : public Fl_Pixmap {
- +class FL_EXPORT Fl_GIF_Image : public
- +#ifndef DIRECTFB
- + Fl_Pixmap
- +#else
- + Fl_RGB_Image
- +#endif
- + {
-
- public:
-
- @@ -39,5 +46,5 @@ class FL_EXPORT Fl_GIF_Image : public Fl
- #endif
-
- //
- -// End of "$Id: Fl_GIF_Image.H 4288 2005-04-16 00:13:17Z mike $".
- +// End of "$Id: Fl_GIF_Image.H,v 1.1 2006-04-06 14:01:27 nikego Exp $".
- //
- diff -Nwrup -x.git fltk-1.1.9/FL/fltk_dfb_ex.h FLTK_1.x-DirectFB/FL/fltk_dfb_ex.h
- --- fltk-1.1.9/FL/fltk_dfb_ex.h 1969-12-31 19:00:00.000000000 -0500
- +++ FLTK_1.x-DirectFB/FL/fltk_dfb_ex.h 2009-11-28 15:48:05.853153701 -0500
- @@ -0,0 +1,129 @@
- +#ifndef __FLTK_DFB_EX_H__
- +#define __FLTK_DFB_EX_H__
- +
- +/************************************************************************
- + * External FLTK`s functions which available in DirectFB`s version of the library only.
- +*/
- +
- +/* create offscreen compatible with primary surface */
- +extern void* fl_create_offscreen(int w,int h);
- +
- +/* create ARGB offscreen*/
- +extern void* fl_create_offscreen_rgb(int w,int h);
- +
- +/* delete offscreen*/
- +extern void fl_delete_offscreen(void* surface);
- +
- +/* set offscreen as current drawing surface*/
- +extern void fl_begin_offscreen(void* surface );
- +
- +/* restore old drawing surface*/
- +extern void fl_end_offscreen();
- +
- +/* copy from offscreen to current surface*/
- +extern void fl_copy_offscreen(int _x,int _y,int _w,int _h,void* offscreen,int srcx,int srcy);
- +
- +/* bkcolor color is excluded when copying */
- +extern void fl_copy_offscreen_bk(int _x,int _y,int _w,int _h,void* offscreen,int srcx,int srcy,ulong bkcolor);
- +
- +/*
- + * filter and smooth functions.
- + * They draw good-looking image especially if your display has low resolution ( e.c.640x480 ).
- + */
- +
- +/* available masks for filtering
- + *
- + * 1 - 2 X 2 1 1
- + * 1 1
- + *
- + * 2 - 3 X 3 1 1 1
- + * 1 1 1
- + * 1 1 1
- + *
- + * 3 - 3 X 3 1 1 1
- + * 1 2 1
- + * 1 1 1
- + *
- + * 4 - 3 X 3 1 2 1
- + * 2 4 2
- + * 1 2 1
- + *
- + * 5 - 3 X 3 0 2 0
- + * 2 4 2
- + * 0 2 0
- + *
- + * 6 - 4 X 4 1 1 1 1
- + * 1 1 1 1
- + * 1 1 1 1
- + * 1 1 1 1
- + *
- + * 7 - 7 X 7 1 2 3 4 3 2 1
- + * 2 4 6 8 6 4 2
- + * 3 6 9 12 9 6 5
- + * 4 8 12 16 12 8 4
- + * 3 6 9 12 9 6 5
- + * 2 4 6 8 6 4 2
- + * 1 2 3 4 3 2 1
- + */
- +/* filter offscreen rectangle using mask */
- +extern void fl_filter_offscreen(void* offscreen,int x,int y,int w,int h,int mask);
- +
- +/* filter widget's rectangle*/
- +extern void fl_filter_widget(Fl_Widget *wdg, int mask );
- +
- +/* draw a smooth line */
- +extern void fl_line(double x1, double y1, double x2, double y2);
- +
- +/* draw a smooth edge.
- + * The egde is a line having only one smooth side ( left hand side ). */
- +extern void fl_edge(double x1, double y1, double x2, double y2);
- +
- +/* start drawing smooth lines */
- +extern void fl_begin_smooth_line();
- +
- +/* start drawing a closed sequence of smooth lines*/
- +extern void fl_begin_smooth_loop();
- +
- +/*
- + * start drawing of polygon with smooth edges
- + * list the points in clockwise direction
- + 1 2
- + *--->-----*
- + |######### \
- + |########## \
- + ^########### V
- + |############ \
- + |############# \
- + *-------<-------*
- + 0 3
- +*/
- +extern void fl_begin_smooth_polygon();
- +
- +/* set and get a mask which be used after fl_draw() function*/
- +extern void set_text_smooth(int);
- +extern int get_text_smooth();
- +
- +/* hide/show the cursor*/
- +extern void fl_show_cursor(int);
- +
- +
- +/*******************************************************************
- + * it's an example of using of smooth drawing
- + * Fl_Smooth_Clock class declaration
- + *
- + */
- +
- +#include <FL/Fl_Clock.H>
- +
- +class Fl_Smooth_Clock: public Fl_Clock{
- +public:
- + Fl_Smooth_Clock(int x,int y,int w,int h, const char *l = 0):Fl_Clock(x,y,w,h,l){};
- +protected:
- + void drawsmhands(Fl_Color fill, Fl_Color line);
- + virtual void draw();
- + void draw(int X, int Y, int W, int H);
- +};
- +
- +
- +/****************************************************************************/
- +#endif
- diff -Nwrup -x.git fltk-1.1.9/FL/Makefile FLTK_1.x-DirectFB/FL/Makefile
- --- fltk-1.1.9/FL/Makefile 1969-12-31 19:00:00.000000000 -0500
- +++ FLTK_1.x-DirectFB/FL/Makefile 2009-11-28 15:48:05.852153755 -0500
- @@ -0,0 +1,63 @@
- +#
- +# "$Id: Makefile.in 5745 2007-03-15 13:27:41Z mike $"
- +#
- +# Header makefile for the Fast Light Tool Kit (FLTK).
- +#
- +# Copyright 1998-2007 by Bill Spitzak and others.
- +#
- +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- +# USA.
- +#
- +# Please report all bugs and problems on the following page:
- +#
- +# http://www.fltk.org/str.php
- +#
- +
- +include ../makeinclude
- +
- +all:
- +
- +clean:
- +
- +depend:
- +
- +install:
- + echo "Installing include files in $(DESTDIR)$(includedir)..."
- + $(RMDIR) $(DESTDIR)$(includedir)/FL
- + $(INSTALL_DIR) $(DESTDIR)$(includedir)/FL
- + for file in *.[hrH]; do \
- + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/FL; \
- + done
- + cd $(DESTDIR)$(includedir)/FL;\
- + for file in *.H; do\
- + $(RM) "`basename $$file H`h";\
- + $(LN) $$file "`basename $$file H`h";\
- + done
- + $(RM) $(DESTDIR)$(includedir)/FL/fl_file_chooser.H
- + $(LN) Fl_File_Chooser.H $(DESTDIR)$(includedir)/FL/fl_file_chooser.H
- + $(RM) $(DESTDIR)$(includedir)/FL/fl_file_chooser.h
- + $(LN) Fl_File_Chooser.H $(DESTDIR)$(includedir)/FL/fl_file_chooser.h
- + $(RM) $(DESTDIR)$(includedir)/Fl
- + $(LN) FL $(DESTDIR)$(includedir)/Fl
- +
- +uninstall:
- + echo "Uninstalling include files..."
- + $(RMDIR) $(DESTDIR)$(includedir)/FL
- + $(RM) $(DESTDIR)$(includedir)/Fl
- +
- +
- +#
- +# End of "$Id: Makefile.in 5745 2007-03-15 13:27:41Z mike $".
- +#
- diff -Nwrup -x.git fltk-1.1.9/FL/x.H FLTK_1.x-DirectFB/FL/x.H
- --- fltk-1.1.9/FL/x.H 2006-07-18 07:23:20.000000000 -0400
- +++ FLTK_1.x-DirectFB/FL/x.H 2009-11-28 15:48:05.855154687 -0500
- @@ -33,12 +33,16 @@
- #ifndef Fl_X_H
- # define Fl_X_H
-
- +#include <config.h>
- +
- # include "Enumerations.H"
-
- # ifdef WIN32
- # include "win32.H"
- # elif defined(__APPLE__)
- # include "mac.H"
- +# elif defined(DIRECTFB)
- +# include "DirectFB.H"
- # else
- # if defined(_ABIN32) || defined(_ABI64) // fix for broken SGI Irix X .h files
- # pragma set woff 3322
- @@ -142,7 +146,6 @@ extern FL_EXPORT int fl_parse_color(cons
-
- # endif
- #endif
- -
- //
- // End of "$Id: x.H 5262 2006-07-18 11:23:20Z matt $".
- //
- diff -Nwrup -x.git fltk-1.1.9/FL/xutils.h FLTK_1.x-DirectFB/FL/xutils.h
- --- fltk-1.1.9/FL/xutils.h 1969-12-31 19:00:00.000000000 -0500
- +++ FLTK_1.x-DirectFB/FL/xutils.h 2009-11-28 15:48:05.856153881 -0500
- @@ -0,0 +1,963 @@
- +//
- +// "$Id xutils.h 4563 2006-03-06 23:03:34Z $"
- +//
- +// DirectFB-specific code for the Fast Light Tool Kit (FLTK).
- +//
- +// Copyright 1998-2005 by Bill Spitzak and others.
- +//
- +// Written by Nikita Egorov (NikeGo@gmail.com)
- +// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- +// USA.
- +//
- +// Please report all bugs and problems on the following page:
- +//
- +// http://www.fltk.org/str.php
- +//
- +
- +#ifndef _XUTILS_H_
- +#define _XUTILS_H_
- +
- +#include <stdio.h>
- +#include <malloc.h>
- +#include <directfb.h>
- +#include <directfb_strings.h>
- +#include <directfb_util.h>
- +
- +#include "Enumerations.H"
- +
- +#define Success 0 /* everything's okay */
- +
- +#if USE_ALLOCA
- +/* alloca() is available, so use it for better performance */
- +#define ALLOCA(size) alloca(size)
- +#define FREEA(pmem)
- +#else
- +/* no alloca(), so use malloc()/free() instead */
- +#define ALLOCA(size) Xmalloc(size)
- +#define FREEA(pmem) Xfree(pmem)
- +#endif
- +
- +/* malloc stuff */
- +#if MALLOC_0_RETURNS_NULL
- +/* for machines that do not return a valid pointer for malloc(0)*/
- +# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))
- +# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))
- +# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))
- +#else
- +# define Xmalloc(size) malloc((size))
- +# define Xrealloc(ptr, size) realloc((ptr), (size))
- +# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))
- +#endif
- +
- +#define Xfree(ptr) free((ptr))
- +
- +#define swap(a,b) do { a ^= b; b ^= a; a ^= b; } while (0)
- +
- +typedef struct surface_context {
- + IDirectFBSurface* surface;
- + DFBUpdates updates;
- + surface_context* clip_mask;
- + DFBRegion clip_region;
- + struct {
- + u8 r,g,b,a; // current color
- + };
- + struct {
- + u32 dashmask; // An actual bitmask of the dash values
- + u32 dashcount; // The number of bits defined in the dashmask
- + u32 bit; // current bit
- + };
- +}*GC,*Surface;
- +
- +typedef uintptr_t XID;
- +typedef XID Window;
- +typedef XID Drawable;
- +typedef XID Pixmap;
- +typedef DFBPoint XPoint;
- +typedef DFBPoint POINT;
- +
- +typedef DFBRectangle RECT;
- +typedef DFBRectangle XRectangle;
- +typedef DFBRegion* Region;
- +typedef IDirectFBFont* XFont;
- +typedef IDirectFBWindow* dfbWindow;
- +
- +typedef ulong Colormap;
- +typedef IDirectFBDisplayLayer Display;
- +
- +typedef XID KeySym;
- +
- +// try to convert xid into a pointer
- +#define ISGC(xid) ((xid)&~0xFFFF)?(GC)(xid):0
- +
- +#define PIXMAP(surf) (Pixmap)(surf)
- +
- +GC find_gc(XID xid);
- +
- +typedef struct POINT_f {
- + double x;
- + double y;
- +} POINT_f_t;
- +
- +/* outline and filled arc and pie types*/
- +#define ARC 0x0001 /* arc*/
- +#define OUTLINE 0x0002
- +#define ARCOUTLINE 0x0003 /* arc + outline*/
- +#define PIE 0x0004 /* pie (filled)*/
- +#define ELLIPSE 0x0008 /* ellipse outline*/
- +#define ELLIPSEFILL 0x0010 /* ellipse filled*/
- +
- +/* set polygon fill routine*/
- +#define EDGEPOLYFILL 1 /* edge table, malloc, qsort*/
- +#define HAVEFLOAT 1
- +
- +/* Fill mode */
- +#define FILL_SOLID 0
- +#define FILL_STIPPLE 1
- +#define FILL_OPAQUE_STIPPLE 2
- +#define FILL_TILE 3
- +
- +#define MIN(a,b) ((a) < (b) ? (a) : (b))
- +#define MAX(a,b) ((a) > (b) ? (a) : (b))
- +
- +#if 1
- +# define MEMORY_TYPE DSCAPS_VIDEOONLY
- +#else
- +# define MEMORY_TYPE DSCAPS_SYSTEMONLY
- +#endif
- +
- +void release_gc(GC gc);
- +void release_window(dfbWindow win);
- +
- +#define __tolower(a) (((a) >= 'A' && ((a) <= 'Z') ? ((a)+('a'-'A')):(a)))
- +#define __toupper(a) (((a) >= 'a' && ((a) <= 'z') ? ((a)-('a'-'A')):(a)))
- +
- +/*
- + * Where to find fonts...
- + */
- +
- +#define X11_FONT_DIR1 "/usr/fonts/truetype"
- +#define X11_FONT_DIR2 "/usr/X11R6/lib/X11/fonts/TrueType"
- +
- +#define X11_RGBTXT "/usr/X11R6/lib/X11/rgb.txt"
- +
- +/* Changeable options*/
- +#define USE_ALLOCA 1 /* set if system has alloca()*/
- +#define MALLOC_0_RETURNS_NULL 0 /* not yet needed*/
- +
- +/* required settings*/
- +#define NeedFunctionPrototypes 1 /* ANSI C*/
- +#define XLIB_ILLEGAL_ACCESS 1 /* define real structures*/
- +
- +/* deal with _Xconst differences in X11 header files*/
- +#ifndef XCONST
- +#define XCONST _Xconst
- +#endif
- +
- +
- +#define None 0
- +
- +/*
- + * cursor structure for DirectFB
- + */
- +
- +typedef struct _cursor {
- + Pixmap shape;
- + int hot_x;
- + int hot_y;
- + Pixmap source;
- + Pixmap mask;
- +}*Cursor;
- +
- +/* Display classes used in opening the connection
- + * Note that the statically allocated ones are even numbered and the
- + * dynamically changeable ones are odd numbered */
- +
- +#define StaticGray 0
- +#define GrayScale 1
- +#define StaticColor 2
- +#define PseudoColor 3
- +#define TrueColor 4
- +#define DirectColor 5
- +
- +#define LSBFirst 0
- +#define MSBFirst 1
- +
- +/*
- + * Visual structure; contains information about colormapping possible.
- + */
- +typedef struct {
- + void *ext_data; /* hook for extension to hang data */
- + int visualid; /* visual id of this visual */
- + int c_class; /* C++ class of screen (monochrome, etc.) */
- + unsigned long red_mask, green_mask, blue_mask; /* mask values */
- + int bits_per_rgb; /* log base 2 of distinct color values */
- + int map_entries; /* color map entries */
- +} Visual;
- +
- +/*
- + * Information used by the visual utility routines to find desired visual
- + * type from the many visuals a display may support.
- + */
- +typedef struct {
- + Visual *visual;
- + int visualid;
- + int screen;
- + int depth;
- + int c_class; /* C++ */
- + unsigned long red_mask;
- + unsigned long green_mask;
- + unsigned long blue_mask;
- + int colormap_size;
- + int bits_per_rgb;
- + int byte_order;
- +///////////
- + int bits_per_pixel;
- + int bytes_per_pixel;
- +} VisualInfo;
- +
- +
- +#define Status int
- +#define _Xconst const
- +
- +
- +// create compatible surface system memory only;
- +GC create_mem_gc( int w ,int h, int pf = -1 );
- +Pixmap create_pixmap( int w ,int h, int pf = -1 );
- +
- +/*defines for unmodified (Xrm) Xlib routines...*/
- +/*#define LockDisplay(dpy)
- +#define UnlockDisplay(dpy)
- +#define _XLockMutex(lock)
- +#define _XUnlockMutex(lock)
- +#define _XCreateMutex(lock)
- +#define _XFreeMutex(lock)
- +*/
- +/* ImageFormat -- PutImage, GetImage */
- +
- +#define XYBitmap 0 /* depth 1, XYFormat */
- +#define XYPixmap 1 /* depth == drawable depth */
- +#define ZPixmap 2 /* depth == drawable depth */
- +
- +/*
- + * Data structure for retrieving info about pixmap formats.
- + */
- +typedef struct {
- + int depth;
- + int bits_per_pixel;
- + int scanline_pad;
- +} XPixmapFormatValues;
- +
- +/*
- + * Data structure for "image" data, used by image manipulation routines.
- + */
- +typedef struct _XImage {
- + int width, height; /* size of image */
- + int xoffset; /* number of pixels offset in X direction */
- + int format; /* XYBitmap, XYPixmap, ZPixmap */
- + char *data; /* pointer to image data */
- + int byte_order; /* data byte order, LSBFirst, MSBFirst */
- + int bitmap_unit; /* quant. of scanline 8, 16, 32 */
- + int bitmap_bit_order; /* LSBFirst, MSBFirst */
- + int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
- + int depth; /* depth of image */
- + int bytes_per_line; /* accelarator to next line */
- + int bits_per_pixel; /* bits per pixel (ZPixmap) */
- + unsigned long red_mask; /* bits in z arrangment */
- + unsigned long green_mask;
- + unsigned long blue_mask;
- + // XPointer obdata; /* hook for the object routines to hang on */
- + struct funcs { /* image manipulation routines */
- +#if 1 //NeedFunctionPrototypes
- + struct _XImage *(*create_image)(
- + Display* /* display */,
- + Visual* /* visual */,
- + unsigned int /* depth */,
- + int /* format */,
- + int /* offset */,
- + char* /* data */,
- + unsigned int /* width */,
- + unsigned int /* height */,
- + int /* bitmap_pad */,
- + int /* bytes_per_line */);
- + int (*destroy_image) (struct _XImage *);
- + unsigned long (*get_pixel) (struct _XImage *,unsigned int, unsigned int);
- + int (*put_pixel) (struct _XImage *,unsigned int, unsigned int, unsigned long);
- + struct _XImage *(*sub_image)(struct _XImage *,unsigned int, unsigned int, unsigned int, unsigned int);
- + int (*add_pixel) (struct _XImage *, long);
- +#else
- + struct _XImage *(*create_image)();
- + int (*destroy_image)();
- + unsigned long (*get_pixel)();
- + int (*put_pixel)();
- + struct _XImage *(*sub_image)();
- + int (*add_pixel)();
- +#endif
- + } f;
- +} XImage;
- +
- +/*
- + * stubs..
- + */
- +
- +char* XKeysymToString(KeySym keysym);
- +
- +int XBell(Display *display, int percent);
- +
- +int XMapWindow(Display* display, Window w);
- +
- +int XMapRaised(Display* display, Window w);
- +
- +int XUnmapWindow(Display* display, Window w);
- +
- +char* XGetDefault(Display* display, _Xconst char* program, _Xconst char*);
- +
- +#define RootWindow( d, s ) fl_window
- +#define DefaultRootWindow( d ) fl_window
- +#define AllPlanes ((unsigned long)~0L)
- +
- +int XQueryKeymap(Display* d, char s[32]);
- +
- +int XFlush(Display* display);
- +
- +int XKeysymToKeycode(Display* d, KeySym ks);
- +
- +/* Return values from XRectInRegion() */
- +
- +#define RectangleOut 0
- +#define RectangleIn 1
- +#define RectanglePart 2
- +
- +/*
- + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
- + * value (x, y, width, height) was found in the parsed string.
- + */
- +#define NoValue 0x0000
- +#define XValue 0x0001
- +#define YValue 0x0002
- +#define WidthValue 0x0004
- +#define HeightValue 0x0008
- +#define AllValues 0x000F
- +#define XNegative 0x0010
- +#define YNegative 0x0020
- +
- +#define AllocNone 0 /* create map with no entries */
- +#define AllocAll 1 /* allocate entire map writeable */
- +
- +
- +/*
- + * Data structure used by color operations
- + */
- +typedef struct {
- + long pixel;
- + unsigned short red, green, blue;
- + unsigned short alpha;
- + char flags; /* do_red, do_green, do_blue */
- + char pad;
- +} XColor;
- +
- +/* Used internally for the colormap */
- +
- +#define GR_PIXELVAL int
- +#define GR_COLOR int
- +
- +typedef struct {
- + GR_PIXELVAL value;
- + int ref;
- + unsigned short r, g, b;
- +} nxColorval;
- +
- +typedef struct _nxColormap {
- + int id;
- + int color_alloc;
- + int cur_color;
- + int saved_color;
- + DFBColor colors[256];
- + nxColorval *colorval;
- + struct _nxColormap *next;
- +} nxColormap;
- +
- +extern Pixmap clip_mask;
- +/*
- + *
- + * Region and rectange functions
- + *
- + */
- +int
- +XCopyArea(Display *display,Drawable src,Drawable dest,GC gc,
- + int src_x,int src_y,unsigned width,unsigned height,int dest_x,int dest_y);
- +
- +Region XRectangleRegion(int x, int y, int w, int h);
- +
- +Region XCreateRegion();
- +
- +int XDestroyRegion(Region r);
- +
- +int XRectInRegion(Region r,int x,int y,int w,int h);
- +
- +void XClipBox(Region r, XRectangle* rect);
- +
- +void XSetRegion(Display* display, GC gc, Region r, int set_clip=1);
- +
- +void XSetClipMask(Display* display, GC gc, Pixmap pixmap);
- +
- +int XIntersectRegion(Region r1, Region r2, Region newReg);
- +
- +int XSetClipOrigin(Display* display, GC gc, int clip_x_origin, int clip_y_origin);
- +
- +int XUnionRectWithRegion(XRectangle* rect, Region source, Region dest);
- +
- +int XUnionRectWithRegion( int x,int y,int w,int h, Region source, Region dest);
- +
- +int XParseGeometry(const char *parsestring, int *x, int *y, unsigned int *w, unsigned int *h);
- +
- +Status XParseColor(Display *display, Colormap colormap, const char *spec, XColor *exact_def_return);
- +
- +/*********************************************/
- +void flip_updates( GC );
- +
- +void remove_updates( GC );
- +
- +void update_region( GC surface, DFBRegion* r );
- +
- +void update_region(GC surface,int x1,int y1,int x2,int y2);
- +
- +#define update_rect(s,x,y,w,h)\
- + update_region((s),DFB_REGION_VALS_FROM_RECTANGLE_VALS((x),(y),(w),(h)));
- +
- +/*********************************************/
- +extern int gr_fillmode;
- +
- +void XDrawLine(Display* display,Drawable d,GC gc,int x1,int y1,int x2,int y2);
- +
- +void XDrawLines(Display* display,Drawable d,GC gc,Region points,int npoints,int mode);
- +
- +void XDrawRectangle(Display* display,Drawable d,GC gc,int x,int y,int width,int height);
- +
- +void XFillRectangle(Display* display,Drawable d,GC gc,int x,int y,int width,int height);
- +
- +#define draw_line_i(x1,y1,x2,y2)\
- + XDrawLine(fl_display,fl_window,fl_gc, (int)(x1+.5),(int)(y1+.5),(int)(x2+.5),(int)(y2+.5))
- +
- +#define draw_line_r(x1,y1,x2,y2)\
- + draw_smooth_line(fl_gc,x1,y1,x2,y2)
- +
- +void FillPoly(Drawable d,GC gc,int count, POINT_f *pointtable );
- +
- +void Arc(GC gc, short x0, short y0, short rx, short ry, short ax, short ay, short bx, short by, int type);
- +
- +void ArcAngle(GC gc, int x,int y,int w,int h,double a1,double a2, int type );
- +
- +#ifdef SMOOTH_DRAWING
- +/* experimental stuff */
- +
- +void SmoothPoly(GC gc, int count, POINT_f *pointtable);
- +
- +void draw_smooth_line(GC gc, double x1, double y1, double x2, double y2);
- +
- +void fl_filter_offscreen(GC offscreen, int x, int y, int w, int h, int );
- +
- +void drawrow(GC gc,int x1,int x2,int y);
- +
- +#endif /* SMOOTH_DRAWING */
- +
- +void set_dash_style(GC ctx, u32 mask, u32 count);
- +
- +void SetDashStyle( unsigned long mask);
- +
- +int SetClipRect (int x, int y, int w, int h);
- +
- +int SetClipRect (DFBRegion* r);
- +
- +/* _colormap.cxx*/
- +nxColormap *_nxFindColormap(Colormap id);
- +
- +Colormap _nxDefaultColormap(Display* display);
- +
- +Colormap XCreateColormap(Display * display, Window w, Visual * visual, int alloc);
- +
- +inline Colormap XCreateColormap(Display *display ){
- + return XCreateColormap( display , 0, 0, 0 );
- +}
- +
- +GR_COLOR GrGetColorByName(char *colorname, int *retr, int *retg, int *retb);
- +
- +int get_rgb_color( int xcolor, uchar& r, uchar& g, uchar& b );
- +
- +int get_index_color(uchar r,uchar g,uchar b);
- +
- +int XAllocColor( Display* display, Colormap colormap, XColor* in_out);
- +
- +int XQueryColor( Display* display, Colormap colormap, XColor * def);
- +
- +int XQueryColors( Display* display, Colormap colormap, XColor * def_in,int ncolors);
- +
- +int XFreeColors( Display* display, Colormap colormap, unsigned long pixels[],int npixels, unsigned long planes);
- +
- +int XFlushColormap( Display* display, Colormap colormap );
- +
- +void _nxPixel2RGB(Display* display, unsigned long color,
- + unsigned short *red, unsigned short *green, unsigned short *blue);
- +
- +/* _listfonts.cxx */
- +extern char **_nxfontlist;
- +
- +extern int _nxfontcount;
- +
- +FILE* _nxLoadFontDir(char *str);
- +
- +void _nxSetDefaultFontDir(void);
- +
- +void _nxSetFontDir(char **directories, int ndirs);
- +
- +char** _nxGetFontDir(int *count);
- +
- +void _nxFreeFontDir(char **list);
- +
- +/* _loadfont.cxx*/
- +char* _nxFindX11Font(const char *in_font);
- +
- +/* */
- +char** XListFonts( Display* display, const char *pattern, int maxnames, int *actual_count_return);
- +
- +XFont XLoadFont( Display* display, const char *fname );
- +
- +void XDestroyWindow( Display* display , Window window );
- +
- +int XFreeFont( Display* d, XFont font);
- +
- +int XFreeFontNames(char **list);
- +
- +int XIconifyWindow(Display* d, Window w, void* v);
- +
- +/*
- + * image functions
- + */
- +int XPutImage(Display* display, Drawable d, GC gc, XImage * image,
- + int src_x, int src_y, int dest_x, int dest_y, unsigned int width,
- + unsigned int height);
- +
- +XImage* XCreateImage(Display* display, Visual* visual, unsigned int depth,
- + int format, int offset, char *data, unsigned int width,
- + unsigned int height, int bitmap_pad, int bytes_per_line);
- +
- +XImage* XGetImage(Display* display, Drawable d, int x, int y,
- + unsigned int width, unsigned int height,
- + unsigned long plane_mask, int format);
- +
- +int XDestroyImage(XImage *image);
- +
- +Pixmap XCreateBitmapFromData(Display* display, Drawable d, const char *data,
- + unsigned int width, unsigned int height);
- +
- +/*
- + * cursors
- + */
- +
- +void XFreeCursor( Display* display, Cursor xc );
- +
- +inline void XFreePixmap(Display* display, Pixmap p )
- +{
- + if (ISGC(p))
- + release_gc( (GC)p );
- +}
- +
- +int XSetForeground(Display* display, GC gc, int color_index);
- +
- +void XDefineCursor(Display* display, Window win, Cursor c);
- +
- +Cursor XCreatePixmapCursor( Display* display, Pixmap p, Pixmap m, XColor *col1, XColor *col2, unsigned hot_x, unsigned hot_y );
- +
- +Cursor XCreateFontCursor(Display *display, unsigned int shape);
- +
- +int XRecolorCursor(Display* display, Cursor cursor, XColor *fg_col, XColor *bg_col);
- +
- +/********************************************************************************/
- +
- +/*static inline int
- +__sleep(int mssec){
- + struct timespec rqtp,rmtp;
- + rqtp.tv_sec = mssec / 1000;
- + rqtp.tv_nsec = mssec * 1000000;
- + nanosleep(&rqtp, &rmtp);
- + return rmtp.tv_sec * 1000 + rmtp.tv_nsec / 1000000;
- +}*/
- +
- +static const DirectFBPixelFormatNames(format_names);
- +
- +static inline const char* pixelformat_name( int format ) {
- + int i;
- + for (i=0; format_names[i].format != DSPF_UNKNOWN; i++) {
- + if (format_names[i].format == (DFBSurfacePixelFormat)format)
- + return format_names[i].name;
- + }
- + return "INVALID FORMAT";
- +}
- +
- +void dump_surf_data(GC surf, int x, int y, int w, int h);
- +
- +/*****************************************************************
- + * EVENT DEFINITIONS
- + *****************************************************************/
- +
- +/* Input Event Masks. Used as event-mask window attribute and as arguments
- + to Grab requests. Not to be confused with event names. */
- +
- +#define NoEventMask 0L
- +#define KeyPressMask (1L<<0)
- +#define KeyReleaseMask (1L<<1)
- +#define ButtonPressMask (1L<<2)
- +#define ButtonReleaseMask (1L<<3)
- +#define EnterWindowMask (1L<<4)
- +#define LeaveWindowMask (1L<<5)
- +#define PointerMotionMask (1L<<6)
- +#define PointerMotionHintMask (1L<<7)
- +#define Button1MotionMask (1L<<8)
- +#define Button2MotionMask (1L<<9)
- +#define Button3MotionMask (1L<<10)
- +#define Button4MotionMask (1L<<11)
- +#define Button5MotionMask (1L<<12)
- +#define ButtonMotionMask (1L<<13)
- +#define KeymapStateMask (1L<<14)
- +#define ExposureMask (1L<<15)
- +#define VisibilityChangeMask (1L<<16)
- +#define StructureNotifyMask (1L<<17)
- +#define ResizeRedirectMask (1L<<18)
- +#define SubstructureNotifyMask (1L<<19)
- +#define SubstructureRedirectMask (1L<<20)
- +#define FocusChangeMask (1L<<21)
- +#define PropertyChangeMask (1L<<22)
- +#define ColormapChangeMask (1L<<23)
- +#define OwnerGrabButtonMask (1L<<24)
- +
- +/* Event names. Used in "type" field in XEvent structures. Not to be
- +confused with event masks abo…