From e182cdcdbeefe5eccda0ab64aed1ce8c39f98727 Mon Sep 17 00:00:00 2001 From: Nicholas Niro Date: Tue, 13 Mar 2007 05:19:05 -0500 Subject: [PATCH] started to fix the manuals for EBuf. Implemented a good working version of neuroman.tcl. Coded a new dynamic loader for bitmaps, still need to code the context allocator/deallocator. got rid of the bitmap load from the buffer functions; they are only deactivated for now, will see if we shoudl get rid of it completely or see if theres still some uses for it. --- Makefile.am | 25 +- Makefile.in | 82 +--- configure | 20 +- configure.ac | 18 +- docs/Makefile.am | 2 +- docs/Makefile.in | 2 +- docs/neuroman.tcl | 157 ++----- include/neuro/ebuf.h | 60 +-- include/neuro/extlib.h | 1057 ++++++++++++++++++++++++++++++++++++++++++++++++ libtool | 327 +-------------- src/extlib/sdl.c | 2 + src/extlib/x11.c | 85 +--- src/misc/Makefile.am | 2 +- src/misc/Makefile.in | 2 +- src/misc/bitmap.c | 340 ++++++++++++++-- src/misc/bitmap.h | 13 + version.mk | 4 +- 17 files changed, 1513 insertions(+), 685 deletions(-) rewrite Makefile.am (94%) create mode 100644 include/neuro/extlib.h create mode 100644 src/misc/bitmap.h diff --git a/Makefile.am b/Makefile.am dissimilarity index 94% index cbb8913..8f5af73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,18 +1,7 @@ -EXTRA_DIST = .git \ - version.mk \ - include/extlib.h \ - include/extlib_sdl.h - -SUBDIRS=src docs - -include_HEADERS= \ - include/neuro/debug.h \ - include/neuro/NEURO.h \ - include/neuro/neuro_engine.h \ - include/neuro/ebuf.h \ - include/neuro/events.h \ - include/neuro/graphics.h \ - include/neuro/neuro_main.h \ - include/neuro/other.h \ - include/neuro/typedef.h \ - include/neuro/extlib.h +EXTRA_DIST = .git \ + version.mk + +SUBDIRS = \ + include \ + src \ + docs diff --git a/Makefile.in b/Makefile.in index 4d6acdf..a279e57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -36,11 +35,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - TODO config.guess config.sub depcomp install-sh ltmain.sh \ - missing +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS TODO config.guess config.sub depcomp \ + install-sh ltmain.sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -58,15 +56,6 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(includedir)" -includeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -205,22 +194,12 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = .git \ - version.mk \ - include/extlib.h \ - include/extlib_sdl.h - -SUBDIRS = src docs -include_HEADERS = \ - include/neuro/debug.h \ - include/neuro/NEURO.h \ - include/neuro/neuro_engine.h \ - include/neuro/ebuf.h \ - include/neuro/events.h \ - include/neuro/graphics.h \ - include/neuro/neuro_main.h \ - include/neuro/other.h \ - include/neuro/typedef.h \ - include/neuro/extlib.h + version.mk + +SUBDIRS = \ + include \ + src \ + docs all: all-recursive @@ -268,23 +247,6 @@ clean-libtool: distclean-libtool: -rm -f libtool uninstall-info-am: -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ - rm -f "$(DESTDIR)$(includedir)/$$f"; \ - done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -409,7 +371,6 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/include $(distdir)/include/neuro @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -550,12 +511,9 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile $(HEADERS) +all-am: Makefile installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -600,7 +558,7 @@ info: info-recursive info-am: -install-data-am: install-includeHEADERS +install-data-am: install-exec-am: @@ -628,7 +586,7 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-includeHEADERS uninstall-info-am +uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive @@ -640,14 +598,12 @@ uninstall-info: uninstall-info-recursive distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ - install-includeHEADERS install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-includeHEADERS \ - uninstall-info-am + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/configure b/configure index eb909b0..74de448 100755 --- a/configure +++ b/configure @@ -1514,9 +1514,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # NEURO_MAJOR_VERSION=0 NEURO_MINOR_VERSION=49 -NEURO_MICRO_VERSION=5 +NEURO_MICRO_VERSION=21 NEURO_INTERFACE_AGE=2 -NEURO_REVISION=2 +NEURO_REVISION=12 NEURO_BINARY_AGE=2 NEURO_VERSION=$NEURO_MAJOR_VERSION.$NEURO_MINOR_VERSION.$NEURO_MICRO_VERSION @@ -21290,9 +21290,6 @@ fi fi freetype_enable=yes - - cp include/extlib.h include/neuro - cat include/extlib_sdl.h >> include/neuro/extlib.h fi echo "$as_me:$LINENO: checking for gzgetc in -lz" >&5 echo $ECHO_N "checking for gzgetc in -lz... $ECHO_C" >&6 @@ -22923,8 +22920,6 @@ fi freetype_enable=yes - - cp include/extlib.h include/neuro fi @@ -23100,14 +23095,7 @@ includedir=$includedir/neuro echo # enumerate the Makefiles to be created - ac_config_files="$ac_config_files Makefile src/Makefile src/memory/Makefile src/video/Makefile src/events/Makefile src/extlib/Makefile src/misc/Makefile docs/Makefile" - -#add those above when they are started -#src/gui/Makefile -#src/script/Makefile -#src/sound/Makefile -#src/sound/music/Makefile - + ac_config_files="$ac_config_files Makefile include/Makefile include/neuro/Makefile src/Makefile src/memory/Makefile src/video/Makefile src/events/Makefile src/extlib/Makefile src/misc/Makefile docs/Makefile" #AC_MSG_NOTICE([This is the low library Neuro will use : $SELECTED_LOWLIB]) @@ -23716,6 +23704,8 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/neuro/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/neuro/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/memory/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/memory/Makefile" ;; "src/video/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/video/Makefile" ;; diff --git a/configure.ac b/configure.ac index f9a32ab..6c52f04 100644 --- a/configure.ac +++ b/configure.ac @@ -10,9 +10,9 @@ AC_INIT(README) # NEURO_MAJOR_VERSION=0 NEURO_MINOR_VERSION=49 -NEURO_MICRO_VERSION=5 +NEURO_MICRO_VERSION=21 NEURO_INTERFACE_AGE=2 -NEURO_REVISION=2 +NEURO_REVISION=12 NEURO_BINARY_AGE=2 NEURO_VERSION=$NEURO_MAJOR_VERSION.$NEURO_MINOR_VERSION.$NEURO_MICRO_VERSION @@ -162,9 +162,6 @@ if test $SELECTED_LOWLIB = sdl; then fi freetype_enable=yes - - cp include/extlib.h include/neuro - cat include/extlib_sdl.h >> include/neuro/extlib.h fi dnl ---------------- dnl Zlib check @@ -193,8 +190,6 @@ if test $SELECTED_LOWLIB = X11; then [AC_MSG_ERROR(You don't have libXpm)]) freetype_enable=yes - - cp include/extlib.h include/neuro fi dnl ---------------- @@ -235,6 +230,8 @@ echo # enumerate the Makefiles to be created AC_CONFIG_FILES([ Makefile +include/Makefile +include/neuro/Makefile src/Makefile src/memory/Makefile src/video/Makefile @@ -243,13 +240,6 @@ src/extlib/Makefile src/misc/Makefile docs/Makefile ]) -#add those above when they are started -#src/gui/Makefile -#src/script/Makefile -#src/sound/Makefile -#src/sound/music/Makefile - - #AC_MSG_NOTICE([This is the low library Neuro will use : $SELECTED_LOWLIB]) diff --git a/docs/Makefile.am b/docs/Makefile.am index c99b64e..d88977f 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,6 @@ #!/bin/bash -EXTRA_DIST = neuroman.tcl make_man.sh man.conf +EXTRA_DIST = neuroman.tcl make_man.sh manuals = *.3 diff --git a/docs/Makefile.in b/docs/Makefile.in index a1debf3..54e5a23 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -177,7 +177,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -EXTRA_DIST = neuroman.tcl make_man.sh man.conf +EXTRA_DIST = neuroman.tcl make_man.sh manuals = *.3 man_MANS = $(manuals) noinst_SCRIPTS = $(manuals) diff --git a/docs/neuroman.tcl b/docs/neuroman.tcl index eeb3183..1d1d641 100644 --- a/docs/neuroman.tcl +++ b/docs/neuroman.tcl @@ -101,7 +101,7 @@ # -- constants -- # put the version here -set version "2.0.7b" +set version "2.1.3" # -- global variables -- @@ -368,6 +368,16 @@ proc parseComment {comment name sdescri ldescri options returnval example errors pushData $ctype $buffer extra + # we clean the small buffers of any * characters + # from the comment syntax + Clean_String cname + Clean_String small_d + Clean_String long_d + Clean_String opt + Clean_String retv + Clean_String exmp + Clean_String err + Clean_String rela } proc GetStringWord { str current} { @@ -396,77 +406,34 @@ proc GetStringWord { str current} { return $outword } -proc replace_Stars_By_Void {str} { +proc Clean_String {str} { upvar $str tochange - set i 0 - - #echo "string to change : $tochange" - - foreach word $tochange { - #echo $word - - if {$word == "*"} { - lset tochange $i [format "\b"] - #echo "matched $word" - } elseif {[llength $word] > 1 } { - #echo "calling itself" - replace_Stars_By_Void word - lset tochange $i $word - } + set new_string "" + set temp "" - incr i - } - #echo "string changed(finished product) : $tochange" -} + # \\052 == '*' + # \\\\175 == '\}' and \c\} -proc replace_Stars_By_Space {str} { - upvar $str tochange - set i 0 - set a 0 - - #echo "string to change : \"$tochange\"" - - set len [string length $tochange] + regsub -all " \\052( |\n|$)" $tochange {} new_string - #while {$a < $len} { - # set word [GetStringWord $tochange a] + set temp $new_string + # we get rid of any * right before a '\}' + regsub -all " \\052(\})" $temp "\}" new_string - # echo "Replace_Stars_By_Space -> $word \[$a\]" - # if {$word == "*"} { - # set tochange [string replace $tochange $a $a ""] - # #echo "matched $word" - # } - #} + set temp $new_string - while {$i < $len} { - set a $i - set i [string first "*" $tochange $i] + # we get rid of the very annoying space that gets + # added at the very beginning for every paragraphs. + # we replace by the full string and add a \b character + # at the end to get rid of the space. + regsub -all "\(\\\\n \)*\\\\n " $temp "&\b" new_string - if {$i != $a && $i != -1} { - set before [string index $tochange [expr $i - 1]] - set after [string index $tochange [expr $i + 1]] + set temp $new_string + # we also get rid of any trailing spaces + regsub -all -line "^ " $temp "" new_string - #echo "BEFORE \"$before\" char \"[string index $tochange $i]\" AFTER \"$after\" \[$i\]" - if {$before == ""} { - set before " " - } - - if {$after == ""} { - set after " " - } - - if {$before == " " && $after == " "} { - set tochange [string replace $tochange $i $i "\b"] - } else { - incr i - } - } else { - break - } - } - - #echo "string changed(finished product) : $tochange" + set tochange $new_string } proc genMan_Unique {comment} { @@ -492,30 +459,24 @@ proc genMan_Unique {comment} { # populate our variables parseComment $comment name msmall_description mdescription moptions mreturnv mexamples merrors mseealso - if {$name == ""} { puts "Error : missing a @name element from a comment" return } - # we get rid of any stars in the name string - set name [string trim $name "*"] - set name [string trim $name " * "] - set name [string trim $name "* "] - set name [string trim $name " *"] - if {$individual == 1} { + # we get rid of any ending spaces + regsub "\( \)*$" $name "" name + # we trim the function's name of any leading * in case + # it returns a pointer -- example : char *somefunction() set fp [open "[string trim $name \"*\"].[lindex $config_i 0]" w] #set fp [open "$name.[lindex $config 0]" w] } - - replace_Stars_By_Void name puts $fp ".TH $name [lindex $config_i 0] \"[lindex $config_i 1]\" \"[lindex $config_i 2]\" \"[lindex $config_i 3]\"" puts $fp ".SH NAME" if {[llength $msmall_description] > 0} { - replace_Stars_By_Void msmall_description puts $fp ".TP" puts $fp "[string trim $name \"*\"]" puts $fp "\- $msmall_description" @@ -525,17 +486,10 @@ proc genMan_Unique {comment} { if {[llength $mdescription] > 0} { puts $fp ".SH DESCRIPTION" - - #replace_Stars_By_Void mdescription - - replace_Stars_By_Space mdescription - puts $fp [subst "$mdescription"] } if {[llength $mreturnv] > 0 && [lindex $function 0] != ""} { - - replace_Stars_By_Void mreturnv puts $fp ".SH RETURN VALUES" puts $fp "$mreturnv" } @@ -543,23 +497,16 @@ proc genMan_Unique {comment} { if {[string length $mexamples] > 0} { puts $fp ".SH EXAMPLE(S)" - replace_Stars_By_Space mexamples - - #puts $fp [subst -nocommands -nobackslashes -novariables $mexamples] puts $fp [subst $mexamples] } if {[llength $merrors] > 0} { - - replace_Stars_By_Void merrors - puts $fp ".SH ERRORS" puts $fp "$merrors" } if {[llength $mseealso] > 0} { puts $fp ".SH SEE ALSO" - replace_Stars_By_Void mseealso puts $fp "$mseealso" } @@ -599,7 +546,6 @@ proc genMan {comment function} { # populate our variables parseComment $comment name msmall_description mdescription moptions mreturnv mexamples merrors mseealso - if {$name == ""} { if {[lindex $function 1] == ""} { # an error @@ -609,24 +555,16 @@ proc genMan {comment function} { } - # we get rid of any stars in the name string - set name [string trim $name "*"] - set name [string trim $name " * "] - set name [string trim $name "* "] - set name [string trim $name " *"] - if {$individual == 1} { - set fp [open "[string trim $name \"*\"].[lindex $config_i 0]" w] - #set fp [open "$name.[lindex $config 0]" w] + # we trim the function's name of any leading * in case + # it returns a pointer -- example : char *somefunction() + set fp [open "[string trimleft $name \"*\"].[lindex $config_i 0]" w] } - - replace_Stars_By_Void name puts $fp ".TH $name [lindex $config_i 0] \"[lindex $config_i 1]\" \"[lindex $config_i 2]\" \"[lindex $config_i 3]\"" puts $fp ".SH NAME" if {[llength $msmall_description] > 0} { - replace_Stars_By_Space msmall_description puts $fp ".TP" puts $fp "[string trim $name \"*\"]" puts $fp "\- [subst $msmall_description]" @@ -638,16 +576,11 @@ proc genMan {comment function} { #echo $function if {[lindex $function 0] != ""} { puts $fp ".SH SYNOPSIS" - puts $fp "[lindex $function 0] $name\([lrange $function 2 [llength $function]]\)" + puts $fp "[lindex $function 0] $name\([lrange $function 2 [expr [llength $function] - 2]]\)" } if {[string length $mdescription] > 0} { puts $fp ".SH DESCRIPTION" - #replace_Stars_By_Void mdescription - - replace_Stars_By_Space mdescription - - puts $fp [subst $mdescription] } @@ -658,10 +591,6 @@ proc genMan {comment function} { set i 1 set cfunc 3 - replace_Stars_By_Void moptions - - #echo "$moptions" - puts $fp ".SH ARGUMENTS" while {$i < $ototal} { @@ -736,32 +665,22 @@ proc genMan {comment function} { } if {[llength $mreturnv] > 0 && [lindex $function 0] != ""} { - - replace_Stars_By_Void mreturnv puts $fp ".SH RETURN VALUES" puts $fp "$mreturnv" } if {[string length $mexamples] > 0} { puts $fp ".SH EXAMPLE(S)" - - replace_Stars_By_Space mexamples - - #puts $fp [subst -nocommands -nobackslashes -novariables $mexamples] puts $fp [subst $mexamples] } if {[llength $merrors] > 0} { - - replace_Stars_By_Void merrors - puts $fp ".SH ERRORS" puts $fp "$merrors" } if {[llength $mseealso] > 0} { puts $fp ".SH SEE ALSO" - replace_Stars_By_Void mseealso puts $fp "$mseealso" } diff --git a/include/neuro/ebuf.h b/include/neuro/ebuf.h index 14e8f58..c0851f5 100644 --- a/include/neuro/ebuf.h +++ b/include/neuro/ebuf.h @@ -31,28 +31,32 @@ * * @description * IN SHORT : \n \n - * The EBUF module. Stands for Engine Buffer. - * Its primary use is to make the allocation and - * reallocation of structures quick and easy; - * It provides secure and easy ways to - * dynamically add, remove and modify entries + * + * \\fIEBuf\\fR stands for Engine Buffer. + * Its primary use is to make structures + * \\fIallocation\\fR and \\fIreallocation\\fR quick + * and easy; It provides \\fIsecure\\fR and easy ways to + * dynamically \\fIadd\\fR, \\fIremove\\fR and \\fImodify\\fR entries * from a buffer. * \n \n \n * * * INTRODUCTION : \n \n - * This manual presents the way the module has - * to be used (which functions to call and in what order) briefly, - * without however, going into too much details. The goal is to - * give a general insight as to which functions are needed to - * attain a result. \n \n \n + * + * This \\fImanual\\fR presents the way the module has + * to be used (which \\fIfunctions\\fR to call and in what order) + * \\fIbriefly\\fR, + * without going into too much details. The goal of this \\fImanual\\fR + * is to give a general insight as to which functions are + * needed to attain a result. \n \n \n * * * BEGINNING : \n \n + * * To make use of even the slightest of this module, the first - * requirement is to create a pointer to an EBUF type. \n \n + * requirement is to create a \\fIpointer\\fR to an EBUF type. \n \n * - * here's an example : EBUF *abuffer; \n \n + * \\fIhere's an example\\fR : EBUF *abuffer; \n \n * * You cannot use a direct variable like : EBUF abuffer -- * for parity reasons(safegard of the data integrity), @@ -65,6 +69,7 @@ * * * INITIALISING AND FREEING : \n \n + * * Now that the EBUF pointer is created, the next step is to * initialize it by using Neuro_CreateEBuf(3). Among other, * it allocated enough memory for its own internal data and @@ -89,6 +94,7 @@ * hability to free them cleanly.\n \n \n * * ALLOCATING NEW DATA : \n \n + * * by now, we have initalised and possibly set a callback to the * instance, but we are still missing an important step : * creating a structure template which the instance EBUF will @@ -108,6 +114,7 @@ * or write from the structure directly. \n \n \n * * MOVING DATA : \n \n + * * on certain occasions, you might want to change the order by which * the data in the EBUF buffer is organised. This is needed when you * want to sort the elements. For this effect, we actually need to use @@ -614,7 +621,7 @@ extern u32 Neuro_GiveEBufCount(EBUF *eng); * * if (Neuro_GiveEBufElem(myeng, an_element, &elem_value)) \n * { \n - * printf("an error happened, the element (an_element) wasn't found in the buffer (myeng)\n"); \n + * printf("an error happened, the element (an_element) wasn't found in the buffer (myeng)\\\\n"); \n * return; \n * } \n \n * @@ -721,6 +728,7 @@ extern void **Neuro_GiveEBufAddr(EBUF *eng, u32 elem); * char *someString; \n * }ST; \n \n \n * + * * static EBUF *myeng; \n \n * * static void \n @@ -750,33 +758,31 @@ extern void **Neuro_GiveEBufAddr(EBUF *eng, u32 elem); * * foo = Neuro_GiveCurEBuf(myeng); \n \n * - * * foo->someString = (char*)malloc(50); \n \n * - * * ... \n \n + * * -- this code outputs to the default output channel -- \n * -- the content of every elements of the buffer -- \n - * u32 total = 0; - * ST *temp = NULL; + * u32 total = 0; \n + * ST *temp = NULL; \n \n * - * if (Neuro_EBufIsEmpty(myeng)) - * return; - * - * total = Neuro_GiveEBufCount(myeng) + 1; + * if (Neuro_EBufIsEmpty(myeng)) \n + * return; \n \n * - * while (total-- > 0) - * { - * temp = Neuro_GiveEBuf(myeng, total); + * total = Neuro_GiveEBufCount(myeng) + 1; \n \n * - * printf("some value : %s\n", temp->someString); - * } + * while (total-- > 0) \n + * { \n + * temp = Neuro_GiveEBuf(myeng, total); \n \n + * + * printf("some value : %s\\\\n", temp->someString); \n + * } \n \n * * ... \n \n * * Neuro_CleanEBuf(&myeng); \n * - * * @related * Neuro_AllocEBuf(3), Neuro_MultiAllocEBuf(3), * Neuro_GiveEBufCount(3) diff --git a/include/neuro/extlib.h b/include/neuro/extlib.h new file mode 100644 index 0000000..c34df86 --- /dev/null +++ b/include/neuro/extlib.h @@ -0,0 +1,1057 @@ +/* Library Abstraction Layer header */ + +#ifndef __EXTLIB_H +#define __EXTLIB_H + +#include "neuro_engine.h" + +/* the keyboard events list + * please note that not all are supported so please + * use ISO/Latin unless told a certain one is supported. + */ + +/* default keysyms */ +#define XK_MISCELLANY +#define XK_XKB_KEYS +#define XK_LATIN1 /* starts at line 407 */ +#define XK_LATIN2 +#define XK_LATIN3 +#define XK_LATIN4 +#define XK_LATIN8 +#define XK_LATIN9 + +#define XK_VoidSymbol 0xFFFFFF /* void symbol */ + +#ifdef XK_MISCELLANY +/* + * TTY Functions, cleverly chosen to map to ascii, for convenience of + * programming, but could have been arbitrary (at the cost of lookup + * tables in client code. + */ + +#define XK_BackSpace 0xFF08 /* back space, back char */ +#define XK_Tab 0xFF09 +#define XK_Linefeed 0xFF0A /* Linefeed, LF */ +#define XK_Clear 0xFF0B +#define XK_Return 0xFF0D /* Return, enter */ +#define XK_Pause 0xFF13 /* Pause, hold */ +#define XK_Scroll_Lock 0xFF14 +#define XK_Sys_Req 0xFF15 +#define XK_Escape 0xFF1B +#define XK_Delete 0xFFFF /* Delete, rubout */ + + + +/* International & multi-key character composition */ + +#define XK_Multi_key 0xFF20 /* Multi-key character compose */ +#define XK_Codeinput 0xFF37 +#define XK_SingleCandidate 0xFF3C +#define XK_MultipleCandidate 0xFF3D +#define XK_PreviousCandidate 0xFF3E + +/* Cursor control & motion */ + +#define XK_Home 0xFF50 +#define XK_Left 0xFF51 /* Move left, left arrow */ +#define XK_Up 0xFF52 /* Move up, up arrow */ +#define XK_Right 0xFF53 /* Move right, right arrow */ +#define XK_Down 0xFF54 /* Move down, down arrow */ +#define XK_Prior 0xFF55 /* Prior, previous */ +#define XK_Page_Up 0xFF55 +#define XK_Next 0xFF56 /* Next */ +#define XK_Page_Down 0xFF56 +#define XK_End 0xFF57 /* EOL */ +#define XK_Begin 0xFF58 /* BOL */ + + +/* Misc Functions */ + +#define XK_Select 0xFF60 /* Select, mark */ +#define XK_Print 0xFF61 +#define XK_Execute 0xFF62 /* Execute, run, do */ +#define XK_Insert 0xFF63 /* Insert, insert here */ +#define XK_Undo 0xFF65 /* Undo, oops */ +#define XK_Redo 0xFF66 /* redo, again */ +#define XK_Menu 0xFF67 +#define XK_Find 0xFF68 /* Find, search */ +#define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */ +#define XK_Help 0xFF6A /* Help */ +#define XK_Break 0xFF6B +#define XK_Mode_switch 0xFF7E /* Character set switch */ +#define XK_script_switch 0xFF7E /* Alias for mode_switch */ +#define XK_Num_Lock 0xFF7F + +/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */ + +#define XK_KP_Space 0xFF80 /* space */ +#define XK_KP_Tab 0xFF89 +#define XK_KP_Enter 0xFF8D /* enter */ +#define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */ +#define XK_KP_F2 0xFF92 +#define XK_KP_F3 0xFF93 +#define XK_KP_F4 0xFF94 +#define XK_KP_Home 0xFF95 +#define XK_KP_Left 0xFF96 +#define XK_KP_Up 0xFF97 +#define XK_KP_Right 0xFF98 +#define XK_KP_Down 0xFF99 +#define XK_KP_Prior 0xFF9A +#define XK_KP_Page_Up 0xFF9A +#define XK_KP_Next 0xFF9B +#define XK_KP_Page_Down 0xFF9B +#define XK_KP_End 0xFF9C +#define XK_KP_Begin 0xFF9D +#define XK_KP_Insert 0xFF9E +#define XK_KP_Delete 0xFF9F +#define XK_KP_Equal 0xFFBD /* equals */ +#define XK_KP_Multiply 0xFFAA +#define XK_KP_Add 0xFFAB +#define XK_KP_Separator 0xFFAC /* separator, often comma */ +#define XK_KP_Subtract 0xFFAD +#define XK_KP_Decimal 0xFFAE +#define XK_KP_Divide 0xFFAF + +#define XK_KP_0 0xFFB0 +#define XK_KP_1 0xFFB1 +#define XK_KP_2 0xFFB2 +#define XK_KP_3 0xFFB3 +#define XK_KP_4 0xFFB4 +#define XK_KP_5 0xFFB5 +#define XK_KP_6 0xFFB6 +#define XK_KP_7 0xFFB7 +#define XK_KP_8 0xFFB8 +#define XK_KP_9 0xFFB9 + + + +/* + * Auxilliary Functions; note the duplicate definitions for left and right + * function keys; Sun keyboards and a few other manufactures have such + * function key groups on the left and/or right sides of the keyboard. + * We've not found a keyboard with more than 35 function keys total. + */ + +#define XK_F1 0xFFBE +#define XK_F2 0xFFBF +#define XK_F3 0xFFC0 +#define XK_F4 0xFFC1 +#define XK_F5 0xFFC2 +#define XK_F6 0xFFC3 +#define XK_F7 0xFFC4 +#define XK_F8 0xFFC5 +#define XK_F9 0xFFC6 +#define XK_F10 0xFFC7 +#define XK_F11 0xFFC8 +#define XK_L1 0xFFC8 +#define XK_F12 0xFFC9 +#define XK_L2 0xFFC9 +#define XK_F13 0xFFCA +#define XK_L3 0xFFCA +#define XK_F14 0xFFCB +#define XK_L4 0xFFCB +#define XK_F15 0xFFCC +#define XK_L5 0xFFCC +#define XK_F16 0xFFCD +#define XK_L6 0xFFCD +#define XK_F17 0xFFCE +#define XK_L7 0xFFCE +#define XK_F18 0xFFCF +#define XK_L8 0xFFCF +#define XK_F19 0xFFD0 +#define XK_L9 0xFFD0 +#define XK_F20 0xFFD1 +#define XK_L10 0xFFD1 +#define XK_F21 0xFFD2 +#define XK_R1 0xFFD2 +#define XK_F22 0xFFD3 +#define XK_R2 0xFFD3 +#define XK_F23 0xFFD4 +#define XK_R3 0xFFD4 +#define XK_F24 0xFFD5 +#define XK_R4 0xFFD5 +#define XK_F25 0xFFD6 +#define XK_R5 0xFFD6 +#define XK_F26 0xFFD7 +#define XK_R6 0xFFD7 +#define XK_F27 0xFFD8 +#define XK_R7 0xFFD8 +#define XK_F28 0xFFD9 +#define XK_R8 0xFFD9 +#define XK_F29 0xFFDA +#define XK_R9 0xFFDA +#define XK_F30 0xFFDB +#define XK_R10 0xFFDB +#define XK_F31 0xFFDC +#define XK_R11 0xFFDC +#define XK_F32 0xFFDD +#define XK_R12 0xFFDD +#define XK_F33 0xFFDE +#define XK_R13 0xFFDE +#define XK_F34 0xFFDF +#define XK_R14 0xFFDF +#define XK_F35 0xFFE0 +#define XK_R15 0xFFE0 + +/* Modifiers */ + +#define XK_Shift_L 0xFFE1 /* Left shift */ +#define XK_Shift_R 0xFFE2 /* Right shift */ +#define XK_Control_L 0xFFE3 /* Left control */ +#define XK_Control_R 0xFFE4 /* Right control */ +#define XK_Caps_Lock 0xFFE5 /* Caps lock */ +#define XK_Shift_Lock 0xFFE6 /* Shift lock */ + +#define XK_Meta_L 0xFFE7 /* Left meta */ +#define XK_Meta_R 0xFFE8 /* Right meta */ +#define XK_Alt_L 0xFFE9 /* Left alt */ +#define XK_Alt_R 0xFFEA /* Right alt */ +#define XK_Super_L 0xFFEB /* Left super */ +#define XK_Super_R 0xFFEC /* Right super */ +#define XK_Hyper_L 0xFFED /* Left hyper */ +#define XK_Hyper_R 0xFFEE /* Right hyper */ +#endif /* XK_MISCELLANY */ + +/* + * ISO 9995 Function and Modifier Keys + * Byte 3 = 0xFE + */ + +#ifdef XK_XKB_KEYS +#define XK_ISO_Lock 0xFE01 +#define XK_ISO_Level2_Latch 0xFE02 +#define XK_ISO_Level3_Shift 0xFE03 +#define XK_ISO_Level3_Latch 0xFE04 +#define XK_ISO_Level3_Lock 0xFE05 +#define XK_ISO_Group_Shift 0xFF7E /* Alias for mode_switch */ +#define XK_ISO_Group_Latch 0xFE06 +#define XK_ISO_Group_Lock 0xFE07 +#define XK_ISO_Next_Group 0xFE08 +#define XK_ISO_Next_Group_Lock 0xFE09 +#define XK_ISO_Prev_Group 0xFE0A +#define XK_ISO_Prev_Group_Lock 0xFE0B +#define XK_ISO_First_Group 0xFE0C +#define XK_ISO_First_Group_Lock 0xFE0D +#define XK_ISO_Last_Group 0xFE0E +#define XK_ISO_Last_Group_Lock 0xFE0F + +#define XK_ISO_Left_Tab 0xFE20 +#define XK_ISO_Move_Line_Up 0xFE21 +#define XK_ISO_Move_Line_Down 0xFE22 +#define XK_ISO_Partial_Line_Up 0xFE23 +#define XK_ISO_Partial_Line_Down 0xFE24 +#define XK_ISO_Partial_Space_Left 0xFE25 +#define XK_ISO_Partial_Space_Right 0xFE26 +#define XK_ISO_Set_Margin_Left 0xFE27 +#define XK_ISO_Set_Margin_Right 0xFE28 +#define XK_ISO_Release_Margin_Left 0xFE29 +#define XK_ISO_Release_Margin_Right 0xFE2A +#define XK_ISO_Release_Both_Margins 0xFE2B +#define XK_ISO_Fast_Cursor_Left 0xFE2C +#define XK_ISO_Fast_Cursor_Right 0xFE2D +#define XK_ISO_Fast_Cursor_Up 0xFE2E +#define XK_ISO_Fast_Cursor_Down 0xFE2F +#define XK_ISO_Continuous_Underline 0xFE30 +#define XK_ISO_Discontinuous_Underline 0xFE31 +#define XK_ISO_Emphasize 0xFE32 +#define XK_ISO_Center_Object 0xFE33 +#define XK_ISO_Enter 0xFE34 + +#define XK_dead_grave 0xFE50 +#define XK_dead_acute 0xFE51 +#define XK_dead_circumflex 0xFE52 +#define XK_dead_tilde 0xFE53 +#define XK_dead_macron 0xFE54 +#define XK_dead_breve 0xFE55 +#define XK_dead_abovedot 0xFE56 +#define XK_dead_diaeresis 0xFE57 +#define XK_dead_abovering 0xFE58 +#define XK_dead_doubleacute 0xFE59 +#define XK_dead_caron 0xFE5A +#define XK_dead_cedilla 0xFE5B +#define XK_dead_ogonek 0xFE5C +#define XK_dead_iota 0xFE5D +#define XK_dead_voiced_sound 0xFE5E +#define XK_dead_semivoiced_sound 0xFE5F +#define XK_dead_belowdot 0xFE60 +#define XK_dead_hook 0xFE61 +#define XK_dead_horn 0xFE62 + +#define XK_First_Virtual_Screen 0xFED0 +#define XK_Prev_Virtual_Screen 0xFED1 +#define XK_Next_Virtual_Screen 0xFED2 +#define XK_Last_Virtual_Screen 0xFED4 +#define XK_Terminate_Server 0xFED5 + +#define XK_AccessX_Enable 0xFE70 +#define XK_AccessX_Feedback_Enable 0xFE71 +#define XK_RepeatKeys_Enable 0xFE72 +#define XK_SlowKeys_Enable 0xFE73 +#define XK_BounceKeys_Enable 0xFE74 +#define XK_StickyKeys_Enable 0xFE75 +#define XK_MouseKeys_Enable 0xFE76 +#define XK_MouseKeys_Accel_Enable 0xFE77 +#define XK_Overlay1_Enable 0xFE78 +#define XK_Overlay2_Enable 0xFE79 +#define XK_AudibleBell_Enable 0xFE7A + +#define XK_Pointer_Left 0xFEE0 +#define XK_Pointer_Right 0xFEE1 +#define XK_Pointer_Up 0xFEE2 +#define XK_Pointer_Down 0xFEE3 +#define XK_Pointer_UpLeft 0xFEE4 +#define XK_Pointer_UpRight 0xFEE5 +#define XK_Pointer_DownLeft 0xFEE6 +#define XK_Pointer_DownRight 0xFEE7 +#define XK_Pointer_Button_Dflt 0xFEE8 +#define XK_Pointer_Button1 0xFEE9 +#define XK_Pointer_Button2 0xFEEA +#define XK_Pointer_Button3 0xFEEB +#define XK_Pointer_Button4 0xFEEC +#define XK_Pointer_Button5 0xFEED +#define XK_Pointer_DblClick_Dflt 0xFEEE +#define XK_Pointer_DblClick1 0xFEEF +#define XK_Pointer_DblClick2 0xFEF0 +#define XK_Pointer_DblClick3 0xFEF1 +#define XK_Pointer_DblClick4 0xFEF2 +#define XK_Pointer_DblClick5 0xFEF3 +#define XK_Pointer_Drag_Dflt 0xFEF4 +#define XK_Pointer_Drag1 0xFEF5 +#define XK_Pointer_Drag2 0xFEF6 +#define XK_Pointer_Drag3 0xFEF7 +#define XK_Pointer_Drag4 0xFEF8 +#define XK_Pointer_Drag5 0xFEFD + +#define XK_Pointer_EnableKeys 0xFEF9 +#define XK_Pointer_Accelerate 0xFEFA +#define XK_Pointer_DfltBtnNext 0xFEFB +#define XK_Pointer_DfltBtnPrev 0xFEFC + +#endif + +/* + * 3270 Terminal Keys + * Byte 3 = 0xFD + */ + +#ifdef XK_3270 +#define XK_3270_Duplicate 0xFD01 +#define XK_3270_FieldMark 0xFD02 +#define XK_3270_Right2 0xFD03 +#define XK_3270_Left2 0xFD04 +#define XK_3270_BackTab 0xFD05 +#define XK_3270_EraseEOF 0xFD06 +#define XK_3270_EraseInput 0xFD07 +#define XK_3270_Reset 0xFD08 +#define XK_3270_Quit 0xFD09 +#define XK_3270_PA1 0xFD0A +#define XK_3270_PA2 0xFD0B +#define XK_3270_PA3 0xFD0C +#define XK_3270_Test 0xFD0D +#define XK_3270_Attn 0xFD0E +#define XK_3270_CursorBlink 0xFD0F +#define XK_3270_AltCursor 0xFD10 +#define XK_3270_KeyClick 0xFD11 +#define XK_3270_Jump 0xFD12 +#define XK_3270_Ident 0xFD13 +#define XK_3270_Rule 0xFD14 +#define XK_3270_Copy 0xFD15 +#define XK_3270_Play 0xFD16 +#define XK_3270_Setup 0xFD17 +#define XK_3270_Record 0xFD18 +#define XK_3270_ChangeScreen 0xFD19 +#define XK_3270_DeleteWord 0xFD1A +#define XK_3270_ExSelect 0xFD1B +#define XK_3270_CursorSelect 0xFD1C +#define XK_3270_PrintScreen 0xFD1D +#define XK_3270_Enter 0xFD1E +#endif + +/* + * Latin 1 + * Byte 3 = 0 + */ +#ifdef XK_LATIN1 +#define XK_space 0x020 +#define XK_exclam 0x021 +#define XK_quotedbl 0x022 +#define XK_numbersign 0x023 +#define XK_dollar 0x024 +#define XK_percent 0x025 +#define XK_ampersand 0x026 +#define XK_apostrophe 0x027 +#define XK_quoteright 0x027 /* deprecated */ +#define XK_parenleft 0x028 +#define XK_parenright 0x029 +#define XK_asterisk 0x02a +#define XK_plus 0x02b +#define XK_comma 0x02c +#define XK_minus 0x02d +#define XK_period 0x02e +#define XK_slash 0x02f +#define XK_0 0x030 +#define XK_1 0x031 +#define XK_2 0x032 +#define XK_3 0x033 +#define XK_4 0x034 +#define XK_5 0x035 +#define XK_6 0x036 +#define XK_7 0x037 +#define XK_8 0x038 +#define XK_9 0x039 +#define XK_colon 0x03a +#define XK_semicolon 0x03b +#define XK_less 0x03c +#define XK_equal 0x03d +#define XK_greater 0x03e +#define XK_question 0x03f +#define XK_at 0x040 +#define XK_A 0x041 +#define XK_B 0x042 +#define XK_C 0x043 +#define XK_D 0x044 +#define XK_E 0x045 +#define XK_F 0x046 +#define XK_G 0x047 +#define XK_H 0x048 +#define XK_I 0x049 +#define XK_J 0x04a +#define XK_K 0x04b +#define XK_L 0x04c +#define XK_M 0x04d +#define XK_N 0x04e +#define XK_O 0x04f +#define XK_P 0x050 +#define XK_Q 0x051 +#define XK_R 0x052 +#define XK_S 0x053 +#define XK_T 0x054 +#define XK_U 0x055 +#define XK_V 0x056 +#define XK_W 0x057 +#define XK_X 0x058 +#define XK_Y 0x059 +#define XK_Z 0x05a +#define XK_bracketleft 0x05b +#define XK_backslash 0x05c +#define XK_bracketright 0x05d +#define XK_asciicircum 0x05e +#define XK_underscore 0x05f +#define XK_grave 0x060 +#define XK_quoteleft 0x060 /* deprecated */ +#define XK_a 0x061 +#define XK_b 0x062 +#define XK_c 0x063 +#define XK_d 0x064 +#define XK_e 0x065 +#define XK_f 0x066 +#define XK_g 0x067 +#define XK_h 0x068 +#define XK_i 0x069 +#define XK_j 0x06a +#define XK_k 0x06b +#define XK_l 0x06c +#define XK_m 0x06d +#define XK_n 0x06e +#define XK_o 0x06f +#define XK_p 0x070 +#define XK_q 0x071 +#define XK_r 0x072 +#define XK_s 0x073 +#define XK_t 0x074 +#define XK_u 0x075 +#define XK_v 0x076 +#define XK_w 0x077 +#define XK_x 0x078 +#define XK_y 0x079 +#define XK_z 0x07a +#define XK_braceleft 0x07b +#define XK_bar 0x07c +#define XK_braceright 0x07d +#define XK_asciitilde 0x07e + +#define XK_nobreakspace 0x0a0 +#define XK_exclamdown 0x0a1 +#define XK_cent 0x0a2 +#define XK_sterling 0x0a3 +#define XK_currency 0x0a4 +#define XK_yen 0x0a5 +#define XK_brokenbar 0x0a6 +#define XK_section 0x0a7 +#define XK_diaeresis 0x0a8 +#define XK_copyright 0x0a9 +#define XK_ordfeminine 0x0aa +#define XK_guillemotleft 0x0ab /* left angle quotation mark */ +#define XK_notsign 0x0ac +#define XK_hyphen 0x0ad +#define XK_registered 0x0ae +#define XK_macron 0x0af +#define XK_degree 0x0b0 +#define XK_plusminus 0x0b1 +#define XK_twosuperior 0x0b2 +#define XK_threesuperior 0x0b3 +#define XK_acute 0x0b4 +#define XK_mu 0x0b5 +#define XK_paragraph 0x0b6 +#define XK_periodcentered 0x0b7 +#define XK_cedilla 0x0b8 +#define XK_onesuperior 0x0b9 +#define XK_masculine 0x0ba +#define XK_guillemotright 0x0bb /* right angle quotation mark */ +#define XK_onequarter 0x0bc +#define XK_onehalf 0x0bd +#define XK_threequarters 0x0be +#define XK_questiondown 0x0bf +#define XK_Agrave 0x0c0 +#define XK_Aacute 0x0c1 +#define XK_Acircumflex 0x0c2 +#define XK_Atilde 0x0c3 +#define XK_Adiaeresis 0x0c4 +#define XK_Aring 0x0c5 +#define XK_AE 0x0c6 +#define XK_Ccedilla 0x0c7 +#define XK_Egrave 0x0c8 +#define XK_Eacute 0x0c9 +#define XK_Ecircumflex 0x0ca +#define XK_Ediaeresis 0x0cb +#define XK_Igrave 0x0cc +#define XK_Iacute 0x0cd +#define XK_Icircumflex 0x0ce +#define XK_Idiaeresis 0x0cf +#define XK_ETH 0x0d0 +#define XK_Eth 0x0d0 /* deprecated */ +#define XK_Ntilde 0x0d1 +#define XK_Ograve 0x0d2 +#define XK_Oacute 0x0d3 +#define XK_Ocircumflex 0x0d4 +#define XK_Otilde 0x0d5 +#define XK_Odiaeresis 0x0d6 +#define XK_multiply 0x0d7 +#define XK_Ooblique 0x0d8 +#define XK_Oslash XK_Ooblique +#define XK_Ugrave 0x0d9 +#define XK_Uacute 0x0da +#define XK_Ucircumflex 0x0db +#define XK_Udiaeresis 0x0dc +#define XK_Yacute 0x0dd +#define XK_THORN 0x0de +#define XK_Thorn 0x0de /* deprecated */ +#define XK_ssharp 0x0df +#define XK_agrave 0x0e0 +#define XK_aacute 0x0e1 +#define XK_acircumflex 0x0e2 +#define XK_atilde 0x0e3 +#define XK_adiaeresis 0x0e4 +#define XK_aring 0x0e5 +#define XK_ae 0x0e6 +#define XK_ccedilla 0x0e7 +#define XK_egrave 0x0e8 +#define XK_eacute 0x0e9 +#define XK_ecircumflex 0x0ea +#define XK_ediaeresis 0x0eb +#define XK_igrave 0x0ec +#define XK_iacute 0x0ed +#define XK_icircumflex 0x0ee +#define XK_idiaeresis 0x0ef +#define XK_eth 0x0f0 +#define XK_ntilde 0x0f1 +#define XK_ograve 0x0f2 +#define XK_oacute 0x0f3 +#define XK_ocircumflex 0x0f4 +#define XK_otilde 0x0f5 +#define XK_odiaeresis 0x0f6 +#define XK_division 0x0f7 +#define XK_oslash 0x0f8 +#define XK_ooblique XK_oslash +#define XK_ugrave 0x0f9 +#define XK_uacute 0x0fa +#define XK_ucircumflex 0x0fb +#define XK_udiaeresis 0x0fc +#define XK_yacute 0x0fd +#define XK_thorn 0x0fe +#define XK_ydiaeresis 0x0ff +#endif /* XK_LATIN1 */ + +/* + * Latin 2 + * Byte 3 = 1 + */ + +#ifdef XK_LATIN2 +#define XK_Aogonek 0x1a1 +#define XK_breve 0x1a2 +#define XK_Lstroke 0x1a3 +#define XK_Lcaron 0x1a5 +#define XK_Sacute 0x1a6 +#define XK_Scaron 0x1a9 +#define XK_Scedilla 0x1aa +#define XK_Tcaron 0x1ab +#define XK_Zacute 0x1ac +#define XK_Zcaron 0x1ae +#define XK_Zabovedot 0x1af +#define XK_aogonek 0x1b1 +#define XK_ogonek 0x1b2 +#define XK_lstroke 0x1b3 +#define XK_lcaron 0x1b5 +#define XK_sacute 0x1b6 +#define XK_caron 0x1b7 +#define XK_scaron 0x1b9 +#define XK_scedilla 0x1ba +#define XK_tcaron 0x1bb +#define XK_zacute 0x1bc +#define XK_doubleacute 0x1bd +#define XK_zcaron 0x1be +#define XK_zabovedot 0x1bf +#define XK_Racute 0x1c0 +#define XK_Abreve 0x1c3 +#define XK_Lacute 0x1c5 +#define XK_Cacute 0x1c6 +#define XK_Ccaron 0x1c8 +#define XK_Eogonek 0x1ca +#define XK_Ecaron 0x1cc +#define XK_Dcaron 0x1cf +#define XK_Dstroke 0x1d0 +#define XK_Nacute 0x1d1 +#define XK_Ncaron 0x1d2 +#define XK_Odoubleacute 0x1d5 +#define XK_Rcaron 0x1d8 +#define XK_Uring 0x1d9 +#define XK_Udoubleacute 0x1db +#define XK_Tcedilla 0x1de +#define XK_racute 0x1e0 +#define XK_abreve 0x1e3 +#define XK_lacute 0x1e5 +#define XK_cacute 0x1e6 +#define XK_ccaron 0x1e8 +#define XK_eogonek 0x1ea +#define XK_ecaron 0x1ec +#define XK_dcaron 0x1ef +#define XK_dstroke 0x1f0 +#define XK_nacute 0x1f1 +#define XK_ncaron 0x1f2 +#define XK_odoubleacute 0x1f5 +#define XK_udoubleacute 0x1fb +#define XK_rcaron 0x1f8 +#define XK_uring 0x1f9 +#define XK_tcedilla 0x1fe +#define XK_abovedot 0x1ff +#endif /* XK_LATIN2 */ + +/* + * Latin 3 + * Byte 3 = 2 + */ + +#ifdef XK_LATIN3 +#define XK_Hstroke 0x2a1 +#define XK_Hcircumflex 0x2a6 +#define XK_Iabovedot 0x2a9 +#define XK_Gbreve 0x2ab +#define XK_Jcircumflex 0x2ac +#define XK_hstroke 0x2b1 +#define XK_hcircumflex 0x2b6 +#define XK_idotless 0x2b9 +#define XK_gbreve 0x2bb +#define XK_jcircumflex 0x2bc +#define XK_Cabovedot 0x2c5 +#define XK_Ccircumflex 0x2c6 +#define XK_Gabovedot 0x2d5 +#define XK_Gcircumflex 0x2d8 +#define XK_Ubreve 0x2dd +#define XK_Scircumflex 0x2de +#define XK_cabovedot 0x2e5 +#define XK_ccircumflex 0x2e6 +#define XK_gabovedot 0x2f5 +#define XK_gcircumflex 0x2f8 +#define XK_ubreve 0x2fd +#define XK_scircumflex 0x2fe +#endif /* XK_LATIN3 */ + + +/* + * Latin 4 + * Byte 3 = 3 + */ + +#ifdef XK_LATIN4 +#define XK_kra 0x3a2 +#define XK_kappa 0x3a2 /* deprecated */ +#define XK_Rcedilla 0x3a3 +#define XK_Itilde 0x3a5 +#define XK_Lcedilla 0x3a6 +#define XK_Emacron 0x3aa +#define XK_Gcedilla 0x3ab +#define XK_Tslash 0x3ac +#define XK_rcedilla 0x3b3 +#define XK_itilde 0x3b5 +#define XK_lcedilla 0x3b6 +#define XK_emacron 0x3ba +#define XK_gcedilla 0x3bb +#define XK_tslash 0x3bc +#define XK_ENG 0x3bd +#define XK_eng 0x3bf +#define XK_Amacron 0x3c0 +#define XK_Iogonek 0x3c7 +#define XK_Eabovedot 0x3cc +#define XK_Imacron 0x3cf +#define XK_Ncedilla 0x3d1 +#define XK_Omacron 0x3d2 +#define XK_Kcedilla 0x3d3 +#define XK_Uogonek 0x3d9 +#define XK_Utilde 0x3dd +#define XK_Umacron 0x3de +#define XK_amacron 0x3e0 +#define XK_iogonek 0x3e7 +#define XK_eabovedot 0x3ec +#define XK_imacron 0x3ef +#define XK_ncedilla 0x3f1 +#define XK_omacron 0x3f2 +#define XK_kcedilla 0x3f3 +#define XK_uogonek 0x3f9 +#define XK_utilde 0x3fd +#define XK_umacron 0x3fe +#endif /* XK_LATIN4 */ + +/* + * Latin-8 + * Byte 3 = 18 + */ +#ifdef XK_LATIN8 +#define XK_Babovedot 0x12a1 +#define XK_babovedot 0x12a2 +#define XK_Dabovedot 0x12a6 +#define XK_Wgrave 0x12a8 +#define XK_Wacute 0x12aa +#define XK_dabovedot 0x12ab +#define XK_Ygrave 0x12ac +#define XK_Fabovedot 0x12b0 +#define XK_fabovedot 0x12b1 +#define XK_Mabovedot 0x12b4 +#define XK_mabovedot 0x12b5 +#define XK_Pabovedot 0x12b7 +#define XK_wgrave 0x12b8 +#define XK_pabovedot 0x12b9 +#define XK_wacute 0x12ba +#define XK_Sabovedot 0x12bb +#define XK_ygrave 0x12bc +#define XK_Wdiaeresis 0x12bd +#define XK_wdiaeresis 0x12be +#define XK_sabovedot 0x12bf +#define XK_Wcircumflex 0x12d0 +#define XK_Tabovedot 0x12d7 +#define XK_Ycircumflex 0x12de +#define XK_wcircumflex 0x12f0 +#define XK_tabovedot 0x12f7 +#define XK_ycircumflex 0x12fe +#endif /* XK_LATIN8 */ + +/* + * Latin-9 (a.k.a. Latin-0) + * Byte 3 = 19 + */ + +#ifdef XK_LATIN9 +#define XK_OE 0x13bc +#define XK_oe 0x13bd +#define XK_Ydiaeresis 0x13be +#endif /* XK_LATIN9 */ + + +/* take note that those functions herein are to be used stricly by the + * local library and not by the external programs! + * + * Those functions are designed for internal use only! their where abouts + * are not garanteed and they surely don't have any (none at all) + * backward compatibility! So use the Neuro_ functions, now please. + * + */ + +/* allocate stuff needed for the video */ +extern int Lib_VideoInit(v_object **screen, v_object **screen_buf); + +/* cleans up stuff allocated for the video */ +extern void Lib_VideoExit(); + +/* allocated stuff needed for events */ +extern int Lib_EventInit(); + +/* cleans up stuff allocated for events */ +extern void Lib_EventExit(); + +/* allocates stuff needed for fonts */ +extern int Lib_FontsInit(); + +/* cleans up stuff allocated for fonts */ +extern void Lib_FontsExit(); + +/* you can set the size of the screen with this function. + * note that this function will not work on the fly, you + * can only use this __before__ you init Neuro! or + * else it won't work. + */ +extern void Lib_SetScreenSize(u32 width, u32 height); + +/* puts the size of the screen in current use in the input variables */ +extern void Lib_GetScreenSize(u32 *width, u32 *height); + +/* for pixel manipulations (input/output) this locks the lock on + * the pixels buffer. So nothing can be done in the background on + * them. + */ +extern void Lib_LockVObject(v_object *vobj); + +/* for pixel manipulations (input/output) this unlocks the lock on + * the pixels buffer. + */ +extern void Lib_UnlockVObject(v_object *vobj); + +/* free a v_object after its use is no longer needed. */ +extern void Lib_FreeVobject(v_object *source); + +/* flip the surface/screen if its double buffered */ +extern void Lib_Flip(v_object *source); + +/* draw rectangles on the surface */ +extern void Lib_FillRect(v_object *source, Rectan *src, u32 color); + +/* used to update only parts of the surface/screen at once */ +extern void Lib_UpdateRect(v_object *source, Rectan *src); + +/* blit one surface to another one with this function */ +extern void Lib_BlitObject(v_object *source, Rectan *src, v_object *destination, Rectan *dst); + +/* SOON TO BE OBSOLETE!! + * + * no idea what that does... it doesn't seem to have any use... + */ +extern void Lib_GiveVobjectProp(v_object *source, Rectan *output); + +/* outputs the current depth in use */ +extern u32 Lib_GetDefaultDepth(); + +/* get sensible informations about a surface and yes, all those needs + * to be filled. + */ +extern void Lib_GetVObjectData(v_object *vobj, u32 *flags, i32 *h, i32 *w, u32 *pitch, void **pixels, Rectan **clip_rect, u8 *bpp, u32 *Rmask, u32 *Gmask, u32 *Bmask, u32 *Amask); + +/* load a M$ bitmap from a file that you input + * pass the address of a pointer v_object : + * v_object *image; + * + * and pointer for that is &image + */ +extern void Lib_LoadBMP(const char *path, v_object **img); + +/* load a M$ bitmap from a buffer in memory + * pass the address of a pointer v_object : + * v_object *image; + * + * and pointer for that is &image + */ +extern void Lib_LoadBMPBuffer(void *data, v_object **img); + +/* outputs the color code(properly aligned) corresponding to + * the three primary color inputs. For surfaces that have + * their own palette, we support an input of the surface. + */ +extern u32 Lib_MapRGB(v_object *vobj, u8 r, u8 g, u8 b); + +/* sets the color key that will not be drawn (for transparency) of a surface. + * this needs to be done strictly before loading a surface with X11 and + * can be done anytime with SDL. + */ +extern void Lib_SetColorKey(v_object *vobj, u32 key); + +/* sets the alpha (transparency) of a surface */ +extern void Lib_SetAlpha(v_object *vobj, u8 alpha); + +/* syncs the pixels so subsequent input or output on them + * are getting correct informations. + */ +extern void Lib_SyncPixels(v_object *src); + +/* puts a pixel into surface srf at the given coordinates */ +extern void Lib_PutPixel(v_object *srf, int x, int y, u32 pixel); + +/* outputs the color of a pixel in the surface srf */ +extern u32 Lib_GetPixel(v_object *srf, int x, int y); + +/* create visual surfaces with this function */ +extern v_object * Lib_CreateVObject(u32 flags, i32 width, i32 height, i32 depth, u32 Rmask, u32 Gmask, u32 Bmask, u32 Amask); + +/* a higher SDL function which is kinda an hack for event.c */ +extern void Lib_EventPoll(); + +/* the poll for the events */ +extern i32 Lib_PollEvent(void *event); + +/* now obsolete, use the CheckKeyStatus function instead */ +extern u8 *Lib_GetKeyState(i32 *numkeys); + +/* better function to get key status */ +extern u8 Lib_CheckKeyStatus(u32 key); + +/* outputs the current status of the mouse and passes the coordinates to the + * address inputed. + */ +extern u8 Lib_GetMouseState(i32 *x, i32 *y); + +/* you can load a truetype (or any other that the freetype library + * supports) with this function. + * returns NULL on error or a pointer to a font_object. + */ +extern font_object *Lib_LoadFontFile(const char *fonts_file_path); + +/* this function is to clean a font file loaded + * using Lib_LoadFontFile + */ +extern void Lib_CleanFont(font_object *font); + +/* even though the input arguments seem to be quite complicated, it is not. + * the ttf input address can be given with the load fonts function, the size + * is the size of the fonts you want in pixels, the character is the character + * code you want to render. + * + * The x and y coordinates are a bit special, the value in those are changed so + * characters in a string have the correct spacing(instead of overlapping). + * + * color is the color you want your character to be and the 2 Rectan output + * the basic informations about the surface so it can be blit easily. + * + * returns the v_object pointer if the character got loaded well or + * NULL if either there was an error or the character that was input + * requires more than one byte to be complete. + * + * NOTE This function do handle spaces! ie ' '. just input the corresponding + * x and y addresses so the function can calculate itself the size they take. + * For this purpose, you CAN leave color, src and dst to 0 or NULL! + * just remember to put the correct size and character (to ' ') so the size + * of the space is correct. + */ +extern v_object *Lib_RenderUnicode(font_object *ttf, u32 size, u32 character, + i16 *x, i16 *y, u32 color, Rectan *src, Rectan *dst); + +#endif /* not __EXTLIB_H */ + +/* overriding macros to support SDL */ +#ifdef USE_SDL + +#ifndef __EXTLIB_SDL_H +#define __EXTLIB_SDL_H + +/* override keymap macros to support SDL */ +#ifdef XK_BackSpace + +#undef XK_BackSpace +#undef XK_Tab +#undef XK_Linefeed +#undef XK_Clear +#undef XK_Return +#undef XK_Pause +#undef XK_Scroll_Lock +#undef XK_Sys_Req +#undef XK_Escape +#undef XK_Delete +#undef XK_Up +#undef XK_Down +#undef XK_Right +#undef XK_Left +#undef XK_Home +#undef XK_Page_Up +#undef XK_Page_Down + +/* numeric keypad */ +#undef XK_KP_0 +#undef XK_KP_1 +#undef XK_KP_2 +#undef XK_KP_3 +#undef XK_KP_4 +#undef XK_KP_5 +#undef XK_KP_6 +#undef XK_KP_7 +#undef XK_KP_8 +#undef XK_KP_9 +#undef XK_KP_Decimal +#undef XK_KP_Divide +#undef XK_KP_Multiply +#undef XK_KP_Subtract +#undef XK_KP_Add +#undef XK_KP_Enter +#undef XK_KP_Equal + +/* numlock elements */ +#undef XK_KP_Insert +#undef XK_KP_End +#undef XK_KP_Down +#undef XK_KP_Page_Down +#undef XK_KP_Left +#undef XK_KP_Begin +#undef XK_KP_Right +#undef XK_KP_Home +#undef XK_KP_Up +#undef XK_KP_Page_Up +#undef XK_KP_Delete + +#endif /* XK_BackSpace */ + + + +#define XK_BackSpace 0x0008 /* back space, back char */ +#define XK_Tab 0x0009 +#define XK_Linefeed 0x000A /* Linefeed, LF */ +#define XK_Clear 0x000C +#define XK_Return 0x000D /* Return, enter */ +#define XK_Pause 0x0013 /* Pause, hold */ +#define XK_Scroll_Lock 0x0014 +#define XK_Sys_Req 0x0015 +#define XK_Escape 0x001B +#define XK_Delete 0x007E /* Delete, rubout */ + +#define XK_Up 0x0111 /* Move up, up arrow */ +#define XK_Down 0x0112 /* Move down, down arrow */ +#define XK_Right 0x0113 /* Move right, right arrow */ +#define XK_Left 0x0114 /* Move left, left arrow */ +#define XK_Home 0x0116 +/*#define XK_Prior 0x0155*/ /* Prior, previous */ +#define XK_Page_Up 0x0118 +/*#define XK_Next 0x0156*/ /* Next */ +#define XK_Page_Down 0x0119 +/*#define XK_End 0x0157*/ /* EOL */ +/*#define XK_Begin 0x0158*/ /* BOL */ + +/* numeric keypad */ +#define XK_KP_0 256 +#define XK_KP_1 257 +#define XK_KP_2 258 +#define XK_KP_3 259 +#define XK_KP_4 260 +#define XK_KP_5 261 +#define XK_KP_6 262 +#define XK_KP_7 263 +#define XK_KP_8 264 +#define XK_KP_9 265 +#define XK_KP_Decimal 266 +#define XK_KP_Divide 267 +#define XK_KP_Multiply 268 +#define XK_KP_Subtract 269 +#define XK_KP_Add 270 +#define XK_KP_Enter 271 +#define XK_KP_Equal 272 + +/* numlock elements */ +/* +#define XK_KP_Insert +#define XK_KP_End +#define XK_KP_Down +#define XK_KP_Page_Down +#define XK_KP_Left +#define XK_KP_Begin +#define XK_KP_Right +#define XK_KP_Home +#define XK_KP_Up +#define XK_KP_Page_Up +#define XK_KP_Delete +*/ +#endif /* NOT __EXTLIB_SDL_H */ + +#endif /* USE_SDL */ diff --git a/libtool b/libtool index 24cae3a..ab7828d 100755 --- a/libtool +++ b/libtool @@ -30,21 +30,21 @@ # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. -SED="/bin/sed" +SED="/usr/bin/sed" # Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="/bin/sed -e s/^X//" +Xsed="/usr/bin/sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. -available_tags=" CXX F77" +available_tags=" CXX" # ### BEGIN LIBTOOL CONFIG -# Libtool was configured on host Gentoo: +# Libtool was configured on host nik.neuroponic.com: # Shell to use when invoking shell scripts. SHELL="/bin/sh" @@ -88,7 +88,7 @@ with_gcc=yes EGREP="grep -E" # The linker used to build libraries. -LD="/usr/i386-pc-linux-gnu/bin/ld" +LD="/usr/i486-slackware-linux/bin/ld" # Whether we need hard or soft links. LN_S="ln -s" @@ -316,10 +316,10 @@ variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBR link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../ /lib/i386-pc-linux-gnu/4.1.1/ /lib/ /usr/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/" +sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../ /lib/i486-slackware-linux/3.3.4/ /lib/ /usr/lib/i486-slackware-linux/3.3.4/ /usr/lib/" # Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/lib/opengl/ati/lib /usr/i386-pc-linux-gnu/lib /usr/lib/gcc/i386-pc-linux-gnu/4.1.1 /usr/lib/nspr /usr/lib/nss /usr/lib /usr/lib/openmotif-2.2 /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib /usr/games/lib /usr/lib/libstdc++-v3/ " +sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/lib /usr/X11R6/lib " # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" @@ -6745,7 +6745,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # End: # ### BEGIN LIBTOOL TAG CONFIG: CXX -# Libtool was configured on host Gentoo: +# Libtool was configured on host nik.neuroponic.com: # Shell to use when invoking shell scripts. SHELL="/bin/sh" @@ -6789,7 +6789,7 @@ with_gcc=yes EGREP="grep -E" # The linker used to build libraries. -LD="/usr/i386-pc-linux-gnu/bin/ld" +LD="/usr/i486-slackware-linux/bin/ld" # Whether we need hard or soft links. LN_S="ln -s" @@ -6918,11 +6918,11 @@ striplib="strip --strip-unneeded" # Dependencies to place before the objects being linked to create a # shared library. -predep_objects="/usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../crti.o /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/crtbeginS.o" +predep_objects="/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crti.o /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtbeginS.o" # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects="/usr/lib/gcc/i386-pc-linux-gnu/4.1.1/crtendS.o /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../crtn.o" +postdep_objects="/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtendS.o /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crtn.o" # Dependencies to place before the objects being linked to create a # shared library. @@ -6934,7 +6934,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path="-L/usr/lib/gcc/i386-pc-linux-gnu/4.1.1 -L/usr/lib/gcc/i386-pc-linux-gnu/4.1.1 -L/usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib -L/usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../.." +compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4 -L/usr/lib/gcc/i486-slackware-linux/3.3.4 -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../.." # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" @@ -7014,10 +7014,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../ /lib/i386-pc-linux-gnu/4.1.1/ /lib/ /usr/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/" +sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../i486-slackware-linux/3.3.4/ /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../ /lib/i486-slackware-linux/3.3.4/ /lib/ /usr/lib/i486-slackware-linux/3.3.4/ /usr/lib/" # Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/lib/opengl/ati/lib /usr/i386-pc-linux-gnu/lib /usr/lib/gcc/i386-pc-linux-gnu/4.1.1 /usr/lib/nspr /usr/lib/nss /usr/lib /usr/lib/openmotif-2.2 /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib /usr/games/lib /usr/lib/libstdc++-v3/ " +sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/lib /usr/X11R6/lib " # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" @@ -7039,302 +7039,3 @@ include_expsyms="" # ### END LIBTOOL TAG CONFIG: CXX -# ### BEGIN LIBTOOL TAG CONFIG: F77 - -# Libtool was configured on host Gentoo: - -# Shell to use when invoking shell scripts. -SHELL="/bin/sh" - -# Whether or not to build shared libraries. -build_libtool_libs=yes - -# Whether or not to build static libraries. -build_old_libs=yes - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=no - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=no - -# Whether or not to optimize for fast installation. -fast_install=yes - -# The host system. -host_alias= -host=i686-pc-linux-gnu - -# An echo program that does not interpret backslashes. -echo="echo" - -# The archiver. -AR="ar" -AR_FLAGS="cru" - -# A C compiler. -LTCC="gcc" - -# A language-specific compiler. -CC="gfortran" - -# Is the compiler the GNU C compiler? -with_gcc=yes - -# An ERE matcher. -EGREP="grep -E" - -# The linker used to build libraries. -LD="/usr/i386-pc-linux-gnu/bin/ld" - -# Whether we need hard or soft links. -LN_S="ln -s" - -# A BSD-compatible nm program. -NM="/usr/bin/nm -B" - -# A symbol stripping program -STRIP="strip" - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=file - -# Used on cygwin: DLL creation program. -DLLTOOL="dlltool" - -# Used on cygwin: object dumper. -OBJDUMP="objdump" - -# Used on cygwin: assembler. -AS="as" - -# The name of the directory that contains temporary libtool files. -objdir=.libs - -# How to create reloadable object files. -reload_flag=" -r" -reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" - -# How to pass a linker flag through the compiler. -wl="-Wl," - -# Object file suffix (normally "o"). -objext="o" - -# Old archive suffix (normally "a"). -libext="a" - -# Shared library suffix (normally ".so"). -shrext_cmds='.so' - -# Executable file suffix (normally ""). -exeext="" - -# Additional compiler flags for building library objects. -pic_flag=" -fPIC" -pic_mode=default - -# What is the maximum length of a command? -max_cmd_len=32768 - -# Does compiler simultaneously support -c and -o options? -compiler_c_o="yes" - -# Must we lock files when doing compilation ? -need_locks="no" - -# Do we need the lib prefix for modules? -need_lib_prefix=no - -# Do we need a version for libraries? -need_version=no - -# Whether dlopen is supported. -dlopen_support=unknown - -# Whether dlopen of programs is supported. -dlopen_self=unknown - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=unknown - -# Compiler flag to prevent dynamic linking. -link_static_flag="-static" - -# Compiler flag to turn off builtin functions. -no_builtin_flag="" - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="\${wl}--export-dynamic" - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec="" - -# Library versioning type. -version_type=linux - -# Format of library name prefix. -libname_spec="lib\$name" - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" - -# The coded name of the library, if different from the real name. -soname_spec="\${libname}\${release}\${shared_ext}\$major" - -# Commands used to build and install an old-style archive. -RANLIB="ranlib" -old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" -old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" -old_postuninstall_cmds="" - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds="" - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds="" - -# Commands used to build and install a shared archive. -archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" -archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ -cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ -\$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ - \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" -postinstall_cmds="" -postuninstall_cmds="" - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds="" -module_expsym_cmds="" - -# Commands to strip libraries. -old_striplib="strip --strip-debug" -striplib="strip --strip-unneeded" - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects="" - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects="" - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps="" - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps="" - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path="" - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method="pass_all" - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd="\$MAGIC_CMD" - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag="" - -# Flag that forces no undefined symbols. -no_undefined_flag="" - -# Commands used to finish a libtool library installation in a directory. -finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval="" - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" - -# This is the shared library runtime path variable. -runpath_var=LD_RUN_PATH - -# This is the shared library path variable. -shlibpath_var=LD_LIBRARY_PATH - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=no - -# How to hardcode a shared library path into an executable. -hardcode_action=immediate - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=yes - -# Flag to hardcode $libdir into a binary during linking. -# This must work even if $libdir does not exist. -hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" - -# If ld is used when linking, flag to hardcode $libdir into -# a binary during linking. This must work even if $libdir does -# not exist. -hardcode_libdir_flag_spec_ld="" - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator="" - -# Set to yes if using DIR/libNAME during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=no - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=no - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=unsupported - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=no - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=unknown - -# Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../../i386-pc-linux-gnu/lib/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../i386-pc-linux-gnu/4.1.1/ /usr/lib/gcc/i386-pc-linux-gnu/4.1.1/../../../ /lib/i386-pc-linux-gnu/4.1.1/ /lib/ /usr/lib/i386-pc-linux-gnu/4.1.1/ /usr/lib/" - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/lib/opengl/ati/lib /usr/i386-pc-linux-gnu/lib /usr/lib/gcc/i386-pc-linux-gnu/4.1.1 /usr/lib/nspr /usr/lib/nss /usr/lib /usr/lib/openmotif-2.2 /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib /usr/games/lib /usr/lib/libstdc++-v3/ " - -# Fix the shell variable $srcfile for the compiler. -fix_srcfile_path="" - -# Set to yes if exported symbols are required. -always_export_symbols=no - -# The commands to list exported symbols. -export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds="" - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - -# Symbols that must always be exported. -include_expsyms="" - -# ### END LIBTOOL TAG CONFIG: F77 - diff --git a/src/extlib/sdl.c b/src/extlib/sdl.c index 2b348fc..9dd3d9d 100644 --- a/src/extlib/sdl.c +++ b/src/extlib/sdl.c @@ -327,6 +327,7 @@ Lib_LoadBMP(const char *path, v_object **img) void Lib_LoadBMPBuffer(void *data, v_object **img) { +#if temp SDL_RWops *ops; if (data == NULL) @@ -350,6 +351,7 @@ Lib_LoadBMPBuffer(void *data, v_object **img) { Debug_Val(0, "Unable to load buffer image SDL says : %s\n", SDL_GetError()); } +#endif /* temp */ } static u8 diff --git a/src/extlib/x11.c b/src/extlib/x11.c index 4e7523e..632912e 100644 --- a/src/extlib/x11.c +++ b/src/extlib/x11.c @@ -33,6 +33,9 @@ #include #include +/* the bitmap header file */ +#include "../misc/bitmap.h" + /* freetype includes */ #include #include FT_FREETYPE_H @@ -878,86 +881,6 @@ Lib_LoadBMP(const char *path, v_object **img) *img = readBitmapFile(path); Debug_Val(0, "Loading a bitmap took %d\n", Neuro_GetTickCount() - chrono); - -#if temp - EBUF *temp; - V_OBJECT *tmp; - char **buffer; - char **initbuf; - /* int i = 0; */ - int _err = 0; - - /* Debug_Val(0, "V_OBJECT size %d\n", sizeof(V_OBJECT)); */ - if (Neuro_EBufIsEmpty(vobjs)) - { - *img = NULL; - return; - } - - chrono = Neuro_GetTickCount(); - - - setBitmapColorKey(color_key); - readBitmapFileToPixmap(path, &temp); - - Debug_Val(0, "Converting Bitmap to pixmap %d\n", Neuro_GetTickCount() - chrono); - - if (!temp) - { - Debug_Val(0, "Error loading the file %s, it might not exist or its not a bitmap\n", path); - return; - } - - - Neuro_AllocEBuf(vobjs, sizeof(V_OBJECT*), sizeof(V_OBJECT)); - - tmp = Neuro_GiveCurEBuf(vobjs); - - /* Debug_Val(0, "created elem 0x%x\n", tmp); */ - - buffer = (char**)Neuro_GiveEBufCore(temp); - - initbuf = buffer; - - chrono = Neuro_GetTickCount(); - /*_err = XpmCreatePixmapFromData(dmain->display, *dmain->cwin, initbuf, - &tmp->data, &tmp->shapemask, &tmp->attrib);*/ - - _err = XpmCreatePixmapFromData(dmain->display, *dmain->cwin, initbuf, - &tmp->data, &tmp->shapemask, NULL); - - Debug_Val(0, "Converting pixmap to Ximage %d\n", Neuro_GetTickCount() - chrono); - - tmp->cwin = &tmp->data; - /* tmp->cwin = &tmp->shapemask; */ - - /* by default the image is fully opaque */ - tmp->alpha = 255; - - tmp->display = NULL; - - if (_err == 0) - { - i32 h, w; - - *img = tmp; - - - Neuro_GiveImageSize(tmp, &w, &h); - - tmp->raw_data = ab_XGetImage(dmain->display, *tmp->cwin, - 0, 0, w, h, - AllPlanes, ZPixmap); - - Debug_Val(0, "Successfully loaded the file %s\n", path); - - /* Debug_Val(0, "At Address %d alpha %d\n", *tmp->cwin, tmp->alpha); */ - } - else - Debug_Val(0, "Error loading the file %s with error %d\n", path, _err); - - Neuro_CleanEBuf(&temp); -#endif /* temp */ return; /* int needed */ } @@ -965,6 +888,7 @@ Lib_LoadBMP(const char *path, v_object **img) void Lib_LoadBMPBuffer(void *data, v_object **img) { +#if temp EBUF *temp; V_OBJECT *tmp; char **buffer; @@ -1041,6 +965,7 @@ Lib_LoadBMPBuffer(void *data, v_object **img) Neuro_CleanEBuf(&temp); return; /* int needed */ +#endif /* temp */ } v_object * diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am index 40e2314..86d5c1a 100644 --- a/src/misc/Makefile.am +++ b/src/misc/Makefile.am @@ -7,7 +7,7 @@ AM_CFLAGS= @NEUROFLAGS@ libmisc_la_SOURCES = \ other.c \ arg.c \ - bitmap.c + bitmap.c bitmap.h #chgen.c diff --git a/src/misc/Makefile.in b/src/misc/Makefile.in index 2c265ec..6d48973 100644 --- a/src/misc/Makefile.in +++ b/src/misc/Makefile.in @@ -196,7 +196,7 @@ AM_CFLAGS = @NEUROFLAGS@ libmisc_la_SOURCES = \ other.c \ arg.c \ - bitmap.c + bitmap.c bitmap.h all: all-am diff --git a/src/misc/bitmap.c b/src/misc/bitmap.c index a35e614..dadfeb2 100644 --- a/src/misc/bitmap.c +++ b/src/misc/bitmap.c @@ -19,15 +19,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* bitmap process module */ +/* bitmap.c + * Module : Bitmap + * + * bitmap process module + */ +/*-------------------- Extern Headers Including --------------------*/ #include #include #include #include -#define old 0 - #if USE_ZLIB /* this is used to open the bitmaps, * the beauty of this is it works @@ -41,12 +44,18 @@ typedef gzFile nFILE; typedef FILE nFILE; #endif /* USE_ZLIB */ +/*-------------------- Local Headers Including ---------------------*/ #include #include #include /* Lib_GetDefaultDepth() */ #include /* Neuro_PutPixel */ +/*-------------------- Main Module Header --------------------------*/ +#include "bitmap.h" + + +/*-------------------- Other ----------------------------*/ typedef struct BITMAP_HEADER { @@ -86,17 +95,47 @@ typedef struct BITMAP_MAP BITMAP_COLOR *color; }BITMAP_MAP; -static u32 color_key = 0; /* this is the pixel we will make it so it is transparent */ +struct BMP_CTX +{ + nFILE *f_bitmap; + + /* major (buffers) */ + EBUF *bmap_colors; /* the colors */ + u8 *buf; /* the buffer that will contain the content of the file */ + + /* minor (mostly pointers and temporary variables) */ + i32 i; /* incremental variable */ + u32 skip_i, x, y; + + u32 psize; /* the full size of the pixels data */ + u8 *palette; /* the pointer to the palette if theres one */ + BITMAP_HDATA *bmap; /* this is how we will get informations about the bitmap */ + int aux_var; /* auxiliary variable that can be used by external functions */ + char *aux_buf; /* same as aux_var but a buffer */ + double msize; + double calc; + double tmp; + u32 wmult; + double pixellen; + u32 increm; + u8 DATA; + v_object *output; /* the image into which we will load the bitmap */ +}; + + +/*-------------------- Global Variables ----------------------------*/ + +/*-------------------- Static Variables ----------------------------*/ + +/*-------------------- Static Prototypes ---------------------------*/ -/* static function prototypes */ static void print_bitmap_infos(BITMAP_HDATA *bmap) __attribute__((unused)); static int fpdata8(nFILE *input, u8 *output) __attribute__((unused)); static int fpdata16(nFILE *input, u16 *output) __attribute__((unused)); static int fpdata32(nFILE *input, u32 *output) __attribute__((unused)); - -/* static functions */ +/*-------------------- Static Functions ----------------------------*/ static void clean_bmap_color(void *eng) @@ -586,6 +625,247 @@ process_bitmap2(BITMAP_HDATA *bmap, v_object *image, u8 *palette, u8 *data, EBUF } } +static i8 +processGradual_BMP(BMP_CTX *ctx, u32 loops) +{ + if (ctx == NULL) + return -1; + + if (ctx->f_bitmap == NULL) + return -1; + + if (ctx->i == 0) + { + ctx->bmap = parse_bitmap_header(ctx->f_bitmap); + + /* TODO TODO XXX check here if the bitmap is valid or not + * first check for the BM word + * then we check for the size of the file in header and size + * we got when reading the file + */ + { + + } + + /* if it is valid, we create the buffers */ + Neuro_CreateEBuf(&ctx->bmap_colors); + Neuro_SetcallbEBuf(ctx->bmap_colors, &clean_bmap_color); + + + /* print_bitmap_infos(bmap); */ + + /* process the bitmap(load it in memory) */ + ctx->i = 0; + ctx->psize = ctx->bmap->header.size - (sizeof(BITMAP_HEADER) + sizeof(BITMAP_INFOHEADER)); + ctx->psize = ctx->psize - (ctx->bmap->infoheader.ncolors * 4); + /* printf("data size %d\n", psize); */ + + if (ctx->bmap->infoheader.ncolors) + { + process_palette(ctx->f_bitmap, ctx->bmap, ctx->bmap_colors); + } + + /* we create the v_object + * + * will need to put better values for the masks to support SDL. + */ + { + u32 rmask = 0, gmask = 0, bmask = 0, amask = 0; + + if (IsLittleEndian()) + { + switch (Lib_GetDefaultDepth()) + { + case 16: + { + rmask = 0x0000f800; + gmask = 0x000007e0; + bmask = 0x0000001f; + amask = 0x00000000; + } + break; + + case 24: + { + rmask = 0x00ff0000; + gmask = 0x0000ff00; + bmask = 0x000000ff; + amask = 0x00000000; + } + break; + + + default: + break; + } + } + else + { + switch (Lib_GetDefaultDepth()) + { + case 16: + { + rmask = 0x0000001f; + gmask = 0x000007e0; + bmask = 0x0000f800; + amask = 0x00000000; + } + break; + + case 24: + { + rmask = 0x0000ff00; + gmask = 0x00ff0000; + bmask = 0xff000000; + amask = 0x00000000; + } + break; + + default: + break; + } + } + + ctx->output = Neuro_CreateVObject(0, ctx->bmap->infoheader.width, ctx->bmap->infoheader.height, ctx->bmap->infoheader.bits, rmask, gmask, bmask, amask); + + if (ctx->output == NULL) + return -1; + } + + /* semi static values to skip bytes that form 32 bit chunks in the data */ + + ctx->pixellen = (8 / (double)ctx->bmap->infoheader.bits); + ctx->msize = ctx->pixellen * 4; + + /* we calculate the number of bytes there is per rows + * this is mainly so we can know how much "alignment" + * bytes there is (which need to be skipped) + */ + { + ctx->wmult = (u32)ctx->bmap->infoheader.bits / 8; + + if (ctx->wmult == 0) + ctx->wmult++; + + ctx->wmult = ctx->wmult * ctx->bmap->infoheader.width; + } + + ctx->increm = (u32)ctx->pixellen; + + if (ctx->increm == 0) + ctx->increm++; + + ctx->x = (u32)(ctx->bmap->infoheader.width / ctx->msize); + ctx->tmp = ctx->msize * ctx->x; + ctx->tmp = (double)ctx->bmap->infoheader.width - ctx->tmp; + ctx->tmp = ctx->tmp - 0.000001; /* to avoid bugs */ + + ctx->x = 0; +#if USE_ZLIB + gzseek(ctx->f_bitmap, ctx->bmap->header.offset, SEEK_SET); +#else /* NOT USE_ZLIB */ + fseek(ctx->f_bitmap, ctx->bmap->header.offset, SEEK_SET); +#endif /* NOT USE_ZLIB */ + + } /* if i == 0 */ + else /* if i != 0 */ + { + i32 initial = ctx->i; + + Lib_LockVObject(ctx->output); + + + + /* while (ctx->i < ctx->psize) */ + while (ctx->i < (initial + loops)) + { + if (ctx->tmp > 0) + { + /* skip bytes that are inside the bitmap for + * filling purpose. (the data is purposely filled + * with 0 bits so the data is 32bits aligned) + */ + if (ctx->skip_i >= ctx->wmult) + { + ctx->calc = ctx->tmp / ctx->pixellen; + ctx->skip_i = (u32)ctx->calc; + if (ctx->skip_i < ctx->calc) + { + ctx->skip_i++; + } + ctx->skip_i = (4 - ctx->skip_i); + ctx->i += ctx->skip_i; + +#if USE_ZLIB + gzseek(ctx->f_bitmap, ctx->bmap->header.offset + ctx->i, SEEK_SET); +#else /* NOT USE_ZLIB */ + fseek(ctx->f_bitmap, ctx->bmap->header.offset + ctx->i, SEEK_SET); +#endif /* NOT USE_ZLIB */ + + /* + printf("skipping %d bytes wmult %d width %d tmp %f plen %f calc %f\n", + skip_i, + wmult, + bmap->infoheader.width, + tmp, + pixellen, calc); + */ + + ctx->skip_i = 0; + } + + ctx->skip_i += ctx->increm; + + if (ctx->i >= ctx->psize) + break; + } + + + fpdata8(ctx->f_bitmap, &ctx->DATA); + + process_bitmap2(ctx->bmap, ctx->output, ctx->palette, &ctx->DATA, + ctx->bmap_colors, &ctx->x, &ctx->y, &ctx->aux_var, &ctx->aux_buf); + + ctx->i++; + } + + Lib_UnlockVObject(ctx->output); + + + + if (ctx->i >= ctx->psize) + { /* this bitmap finished being loaded, we free everything */ + + /* to prevent further calls to be processed */ + ctx->i = -1; + + if (ctx->bmap) + free(ctx->bmap); + if (ctx->buf) + free(ctx->buf); + if (ctx->aux_buf) + free(ctx->aux_buf); + + Neuro_CleanEBuf(&ctx->bmap_colors); + +#if USE_ZLIB + if (ctx->f_bitmap) + gzclose(ctx->f_bitmap); +#else /* NOT USE_ZLIB */ + if (ctx->f_bitmap) + fclose(ctx->f_bitmap); +#endif /* NOT USE_ZLIB */ + + return 100; + } + + return (u8)(((u32)(ctx->psize * 100) / (u32)(ctx->i * 100)) / 100); + } + + /* this never happens unless the image was already loaded */ + return -1; +} + static v_object * processFD_BMP(nFILE *f_bitmap) { @@ -868,29 +1148,7 @@ processFD_BMP(nFILE *f_bitmap) return output; } -/* Global functions */ - -void -cleanPixmapEbuf(EBUF **pixmap) -{ - Neuro_CleanEBuf(pixmap); -} - -void -setBitmapColorKey(u32 key) -{ - color_key = key; -} - -void -readBitmapBufferToPixmap(char *data, EBUF **output_pixmap) -{ -} - -void -readBitmapFileToPixmap(const char *bitmap, EBUF **output_pixmap) -{ -} +/*-------------------- Global Functions ----------------------------*/ v_object * readBitmapFile(const char *bitmap) @@ -906,3 +1164,25 @@ readBitmapFile(const char *bitmap) return processFD_BMP(f_bitmap); } +/*-------------------- Poll ----------------------------------------*/ + +/* returns a percentage of progress */ +u8 +Bitmap_Poll(BMP_CTX *ctx) +{ + return processGradual_BMP(ctx, 1); +} + +/*-------------------- Constructor Destructor ----------------------*/ + +BMP_CTX * +Bitmap_CreateCTX(const char *path) +{ + return NULL; +} + +v_object * +Bitmap_DestroyCTX(BMP_CTX *ctx) +{ + return NULL; +} diff --git a/src/misc/bitmap.h b/src/misc/bitmap.h new file mode 100644 index 0000000..033e2e4 --- /dev/null +++ b/src/misc/bitmap.h @@ -0,0 +1,13 @@ +/* bitmap.h */ + +#ifndef __BITMAP_H +#define __BITMAP_H + +typedef struct BMP_CTX BMP_CTX; + +extern u8 Bitmap_Poll(BMP_CTX *ctx); +extern BMP_CTX *Bitmap_CreateCTX(const char *path); + +extern v_object *Bitmap_DestroyCTX(BMP_CTX *ctx); + +#endif /* NOT __BITMAP_H */ diff --git a/version.mk b/version.mk index 1219736..63f0dc0 100644 --- a/version.mk +++ b/version.mk @@ -1,6 +1,6 @@ MAJOR=0 MINOR=49 -MICRO=19 +MICRO=21 INTERFACE=2 -REVISION=10 +REVISION=12 BINARY=2 -- 2.11.4.GIT