pax_global_header00006660000000000000000000000064141254413770014522gustar00rootroot0000000000000052 comment=3fa573b4bf3526e3a510ef0e6894ab182cb833fe libKXL-1.2.4/000077500000000000000000000000001412544137700126535ustar00rootroot00000000000000libKXL-1.2.4/COPYING000066400000000000000000000430761412544137700137200ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libKXL-1.2.4/ChangeLog000066400000000000000000000100421412544137700144220ustar00rootroot00000000000000Release Version 1.1.5 [19/1/2002] - KXL_UpDateRect function was added. - KXL_UpDateImm function was added. - KXL_ClearFrameRect function was added. - KXL_ClearFrameImm function was added. - KXL_CopyImageRect function was added. - KXL_CopyImageImm function was added. - KXL_CopyStretchImageRect function was added. - KXL_CopyStretchImageImm function was added. - KXL_PutImageRect function was added. - KXL_PutImageImm function was added. - KXL_PutStretchImageRect function was added. - KXL_PutStretchImageImm function was added. - Improvement in the speed of various functions. ------------------------------------------------------------------------------- Release Version 1.1.4 [8/12/2001] - The bug in which the expansion image has collapsed was corrected with the KXL_StrechImage function. ------------------------------------------------------------------------------- Release Version 1.1.3 [10/09/2001] - When sound was sounded with single shot, operation corrected the bug which becomes blunt. - Painting-out processing was added to the KXL_DrawPolygon function. ------------------------------------------------------------------------------- Release Version 1.1.2 [29/08/2001] - spec file added. ------------------------------------------------------------------------------- Release Version 1.1.1 [15/08/2001] - The bug of KXL.m4 was corrected. ------------------------------------------------------------------------------- Release Version 1.1.0 [13/08/2001] - 4bpp bitmap iamge support. - change name Timmerxxx to Timerxxx. - speed tuning. ------------------------------------------------------------------------------- Release Version 1.0.0 [12/08/2001] - Major Upgrade. - KXL_SetDrawColor,KXL_DrawPoint,KXL_DrawLine,KXL_DrawRectangle KXL_DrawPolygon added. - libxpm was removed from the library. - An old game does not operate in the version from this time. ------------------------------------------------------------------------------- Release Version 0.5.8 [08/08/2001] - The mouse event was supported. - Bitmap file supported. ------------------------------------------------------------------------------- Release Version 0.5.7 [26/07/2001] - The header file was corrected. ------------------------------------------------------------------------------- Release Version 0.5.6 [17/05/2001] - The function which creates an expansion reduction image was added. ------------------------------------------------------------------------------- Release Version 0.5.5 [07/04/2001] - It was made to correspond to configure script. ------------------------------------------------------------------------------- Release Version 0.5.4 [04/04/2001] - Makefile was corrected. ------------------------------------------------------------------------------- Release Version 0.5.3 [28/03/2001] - It is at KXL_PlaySound at the KXL_SOUND_STOP and KXL_SOUND_STOP_ALL specification time. - The fault sound was sounding once was corrected. ------------------------------------------------------------------------------- Release Version 0.5.2 [24/03/2001] - Script which acquires the path of a header & library in KXL It corrected. ------------------------------------------------------------------------------- Release Version 0.5.1 [11/03/2001] - It is the fault to which clipmask was not correctly carried out with a KXL_PutRectImage function. - It corrected. ------------------------------------------------------------------------------- Release Version 0.5 [05/03/2001] - Fault was corrected. ------------------------------------------------------------------------------- Release Version 0.4 [28/02/2001] - Change accompanied by renewal of a library was carried out. - Fault was corrected. ------------------------------------------------------------------------------- Release Version 0.3 [25/02/2001] - first (pre)release version - It is a multimedia library aiming at easy game development. - From now on, all the things raised here will use this library. - I want to explain a library gradually. - It enabled it to also download a sample in connection with this.libKXL-1.2.4/KXL.m4000066400000000000000000000023431412544137700135550ustar00rootroot00000000000000dnl Configure Paths for KXL dnl AM_PATH_KXL dnl Test for libKXL, and define KXL_CFLAGS and KXL_LIBS as appropriate. dnl enables arguments --with-kxl-prefix= -with-kxl-inc-prefix= dnl AC_DEFUN([AM_PATH_KXL], [dnl dnl Get the cfags and libraries for KXL dnl AC_ARG_WITH(kxl-prefix, [ --with-kxl-prefix=PFX Prefix where KXL library is installed(optional)], [kxl_prefix="$withval"], [kxl_prefix=""]) AC_ARG_WITH(kxl-inc-prefix, [ --with-kxl-inc-prefix=PFX Prefix where include libraries are (optional)], [kxl_inc_prefix="$withval"], [kxl_inc_prefix=""]) dnl Add any special include directories AC_MSG_CHECKING(for KXL CFLAGS) if test "$kxl_inc_prefix" != "" ; then KXL_CFLAGS="$KXL_CFLAGS -I$kxl_inc_prefix" CFLAGS="-I$kxl_inc_prefix" fi AC_MSG_RESULT($KXL_CFLAGS) dnl add any special lib dirs AC_MSG_CHECKING(for KXL LDFLAGS) if test "$kxl_prefix" != "" ; then KXL_LIBS="$KXL_LIBS -L$kxl_prefix" LIBS="-L$kxl_prefix" fi dnl add the KXL library KXL_LIBS="$KXL_LIBS -lKXL" LDFLAGS="$KXL_LIBS" AC_MSG_RESULT($KXL_LIBS) AC_PATH_XTRA AC_CHECK_LIB([KXL], [KXL_CreateWindow],, [AC_MSG_ERROR(No linkable libKXL was found.)], [$X_LIBS -lX11] ) dnl That should be it. Now just export out symbols: AC_SUBST(KXL_CFLAGS) AC_SUBST(KXL_LIBS) ]) libKXL-1.2.4/KXL.spec.in000066400000000000000000000060171412544137700145760ustar00rootroot00000000000000%define name @PACKAGE@ %define version @VERSION@ %define release 1 Summary : KXL -- a visual & sound library Name : %{name} Version : %{version} Release : %{release} Source : http://www2.mwnet.or.jp/~fc3srx7/download/%{name}-%{version}.tar.gz License : GPL Group : System Environment/Libraries URL : http://www2.mwnet.or.jp/~fc3srx7/ BuildRoot : /var/tmp/%{name}-%{version}-root Requires : libpulse-simple.so.0()(64bit) %description Kacchan X Windows System Liblary (KXL) is a visual & sound library. %prep rm -rf ${RPM_BUILD_ROOT} %setup -q %build ./configure --prefix=%{_prefix} --libdir %{_libdir} make CFLAGS+=-DUSE_PULSEAUDIO %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc COPYING ChangeLog README %doc docs/* %{_prefix}/share/aclocal/KXL.m4 %{_prefix}/include/* %{_prefix}/%{_lib}/* %changelog * Thu Sep 30 2021 Nathan Mills - (1.2.4) - Fix incompatible pointer type warning. * Wed Sep 29 2021 Nathan Mills - (1.2.3-1) - Fix some pointer sign warnings * Fri Mar 6 2020 Nathan Mills - (1.2.2-1) - Fix Valgrind warning "Invalid read of size 8" in KXL_PlaySound - Zero bitmap data to silence Valgrind warning * Thu Mar 5 2020 Nathan Mills - (1.2.1-1) - Fix Valgrind warning write(buf) points to uninitialised byte(s) * Wed Mar 4 2020 Nathan Mills - (1.2.0-2) - Fix rpmbuild failing to find KXL library in lib64. - (1.2.0-1) - Use PulseAudio by default for sound output. * Sun Dec 22 2019 Nathan Mills - (1.1.6-1) - Change obsolete Copyright tag to License tag - Fix typo in format string. - Fix commented out KXL_KEY_Bracketright - Fix "implicit declaration of built-in function" warnings - Fix a conditional jump or move error from Valgrind - Fix approx 1MB memory leak in KXL_Font() * Sat Jan 19 2002 SATO Katsuyoshi - (1.1.5-1) - KXL_UpDateRect function was added. - KXL_UpDateImm function was added. - KXL_ClearFrameRect function was added. - KXL_ClearFrameImm function was added. - KXL_CopyImageRect function was added. - KXL_CopyImageImm function was added. - KXL_CopyStretchImageRect function was added. - KXL_CopyStretchImageImm function was added. - KXL_PutImageRect function was added. - KXL_PutImageImm function was added. - KXL_PutStretchImageRect function was added. - KXL_PutStretchImageImm function was added. - Improvement in the speed of various functions. * Sat Dec 8 2001 SATO Katsuyoshi - (1.1.4-1) - The bug in which the expansion image has collapsed was corrected with the KXL_StrechImage function. * Mon Sep 10 2001 SATO Katsuyoshi - (1.1.3-1) - When sound was sounded with single shot, operation corrected the bug which becomes blunt. - Painting-out processing was added to the KXL_DrawPolygon function. libKXL-1.2.4/Makefile.am000066400000000000000000000001601412544137700147040ustar00rootroot00000000000000SUBDIRS = src docs aclocaldir = @aclocaldir@ aclocal_DATA = KXL.m4 EXTRA_DIST = COPYING ChangeLog README KXL.m4 libKXL-1.2.4/README000066400000000000000000000021471412544137700135370ustar00rootroot00000000000000 KXL, a visual,sound library Copyright (C) 2001, Katsuyoshi Sato fc3srx7@mwnet.or.jp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -------------------------------------------------------------------------- #Install tar xzvf KXL-xxxx(xxxx is version) cd KXL-xxxx ./configure make make install -------------------------------------------------------------------------- #Requirements pulseaudio libpulse-devel libX11-devel -------------------------------------------------------------------------- libKXL-1.2.4/configure.ac000066400000000000000000000011611412544137700151400ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([KXL], [1.2.4]) AC_CONFIG_SRCDIR([src/KXL.h]) AM_INIT_AUTOMAKE dnl Checks for programs. AC_PROG_CC AM_PROG_LIBTOOL dnl Checks for libraries. dnl Checks for header files. AC_PATH_XTRA AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h sys/time.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS(select) aclocaldir='${datadir}/aclocal' AC_SUBST(aclocaldir) AC_OUTPUT([KXL.spec Makefile src/Makefile docs/Makefile]) libKXL-1.2.4/docs/000077500000000000000000000000001412544137700136035ustar00rootroot00000000000000libKXL-1.2.4/docs/KXL.html000066400000000000000000000116051412544137700151320ustar00rootroot00000000000000 KXL Reference Prev Top Next
KXL Reference
The outline of KXL
It makes for the time being
Global variables.
- KXL_EVENT_xxx_MASK
- KXL_EVENT_xxx
- KXL_KEY_xxx
- KXL_Image
- KXL_Rect
- KXL_Polygon
- KXL_SOUND_xxx
Window-related description
- KXL_DisplayName
- KXL_CreateWindow
- KXL_DeleteWindow
Frame-related description
- KXL_ReSizeFrame
- KXL_UpDateRect
- KXL_UpDateImm
- KXL_UpDate - For the compatibility of 1.1.4 or earlier
- KXL_ClearFrameRect
- KXL_ClearFrameImm
- KXL_ClearFrame - For the compatibility of 1.1.4 or earlier
Text-related description
- KXL_Font
- KXL_PutText
- KXL_TextWidth
Draw-related description
- KXL_SetDrawColor
- KXL_DrawPoint
- KXL_DrawLine
- KXL_DrawRectangle
- KXL_DrawPolygon
Image-related description
- KXL_LoadBitmap
- KXL_CopyImageRect
- KXL_CopyImageImm
- KXL_CopyImage - For the compatibility of 1.1.4 or earlier
- KXL_CopyStretchImageRect
- KXL_CopyStretchImageImm
- KXL_CopyStretchImage
- KXL_StrechImage - For the compatibility of 1.1.4 or earlier
- KXL_PutImage
- KXL_PutImageRect
- KXL_PutImageImm
- KXL_PutRectImage - For the compatibility of 1.1.4 or earlier
- KXL_PutStretchImage
- KXL_PutStretchImageRect
- KXL_PutStretchImageImm
- KXL_DeleteImage
Event-related description
- KXL_CheckEvents
- KXL_GetEvents
- KXL_GetKey
- KXL_GetButton
Sound-related description
- KXL_InitSound
- KXL_PlaySound
- KXL_EndSound
Timer-related description
- KXL_Timer
- KXL_GetTimer
- KXL_ResetTimer
libKXL-1.2.4/docs/Makefile.am000066400000000000000000000000461412544137700156370ustar00rootroot00000000000000EXTRA_DIST = *.html *.gif *.bmp *.wav libKXL-1.2.4/docs/being.html000066400000000000000000000075301412544137700155620ustar00rootroot00000000000000 It makes for the time being Prev Top Next
It makes for the time being

// sample.c
#include < KXL.h>

int main(void)
{
  Bool flag = False ;

  // Create a window by 100x100.
  // event receives only the bottom of a re-drawing event and key presss.
  // If return key is pushed, it will end.
  KXL_CreateWindow(100, 100, "sample"
                   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_KEY_PRESS_MASK);

  while(flag != True ){
    // event loop
    while(KXL_CheckEvents()) {
      // which acquires a event
      switch(KXL_GetEvents()) {
      case KXL_EVENT_EXPOSE: // event of re-drawing
        // A frame is cleared
        KXL_ClearFrameImm(0, 0, 100, 100);
        // "sample" is drawn
        KXL_PutText(30, 50, "sample");
        / A frame is made to reflect in a window
        KXL_UpDateImm(0, 0, 100, 100);
        break;
      case KXL_EVENT_KEY_PRESS: // event of key press
        // If a return key was pushed, it will end
        if (KXL_GetKey() == KXL_KEY_Return)
          flag = True;
        break ;
      }
    }
  }
  // A window is closed
  KXL_DeleteWindow();
  return 0;
}

gcc sample.c -o sample -L/usr/X11R6/lib -lX11 -lKXL
./sample

First of all, a window is created.
  KXL_CreateWindow(100, 100, "sample"
                   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_KEY_PRESS);
It is a setup that this is window of the size of width 100 and height 100, display it on a title bar as "sample", and it receives re-drawing and key press as an event. At this time, pixmap (referred to as frame below) of the same size is created. Once it does not draw directly to window fundamentally but draws on a frame, a frame is made to reflect in window.

Next, an event is received.
  while(KXL_CheckEvents()){
    switch(KXL_GetEvents()){
    case KXL_EVENT_EXPOSE: // event of re-drawing
          :
    case KXL_EVENT_KEY_PRESS: // event of key press
          :
    }
  }
It is confirmed whether the event occurred in KXL_CheckEvents(). If anything does not have an event, it will escape from while. If an event occurs, it will investigate which event it is by KXL_GetEvents().

Event of Re-drawing(KXL_EVENT_EXPOSE) If it generates, a thing required for a frame will be drawn. The whole frame is cleared first.
  KXL_ClearFrameImm(0, 0, 100, 100);
A frame is cleared here (the left 0, top 0, width 100, height 100).

A character sequence will be drawn if a frame is cleared.
  KXL_PutText(30,50, "sample");
The character which this calls to the left as 30 from the upper left of a frame, and calls "sample" below in the position of 50 is drawn. A default font set "-adobe-courier-bold-r-normal--14-*-*-*-*-*-iso8859-1 " Coming out, the color has become white.

If drawing to a frame finishes, a frame is made to reflect in a window.
  KXL_UpDateImm(0, 0, 100, 100);
A frame (the left 0, top 0, width 100, height 100) is transmitted to a window here.

Event of key press(KXL_EVENT_KEY_PRESS) If it generates, it will judge which key was pushed.
  if (KXL_GetKey() == KXL_KEY_Return)
    flag = True;
KXL_GetKey() The key come out of and pushed is acquired and it is a return key. KXL_KEY_Return True will be set to flag if it becomes. It escapes from a loop now.

Finally a window is closed.
  KXL_DeleteWindow();
libKXL-1.2.4/docs/kxlcheckevents.html000066400000000000000000000021151412544137700175110ustar00rootroot00000000000000 KXL_CheckEvents Prev Top Next
Name

KXL_CheckEvents

Synopsis
KXL_CheckEvents -- It checks to see the event occurred.

Description
Bool KXL_CheckEvents(void);

Arguments

Nothing.


Return Value
True = The event generated.
False = The event is not generated.

Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "kxl.org", KXL_EVENT_KEY_PRESS_MASK);

  while (KXL_CheckEvents() == False);  
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlclearframe.html000066400000000000000000000026141412544137700173140ustar00rootroot00000000000000 KXL_ClearFrame Prev Top Next
Name

KXL_ClearFrame

Synopsis
KXL_ClearFrameRect -- Rectangles with an arbitrary frame are cleared.
It clears by the color set up by KXL_SetDrawColor.
For the compatibility of 1.1.4 or earlier.

Description
void KXL_ClearFrame(KXL_Rect rect);

Arguments

rectKXL_Rect structure.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_Rect rect = {0, 0, 100, 100};

  KXL_CreateWindow(rect.Width, rect.Height, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateRect(rect);
  getchar();
  KXL_ClearFrame(rect);
  KXL_UpDateRect(rect);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlclearframeimm.html000066400000000000000000000030211412544137700200100ustar00rootroot00000000000000 KXL_ClearFrameImm Prev Top Next
Name

KXL_ClearFrameImm

Synopsis
KXL_ClearFrameImm -- Rectangles with an arbitrary frame are cleared.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_ClearFrameImm(Sint16 left, Sint16 top, Uint16 width, Uint16 height);

Arguments

leftLeft position of a frame.
topTop position of a frame.
widthWidth of a frame.
heightHeight of a frame.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlclearframerect.html000066400000000000000000000025631412544137700201750ustar00rootroot00000000000000 KXL_ClearFrameRect Prev Top Next
Name

KXL_ClearFrameRect

Synopsis
KXL_ClearFrameRect -- Rectangles with an arbitrary frame are cleared.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_ClearFrameRect(KXL_Rect rect);

Arguments

rectKXL_Rect structure.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_Rect rect = {0, 0, 100, 100};

  KXL_CreateWindow(rect.Width, rect.Height, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateRect(rect);
  getchar();
  KXL_ClearFrameRect(rect);
  KXL_UpDateRect(rect);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopyimage.html000066400000000000000000000032321412544137700171650ustar00rootroot00000000000000 KXL_CopyImage Prev Top Next
Name

KXL_CopyImage

Synopsis
KXL_CopyImage -- The arbitrary rectangles of an image are copied to a new image.
For the compatibility of 1.1.4 or earlier.

Description
KXL_Image *KXL_CopyImage(KXL_Image *img, KXL_Rect rect);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structure.


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;
  KXL_Rect rect = {8, 8, 16, 16};

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_CopyImage(img, rect);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopyimageimm.html000066400000000000000000000034531412544137700176750ustar00rootroot00000000000000 KXL_CopyImageImm Prev Top Next
Name

KXL_CopyImageImm

Synopsis
KXL_CopyImageImm -- The arbitrary rectangles of an image are copied to a new image.

Description
KXL_Image *KXL_CopyImageImm(KXL_Image *img, Sint16 left, Sint16
top, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
leftLeft position of a source image.
topTop position of a source image.
widthWidth of a source image.
heightHeight of a source image.


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_CopyImageImm(img, 8, 8, 16, 16);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopyimagerect.html000066400000000000000000000031701412544137700200440ustar00rootroot00000000000000 KXL_CopyImageRect Prev Top Next
Name

KXL_CopyImageRect

Synopsis
KXL_CopyImageRect -- The arbitrary rectangles of an image are copied to a new image.

Description
KXL_Image *KXL_CopyImageRect(KXL_Image *img, KXL_Rect rect);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structure.


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;
  KXL_Rect rect = {8, 8, 16, 16};

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_CopyImageRect(img, rect);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopystretchimage.html000066400000000000000000000032401412544137700205610ustar00rootroot00000000000000 KXL_CopyStretchImage Prev Top Next
Name

KXL_CopyStretchImage

Synopsis
KXL_CopyStretchImage -- An image are expanded or reduced and it copies to a new image.

Description
KXL_Image *KXL_CopyStretchImage(KXL_Image *img, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
widthNew width
heightNew height


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_CopyStretchImage(img, 78, 78);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 20, 20);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopystretchimageimm.html000066400000000000000000000040101412544137700212600ustar00rootroot00000000000000 KXL_CopyStretchImageImm Prev Top Next
Name

KXL_CopyStretchImageImm

Synopsis
KXL_CopyStretchImageImm -- The arbitrary rectangles of an image are expanded or reduced and it copies to a new image.

Description
KXL_Image *KXL_CopyStretchImageImm(KXL_Image *img, Sint16 src_l,
Sint16 src_t, Uint16 src_w, Uint16 src_h, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
src_lLeft position of a source image.
src_tTop position of a source image.
src_wWidth of a source image.
src_hHeight of a source image.
widthNew width
heightNew height


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_CopyStretchImageImm(img, 0, 0, img->Width, img->Height, 78, 78);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 20, 20);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcopystretchimagerect.html000066400000000000000000000036001412544137700214370ustar00rootroot00000000000000 KXL_CopyStretchImageRect Prev Top Next
Name

KXL_CopyStretchImageRect

Synopsis
KXL_CopyStretchImageRect -- The arbitrary rectangles of an image are expanded or reduced and it copies to a new image.

Description
KXL_Image *KXL_CopyStretchImageRect(KXL_Image *img, KXL_Rect rect, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structure.
widthNew width
heightNew height


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;
  KXL_Rect rect;

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  rect.Left = 0;
  rect.Top = 0;
  rect.Width = img->Width;
  rect.Height = img->Height;
  copy_img = KXL_CopyStretchImageRect(img, rect, 78, 78);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 20, 20);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlcreatewindow.html000066400000000000000000000040401412544137700177010ustar00rootroot00000000000000 KXL_CreateWindow Prev Top Next
Name

KXL_CreateWindow

Synopsis
KXL_CreateWindow -- window is created.
X window must start by any of 16bpp, 24bpp, and 32bpp they are.
The frame of the same size as window size is created simultaneously.
A font color is set up white.
A drawing color is set up black.
A key repeat is set as OFF.

Description
void KXL_CreateWindow(Uint16 width, Uint16 height, Uint8 *title,
Uint32 events);

Arguments

widthWidth of a window.
heightHeight of a window.
titleThe name of a title bar.
eventsThe event to receive.
An event is specified combining the following by logical sum.
KXL_EVENT_KEY_PRESS_MASKWhen a key is press.
KXL_EVENT_KEY_RELEASE_MASKWhen a key is release.
KXL_EVENT_BUTTON_PRESS_MASKWhen a mouse button is press.
KXL_EVENT_BUTTON_RELEASE_MASKWhen a mouse button is release.
KXL_EVENT_BUTTON_MOTION_MASKWhen a moves pressing mouse button.
KXL_EVENT_EXPOSURE_MASKWhen a demand of re-drawing.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "kxl.org", 0);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldeleteimage.html000066400000000000000000000023071412544137700174570ustar00rootroot00000000000000 KXL_DeleteImage Prev Top Next
Name

KXL_DeleteImage

Synopsis
KXL_DeleteImage -- Delete image.

Description
void KXL_DeleteImage(KXL_Image *img);

Arguments

imgPointer of KXL_Image structure.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_Image *img;

  KXL_CreateWindow(100, 100, "kxl.org", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_PutImage(img, 32, 32);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldeletewindow.html000066400000000000000000000017151412544137700177060ustar00rootroot00000000000000 KXL_DeleteWindow Prev Top Next
Name

KXL_DeleteWindow

Synopsis
KXL_Delete -- Shut down KXL.

Description
void KXL_DeleteWindow(void);

Arguments

Nothing.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "kxl.org", 0);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldisplayname.html000066400000000000000000000023221412544137700175150ustar00rootroot00000000000000 KXL_DisplayName Prev Top Next
Name

KXL_DisplayName

Synopsis
KXL_DisplayName -- The name of a display is specified.
It is used before calling a KXL_CreateWindow function.
A default is NULL.

Description
void KXL_DisplayName(Uint8 *name);


Arguments

nameThe name of a display (Xhost).


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(int argc, char **argv)
{
  KXL_Display(argv[1]);
  KXL_CreateWindow(100, 100, "kxl.org", 0);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldrawline.html000066400000000000000000000027651412544137700170270ustar00rootroot00000000000000 KXL_DrawLine Prev Top Next
Name

KXL_DrawLine

Synopsis
KXL_DrawLine -- A line is drawn.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_DrawLine(Sint16 left, Sint16 top, Sint16 right, Sint16 bottom);

Arguments

leftLeft position which draws.
topTop position which draws.
rightRight position which draws.
bottomBottom position which draws.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Sint16 i;

  KXL_CreateWindow(100, 100, "sample", 0);
  for (i = 0; i < 100; i ++) {
    KXL_SetDrawColor(rand() % 0xff, rand() % 0xff, rand() % 0xff);
    KXL_DrawLine(0, 0, rand() % 100, rand() % 100);
  }
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldrawpoint.html000066400000000000000000000025461412544137700172260ustar00rootroot00000000000000 KXL_DrawPoint Prev Top Next
Name

KXL_DrawPoint

Synopsis
KXL_DrawPoint -- A point is drawn.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_DrawPoint(Sint16 left, Sint16 top);

Arguments

leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Sint16 i;

  KXL_CreateWindow(100, 100, "sample", 0);
  for (i = 0; i < 100; i ++) {
    KXL_SetDrawColor(rand() % 0xff, rand() % 0xff, rand() % 0xff);
    KXL_DrawPoint(rand() % 100, rand() % 100);
  }
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldrawpolygon.html000066400000000000000000000033571412544137700175650ustar00rootroot00000000000000 KXL_DrawPolygon Prev Top Next
Name

KXL_DrawPolygon

Synopsis
KXL_DrawPolygon -- A polygon is drawn.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_DrawPolygon(KXL_Polygon polygon, Uint16 max, Bool position, Bool fill);

Arguments

polygonArrangement of a point.
maxNumber of points.
positionTrue = Absolutely position.
False = relative position from a front position.
fillTrue = The inside of a polygon is applied.
False = The inside of a polygon is not applied.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Sint16 i;
  KXL_Polygon p[4] = {
    {0, 0}, {20, 0}, {-10, 10}, {-10, -10}
  };

  KXL_CreateWindow(100, 100, "sample", 0);
  for (i = 0; i < 30; i ++) {
    KXL_SetDrawColor(rand() % 0xff, rand() % 0xff, rand() % 0xff);
    p[0].x = rand() % 80;
    p[0].y = rand() % 80;
    KXL_DrawPolygon(p, 4, False, True);
  }
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxldrawrectangle.html000066400000000000000000000032131412544137700200310ustar00rootroot00000000000000 KXL_DrawRectangle Prev Top Next
Name

KXL_DrawRectangle

Synopsis
KXL_DrawRectangle -- A rectangle is drawn.
It clears by the color set up by KXL_SetDrawColor.

Description
void KXL_DrawRectangle(Sint16 left, Sint16 top, Uint16 width, Uint16 height, Bool fill);

Arguments

leftLeft position which draws.
topTop position which draws.
widthWidth which draws.
heightHeight which draws.
fillTrue = The inside of a rectangle is applied.
False = The inside of a rectangle is not applied.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Sint16 i;

  KXL_CreateWindow(100, 100, "sample", 0);
  for (i = 0; i < 20; i ++) {
    KXL_SetDrawColor(rand() % 0xff, rand() % 0xff, rand() % 0xff);
    KXL_DrawRectangle(rand() % 80, rand() % 80, 20, 20, True);
  }
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlendsound.html000066400000000000000000000040131412544137700170250ustar00rootroot00000000000000 KXL_EndSound Prev Top Next
Name

KXL_EndSound

Synopsis
KXL_EndSound -- Shut down sound server.

Description
void KXL_EndSound(void);

Arguments

Nothing.


Return Value

Nothing.


Exsample
sound1.wav
sound1.wav
sound1.wav

#include <KXL.h>

int main(void)
{
  Bool flag = False;
  Uint8 *wavlist[] = {
    "sound1", // The sound of No. 0
    "sound2", // The sound of No. 1
    "sound3", // The sound of No. 2
    ""        // Indispensable
  };

  KXL_CreateWindow(200, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
		   KXL_EVENT_KEY_PRESS_MASK);
  KXL_InitSound(".", wavlist);

  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_EXPOSE:
      KXL_ClearFrameImm(0, 0, 200, 100);
      KXL_PutText(8, 20, "[1] - sound1");
      KXL_PutText(8, 40, "[2] - sound2");
      KXL_PutText(8, 60, "[3] - sound3");
      KXL_PutText(8, 99, "[4] - exit");
      KXL_UpDateImm(0, 0, 200, 100);
      break;;
    case KXL_EVENT_KEY_PRESS:
      switch (KXL_GetKey()) {
      case KXL_KEY_1:
	KXL_PlaySound(0, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_2:
	KXL_PlaySound(1, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_3:
	KXL_PlaySound(2, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_4:
	flag = True;
	break;
      }
    }
  }
  KXL_EndSound();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlfont.html000066400000000000000000000030621412544137700161570ustar00rootroot00000000000000 KXL_Font Prev Top Next
Name

KXL_Font

Synopsis
KXL_Font -- The drawing font and drawing color of a text.
A default font is "-adobe-courier-bold-r-normal--14-*-*-*-*-*-iso8859-1"
A default color is white.

Description
void KXL_Font(Uint8 *name, Uint8 red, Uint8 green, Uint8 blue);

Arguments

nameThe drawing font of a text.
It is NULL when you do not want to change a font.
redRed luminosity.
greenGreen luminosity.
blueBlue luminosity.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_Font(NULL, 0xff, 0x00, 0x00);
  KXL_PutText(0, 20, "Sample");
  KXL_Font("-sony-*-medium-i-*-*-*-*-*-*-*-*-*-*", 0x00, 0xff, 0x00);
  KXL_PutText(20, 50, "Sample");
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlgetbutton.html000066400000000000000000000035601412544137700172270ustar00rootroot00000000000000 KXL_GetButton Prev Top Next
Name

KXL_GetButton

Synopsis
KXL_Button -- Get of the position and button number of a mouse cursor is carried out.

Description
Uint16 KXL_GetButton(Uint16 *left, Uint16 *top);

Arguments

leftLeft position of a mouse cursor.
topTop position of a mouse cursor.


Return Value
Button number.

Exsample
#include <KXL.h>

int main(void)
{
  Bool flag = False;
  Uint16 left = 0;
  Uint16 top = 0;
  Uint16 no = 0;
  Uint8 buff[64];

  KXL_CreateWindow(100, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_BUTTON_PRESS_MASK |
		   KXL_EVENT_KEY_PRESS_MASK);
  
  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_BUTTON_PRESS:
      no = KXL_GetButton(&left, &top);
      break;
    case KXL_EVENT_KEY_PRESS:
      flag = True;
      break;
    }
    KXL_ClearFrameImm(0, 0, 100, 100);
    sprintf(buff, "x:%4d", left);
    KXL_PutText(8, 20, buff);
    sprintf(buff, "y:%4d", top);
    KXL_PutText(8, 40, buff);
    sprintf(buff, "b:%4d", no);
    KXL_PutText(8, 60, buff);
    KXL_UpDateImm(0, 0, 100, 100);
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlgetevents.html000066400000000000000000000037111412544137700172160ustar00rootroot00000000000000 KXL_GetEvents Prev Top Next
Name

KXL_GetEvents

Synopsis
KXL_GetEvents -- Get of the generated event is carried out.

Description
Uint32 KXL_CheckEvents(void);

Arguments

Nothing.


Return Value
KXL_EVENT_KEY_PRESSWhen a key is press.
KXL_EVENT_KEY_RELEASEWhen a key is release.
KXL_EVENT_BUTTON_PRESSWhen a mouse button is press.
KXL_EVENT_BUTTON_RELEASEWhen a mouse button is release.
KXL_EVENT_BUTTON_MOTIONWhen a moves pressing mouse button.
KXL_EVENT_EXPOSEWhen a demand of re-drawing.


Exsample
#include <KXL.h>

int main(void)
{
  Bool flag = False;
  
  KXL_CreateWindow(100, 100, "kxl.org",
                   KXL_EVENT_KEY_PRESS_MASK |
                   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_BUTTON_PRESS_MASK);
  
  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_EXPOSE:
      fprintf(stderr, "exposure\n");
      break;
    case KXL_EVENT_KEY_PRESS:
      fprintf(stderr, "key press\n");
      break;
    case KXL_EVENT_BUTTON_PRESS:
      fprintf(stderr, "mouse button press\n");
      flag = True;
      break;
    }
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlgetkey.html000066400000000000000000000104301412544137700164760ustar00rootroot00000000000000 KXL_GetKey Prev Top Next
Name

KXL_GetKey

Synopsis
KXL_GetKeys -- Get of the key code at the time of key event generating is carried out.

Description
Uint16 KXL_GetKey(void);

Arguments

Nothing.


Return Value
KXL_KEY_BackSpaceKXL_KEY_TabKXL_KEY_Return
KXL_KEY_EscapeKXL_KEY_DeleteKXL_KEY_Home
KXL_KEY_LeftKXL_KEY_UpKXL_KEY_Right
KXL_KEY_DownKXL_KEY_F1KXL_KEY_F2
KXL_KEY_F3KXL_KEY_F4KXL_KEY_F5
KXL_KEY_F6KXL_KEY_F7KXL_KEY_F8
KXL_KEY_F9KXL_KEY_F10KXL_KEY_F11
KXL_KEY_F12KXL_KEY_Shift_L KXL_KEY_Shift_R
KXL_KEY_Control_LKXL_KEY_Control_RKXL_KEY_Space
KXL_KEY_ExclamKXL_KEY_QuotedblKXL_KEY_Numbersign
KXL_KEY_DollarKXL_KEY_PercentKXL_KEY_Ampersand
KXL_KEY_ApostropheKXL_KEY_QuoterightKXL_KEY_Parenleft
KXL_KEY_ParenrightKXL_KEY_AsteriskKXL_KEY_Plus
KXL_KEY_CommaKXL_KEY_MinusKXL_KEY_Period
KXL_KEY_SlashKXL_KEY_0KXL_KEY_1
KXL_KEY_2KXL_KEY_3KXL_KEY_4
KXL_KEY_5KXL_KEY_6KXL_KEY_7
KXL_KEY_8KXL_KEY_9KXL_KEY_Colon
KXL_KEY_SemicolonKXL_KEY_LessKXL_KEY_Equal
KXL_KEY_GreaterKXL_KEY_QuestionKXL_KEY_At
KXL_KEY_AKXL_KEY_BKXL_KEY_C
KXL_KEY_DKXL_KEY_EKXL_KEY_F
KXL_KEY_GKXL_KEY_HKXL_KEY_I
KXL_KEY_JKXL_KEY_KKXL_KEY_L
KXL_KEY_MKXL_KEY_NKXL_KEY_O
KXL_KEY_PKXL_KEY_QKXL_KEY_R
KXL_KEY_SKXL_KEY_TKXL_KEY_U
KXL_KEY_VKXL_KEY_WKXL_KEY_X
KXL_KEY_YKXL_KEY_ZKXL_KEY_Bracketleft
KXL_KEY_BackslashKXL_KEY_BracketrightKXL_KEY_Asciicircum
KXL_KEY_UnderscoreKXL_KEY_GraveKXL_KEY_Quoteleft
KXL_KEY_aKXL_KEY_bKXL_KEY_c
KXL_KEY_dKXL_KEY_eKXL_KEY_f
KXL_KEY_gKXL_KEY_hKXL_KEY_i
KXL_KEY_jKXL_KEY_kKXL_KEY_l
KXL_KEY_mKXL_KEY_nKXL_KEY_o
KXL_KEY_pKXL_KEY_qKXL_KEY_r
KXL_KEY_sKXL_KEY_tKXL_KEY_u
KXL_KEY_vKXL_KEY_wKXL_KEY_x
KXL_KEY_yKXL_KEY_zKXL_KEY_Braceleft
KXL_KEY_BarKXL_KEY_BracerightKXL_KEY_Asciitilde


Exsample
#include <KXL.h>

int main(void)
{
  Bool flag = False;
  
  KXL_CreateWindow(200, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_KEY_PRESS_MASK);
  
  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_EXPOSE:
      KXL_PutText(32, 50, "Push return key");
      KXL_UpDateImm(0, 0, 200, 100);
      break;
    case KXL_EVENT_KEY_PRESS:
      if (KXL_GetKey() == KXL_KEY_Return)
	flag = True;
      break;
    }
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlgettimer.html000066400000000000000000000025201412544137700170270ustar00rootroot00000000000000 KXL_GetTimer Prev Top Next
Name

KXL_GetTimer

Synopsis
KXL_GetTimer -- It checks to see timer interruption occurred.

Description
Bool KXL_GetTimer(void);

Arguments

Nothing.


Return Value
True = Timer interruption occurred.
False = Timer interruption has not occurred.

Exsample
#include <KXL.h>

int main(void)
{
  Uint16 count = 0;
  Uint8 buff[64];

  KXL_CreateWindow(100, 100, "kxl.org", 0);

  KXL_Timer(1); // 1 interruption per second

  while (count <= 10) {
    KXL_ClearFrameImm(0, 0, 100, 100);
    sprintf(buff, "%2d second", count ++);
    KXL_PutText(8, 50, buff);
    KXL_UpDateImm(0, 0, 100, 100);
    while (KXL_GetTimer() == False);
    KXL_ResetTimer();
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlinitsound.html000066400000000000000000000046701412544137700172330ustar00rootroot00000000000000 KXL_InitSound Prev Top Next
Name

KXL_InitSound

Synopsis
KXL_InitSound -- A sound server is started.
A wav file is read.
It checks to see /dev/dsp is effective.
The sampling rates of a wav file must be 8000Hz and a monophonic
recording.
A wav file is to 16 files.

Description
void KXL_InitSound(Uint8 *path, Uint8 **filename);

Arguments

pathThe path with which the wav file is placed.
Ex. In the case of a current directory, it is ".".
filenameArrangement which described the file name.


Return Value

Nothing.


Exsample
sound1.wav
sound1.wav
sound1.wav

#include <KXL.h>

int main(void)
{
  Bool flag = False;
  Uint8 *wavlist[] = {
    "sound1", // The sound of No. 0
    "sound2", // The sound of No. 1
    "sound3", // The sound of No. 2
    ""        // Indispensable
  };

  KXL_CreateWindow(200, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
		   KXL_EVENT_KEY_PRESS_MASK);
  KXL_InitSound(".", wavlist);

  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_EXPOSE:
      KXL_ClearFrameImm(0, 0, 200, 100);
      KXL_PutText(8, 20, "[1] - sound1");
      KXL_PutText(8, 40, "[2] - sound2");
      KXL_PutText(8, 60, "[3] - sound3");
      KXL_PutText(8, 99, "[4] - exit");
      KXL_UpDateImm(0, 0, 200, 100);
      break;;
    case KXL_EVENT_KEY_PRESS:
      switch (KXL_GetKey()) {
      case KXL_KEY_1:
	KXL_PlaySound(0, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_2:
	KXL_PlaySound(1, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_3:
	KXL_PlaySound(2, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_4:
	flag = True;
	break;
      }
    }
  }
  KXL_EndSound();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlloadbitmap.html000066400000000000000000000033111412544137700173220ustar00rootroot00000000000000 KXL_LoadBitmap Prev Top Next
Name

KXL_LoadBitmap

Synopsis
KXL_LoadBitmap -- An image is created from a bitmap file.
The bitmap file must be saved in 4bpp(16 colors) or 8bpp(256 colors) color.

Description
KXL_Image *KXL_LoadBitmap(Uint8 *filename, Uint8 maskno);

Arguments

filenameBitmap file name.
masknoThe color number of a transparent color.


Return Value

Pointer of KXL_Image structure.


Exsample
sample.bmp - 131 colors.

0 number is black.

#include <KXL.h>
int main(void)
{
  KXL_Image *mask_img, *nomask_img;
  
  KXL_CreateWindow(100, 100, "sample", 0);
  mask_img = KXL_LoadBitmap("sample.bmp", 0);
  nomask_img = KXL_LoadBitmap("sample.bmp", 255);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(nomask_img, 10, 10);
  KXL_PutImage(mask_img, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(mask_img);
  KXL_DeleteImage(nomask_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlplaysound.html000066400000000000000000000047261412544137700172370ustar00rootroot00000000000000 KXL_PlaySound Prev Top Next
Name

KXL_PlaySound

Synopsis
KXL_PlaySound -- A sound is controlled.

Description
void KXL_PlaySound(Uint16 no, KXL_Command command);

Arguments

noThe number of a sound.
commandControl command
KXL_SOUND_PLAYplay of a sound.
KXL_SOUND_PLAY_LOOPrepetition play of a sound.
KXL_SOUND_STOPstop of a sound.
KXL_SOUND_STOP_ALLall stop of a sound.


Return Value

Nothing.


Exsample
sound1.wav
sound1.wav
sound1.wav

#include <KXL.h>

int main(void)
{
  Bool flag = False;
  Uint8 *wavlist[] = {
    "sound1", // The sound of No. 0
    "sound2", // The sound of No. 1
    "sound3", // The sound of No. 2
    ""        // Indispensable
  };

  KXL_CreateWindow(200, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
		   KXL_EVENT_KEY_PRESS_MASK);
  KXL_InitSound(".", wavlist);

  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_EXPOSE:
      KXL_ClearFrameImm(0, 0, 200, 100);
      KXL_PutText(8, 20, "[1] - sound1");
      KXL_PutText(8, 40, "[2] - sound2");
      KXL_PutText(8, 60, "[3] - sound3");
      KXL_PutText(8, 99, "[4] - exit");
      KXL_UpDateImm(0, 0, 200, 100);
      break;;
    case KXL_EVENT_KEY_PRESS:
      switch (KXL_GetKey()) {
      case KXL_KEY_1:
	KXL_PlaySound(0, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_2:
	KXL_PlaySound(1, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_3:
	KXL_PlaySound(2, KXL_SOUND_PLAY);
	break;
      case KXL_KEY_4:
	flag = True;
	break;
      }
    }
  }
  KXL_EndSound();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputimage.html000066400000000000000000000027131412544137700170260ustar00rootroot00000000000000 KXL_PutImage Prev Top Next
Name

KXL_PutImage

Synopsis
KXL_PutImage -- An image is drawn.

Description
void KXL_PutImage(KXL_Image *img, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputimageimm.html000066400000000000000000000034731412544137700175350ustar00rootroot00000000000000 KXL_PutImageImm Prev Top Next
Name

KXL_PutImageImm

Synopsis
KXL_PutImageImm -- The arbitrary rectangles of an image are drawn.

Description
void KXL_PutImageImm(KXL_Image *img, Sint16 src_l, Sint16 src_t, Uint16 src_w, Uint16 src_h, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
src_lLeft position of a source image.
src_tTop position of a source image.
src_wWidth of a source image.
src_hHeight of a source image.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImageImm(img, 8, 8, 16, 16, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputimagerect.html000066400000000000000000000031761412544137700177100ustar00rootroot00000000000000 KXL_PutImageRect Prev Top Next
Name

KXL_PutImageRect

Synopsis
KXL_PutImageRect -- The arbitrary rectangles of an image are drawn.

Description
void KXL_PutImageRect(KXL_Image *img, KXL_Rect rect, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structre.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
  KXL_Rect rect = {8, 8, 16, 16};
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImageRect(img, rect, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputrectimage.html000066400000000000000000000032601412544137700177020ustar00rootroot00000000000000 KXL_PutRectImage Prev Top Next
Name

KXL_PutRectImage

Synopsis
KXL_PutRectImage -- The arbitrary rectangles of an image are drawn.
For the compatibility of 1.1.4 or earlier.

Description
void KXL_PutRectImage(KXL_Image *img, KXL_Rect rect, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structre.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
  KXL_Rect rect = {8, 8, 16, 16};
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutRectImage(img, rect, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputstretchimage.html000066400000000000000000000032341412544137700204220ustar00rootroot00000000000000 KXL_PutStretchImage Prev Top Next
Name

KXL_PutStretchImage

Synopsis
KXL_PutStretchImage -- It expands or reduces and an image is drawn.

Description
void KXL_PutStretchImage(KXL_Image *img, Uint16 width, Uint16 height. Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
widthWidth which draws.
heightHeight which draws.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutStretchImage(img, 100, 100, 0, 0);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputstretchimageimm.html000066400000000000000000000037571412544137700211370ustar00rootroot00000000000000 KXL_PutStretchImageImm Prev Top Next
Name

KXL_PutStretchImageImm

Synopsis
KXL_PutStretchImageImm -- It expands or reduces and the arbitrary rectangles of an image are drawn.

Description
void KXL_PutStretchImageImm(KXL_Image *img, Sint16 src_l, Sint16 src_t, Uint16 src_w, Uint16 src_h. Uint16 width, Uint16 height, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
src_lLeft position of a source image.
src_tTop position of a source image.
src_wWidth of a source image.
src_hHeight of a source image.
widthWidth which draws.
heightHeight which draws.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutStretchImageImm(img, 16, 0, 16, 32, 100, 100, 0, 0);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputstretchimagerect.html000066400000000000000000000034731412544137700213050ustar00rootroot00000000000000 KXL_PutStretchImageRect Prev Top Next
Name

KXL_PutStretchImageRect

Synopsis
KXL_PutStretchImageRect -- It expands or reduces and the arbitrary rectangles of an image are drawn.

Description
void KXL_PutStretchImageRect(KXL_Image *img, KXL_Rect rect. Uint16 width, Uint16 height, Sint16 left, Sint16 top);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structure.
widthWidth which draws.
heightHeight which draws.
leftLeft position which draws.
topTop position which draws.


Return Value

Nothing.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img;
  KXL_Rect rect = { 8, 8, 16, 16};
 
  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutStretchImageRect(img, rect, 100, 100, 0, 0);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlputtext.html000066400000000000000000000023311412544137700167240ustar00rootroot00000000000000 KXL_PutText Prev Top Next
Name

KXL_PutText

Synopsis
KXL_PutText -- A text is drawn.

Description
void KXL_PutText(Sint16 left, Uint16 top, Uint8 *text);

Arguments

leftLeft position which draws.
topTop position which draws.
textText which draws.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_Font(NULL, 0xff, 0x00, 0x00);
  KXL_PutText(20, 20, "Sample");
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlresettimer.html000066400000000000000000000023341412544137700173750ustar00rootroot00000000000000 KXL_ResetTimer Prev Top
Name

KXL_ResetTimer

Synopsis
KXL_ResetTimer -- Timer interruption is reset.

Description
void KXL_ResetTimer(void);

Arguments

Nothing.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Uint16 count = 0;
  Uint8 buff[64];

  KXL_CreateWindow(100, 100, "kxl.org", 0);

  KXL_Timer(1); // 1 interruption per second

  while (count <= 10) {
    KXL_ClearFrameImm(0, 0, 100, 100);
    sprintf(buff, "%2d second", count ++);
    KXL_PutText(8, 50, buff);
    KXL_UpDateImm(0, 0, 100, 100);
    while (KXL_GetTimer() == False);
    KXL_ResetTimer();
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlresizeframe.html000066400000000000000000000026471412544137700175350ustar00rootroot00000000000000 KXL_ReSizeFrame Prev Top Next
Name

KXL_ReSizeFrame

Synopsis
KXL_ReSizeFrame -- The size of a frame is changed.

Description
void KXL_ReSizeFrame(Uint16 width, Uint16 height);

Arguments

widthWidth of a frame
heightHeight of a frame


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_ReSizeFrame(200, 200);
  KXL_ClearFrameImm(0, 0, 200, 200);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_DrawRectangle(100, 100, 30, 30, True);

  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_UpDateImm(50, 50, 100, 100);
  getchar();
  KXL_UpDateImm(100, 100, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlsetdrawcolor.html000066400000000000000000000024621412544137700177240ustar00rootroot00000000000000 KXL_SetDrawColor Prev Top Next
Name

KXL_SetDrawColor

Synopsis
KXL_SetDrawColor -- A point, a line, and the color at the time of a frame clearance are set up.

Description
void KXL_SetDrawColor(Uint8 red, Uint8 green Uint8 blue);

Arguments

redRed luminosity.
greenGreen luminosity.
blueBlue luminosity.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_SetDrawColor(0x55, 0xee, 0x88);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlstrechimage.html000066400000000000000000000032541412544137700175070ustar00rootroot00000000000000 KXL_StrechImage Prev Top Next
Name

KXL_StrechImage

Synopsis
KXL_StrechImage -- An image are expanded or reduced and it copies to a new image.
For the compatibility of 1.1.4 or earlier.

Description
KXL_Image *KXL_StrechImage(KXL_Image *img, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
widthNew width
heightNew height


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

int main(void)
{
  KXL_Image *img, *copy_img;

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  copy_img = KXL_StrechImage(img, 78, 78);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 20, 20);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxltextwidth.html000066400000000000000000000023261412544137700172370ustar00rootroot00000000000000 KXL_TextWidth Prev Top Next
Name

KXL_TextWidth

Synopsis
KXL_PutText -- The drawing width of a text is obtained.

Description
Uint16 KXL_TextWidth(Uint8 *text);

Arguments

textText which draws.


Return Value

Drawing width of a text.


Exsample
#include <KXL.h>

int main(void)
{
  Uint8 *text = "kxl.org";
  Uint16 w;

  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_Font(NULL, 0xff, 0x00, 0x00);
  w = KXL_TextWidth(text);
  KXL_PutText(100 - w / 2, 10, text);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxltimer.html000066400000000000000000000025671412544137700163420ustar00rootroot00000000000000 KXL_Timer Prev Top Next
Name

KXL_Timer

Synopsis
KXL_Timer -- The number of times of interruption for 1 second is specified.

Description
void KXL_Timer(Uint16 count);

Arguments

countThe number of times of interruption for 1 second.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  Uint16 count = 0;
  Uint8 buff[64];

  KXL_CreateWindow(100, 100, "kxl.org", 0);

  KXL_Timer(1); // 1 interruption per second

  while (count <= 10) {
    KXL_ClearFrameImm(0, 0, 100, 100);
    sprintf(buff, "%2d second", count ++);
    KXL_PutText(8, 50, buff);
    KXL_UpDateImm(0, 0, 100, 100);
    while (KXL_GetTimer() == False);
    KXL_ResetTimer();
  }
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlupdate.html000066400000000000000000000023561412544137700165000ustar00rootroot00000000000000 KXL_UpDate Prev Top Next
Name

KXL_UpDate

Synopsis
KXL_UpDate -- The rectangle of arbitrary frames is copied to a window.
For the compatibility of 1.1.4 or earlier.

Description
void KXL_UpDate(KXL_Rect rect);

Arguments

rectKXL_Rect structure.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_Rect rect = {0, 0, 100, 100};

  KXL_CreateWindow(rect.Width, rect.Height, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDate(rect);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlupdateimm.html000066400000000000000000000025261412544137700172020ustar00rootroot00000000000000 KXL_UpDateImm Prev Top Next
Name

KXL_UpDateImm

Synopsis
KXL_UpDateImm -- The rectangle of arbitrary frames is copied to a window.

Description
void KXL_UpDateImm(Sint16 left, Sint16 top, Uint16 width, Uint16 height);

Arguments

topLeft position of a frame.
leftTop position of a frame.
widthWidth of a frame.
heightHeight of a frame.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_CreateWindow(100, 100, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/kxlupdaterect.html000066400000000000000000000023231412544137700173500ustar00rootroot00000000000000 KXL_UpDateRect Prev Top Next
Name

KXL_UpDateRect

Synopsis
KXL_UpDateRect -- The rectangle of arbitrary frames is copied to a window.

Description
void KXL_UpDateRect(KXL_Rect rect);

Arguments

rectKXL_Rect structure.


Return Value

Nothing.


Exsample
#include <KXL.h>

int main(void)
{
  KXL_Rect rect = {0, 0, 100, 100};

  KXL_CreateWindow(rect.Width, rect.Height, "sample", 0);
  KXL_SetDrawColor(0xff, 0x00, 0x00);
  KXL_DrawRectangle(30, 30, 30, 30, True);
  KXL_UpDateRect(rect);
  getchar();
  KXL_DeleteWindow();
  return 0;
}
libKXL-1.2.4/docs/outline.html000066400000000000000000000064631412544137700161610ustar00rootroot00000000000000 The outline of KXL Prev Top Next
The outline of KXL

From the first, although this was the function county of a drawing system and a sound system which was being used by Geki2 Ver0.8.7, these are readjusted for libraries. I think that it understands if I have Geki2, Geki3, SpaceAryarya, etc. seen as the result. Then, although it thinks that it has noticed, there is no so-called widget called a button, a label, and file selection in these. It is saying that comfort of the easy game will be carried out and it will be developed only in window of one sheet, pixmap of one sheet, and a simple sound. It enabled it to program simply even if not conscious of especially xlib. It becomes as an image as it is shown in the following figure.


           Window                 Pixmap              Image
        __________________     __________________     ____
       /                 /    /            _____/____/_  /
      /                 /    /          __/_   /    /___/
     /                 /    /          / / /  / 
    /                 /    /          /___/  /      Text
   /          <------/----/            ____ /______"HelloWorld"
  /                 /    /            /    /
 /                 /    /       HelloWorld/
/_________________/    /_________________/
libKXL-1.2.4/docs/sample.bmp000066400000000000000000000036721412544137700155740ustar00rootroot00000000000000BM(  ##))//55;; ::@@FFLLRR44QQWW]]cc..EEKKbbhhnn ""((??\\ttyy99VVss33PPggmm--DDJJaa~~ !!''>>[[xx 88UUllrrΖ22OOff臆,,CCII``}}臼祁 &&==ZZww十鍛77TTkkqqゥ詑犯11NNee室領++BBHH__||旭橋様嗷%%<<YYvv杷捶66SSjjppい疏慓湎00GGMMdd亀算厰粐AA^^{{面蜑XXuu篤窿iioo誓忻毫闖幹査冪銕zz頬蓙┬電矜□真嶽樛齠崖更佩迯癖艸Ё陳瘁松孚栩鴪幻蕨跛鰭聿慱烟掣巫墹U榴孀毋旄嘲;E墹洋慱厦掣嶝俛34;滅墹洋晩厦品嶝佶+,4;滅恥洋板厦品途佶$+,疎縮巴祥糧朕鷲陛石貌$宍,疎酋巴招姑朕紘陛精貌$宍疎酋庵招険朕慌嚇精仔Ъ起┤酋葵招険森桶精А起┤彊7険す桶ズА┤葵雨桶ゴА┤z|}~yrz{s|t}u~vwyrjz{sk|tlm}un~vowp_`yrjaz{skb|tlmc}unde~vofwpqi_`WrjaXYskbZtlmc[unde\vof]^wpqxOi_`WPjaXYQkbZRlmc[Snde\Tof]^gpqVOG_`WPHaXYQIbZRJKc[SLde\TMf]^ghVOG>?WPH@XYQIAZRJKB[SLCD\TMN]^=5OG>?6PH@78QIA9RJKB:SLCD?6.H@78/IA90JKB:2LCD?6.(@78/)A901*B:23CD>>>ff厰::米栃66^^Ζvv~~>>裴**BB.**66nn焚改FF22旙鄲卓**.VV酳朋rrff.ZZRR邵刷Z22湎"""">jjZVVvv^^NNRR醂Z鴪 鈕腋ZBBvv.zz聿.jj橋松篤..&&臆領VV□zz""JJbbnn査詑癖::22**嶽**rr矜銕. 腹◯....jjハ..紛VVZZFF.., HP@7MRxA#BJ8按9J .A`i3d! f&t萓E& XD=Y0&$燹J/AacsK*嬬ADSm叱y,EL&鯡稠fyl1"]$h 踏U皀WG濘5|q傳bC6v$K嚀僵(H" x.°3ey萼痍/`_RPNeh.宴81Xw=QnGK +W煮,<句bB{#DYJb"^O\CrY_RTQkX|W!/ ZY 6mサ\|1E/-cneiywERQY6馘m/J8"6j }挽guAZn刺'腺?:Uhb z!培{NyF8$園Ul=ew良WFp'q仞~y$Qg"A是z/寓Vy%P!`)w5hΑH9gr1RHda(*09t4: D68祀NQ膂0VJ, Ll井QGSH窄G G>;libKXL-1.2.4/docs/sound1.wav000066400000000000000000000132421412544137700155350ustar00rootroot00000000000000RIFFWAVEfmt J!J!datav崖{崖@@@@m崖崖}@@@@iy崖崖@@@S{崖崖wsyyyy}崖崖嘘@@@u崖崖is崖崖s{aM@@@@@Am崖崖崖GS划u}}u}崖yw3@esyyyyYY崖崖G@{ww}ya{{@@YG崖{yy}mGy崖咳Y@Se3A@@@划芥MA械umy{mes{崖崖崖S@@@@a{崖劾1Y@@@i{崖@@syyi@A崖wss臼羽w崖崖smmyA@A@M@@@@u崖崖崖崖A@@q崖崖uua@@@G崖wy崖@@Misq@@]崖崖崖崖ww]@@@Y崖崖wuuw崖崖@q崖m@@]y}}uay}yy崖@@@@m崖崖咳崖崖M@@G崖y}嘘s@@@iy{崖崖崖uwsGisG@q崖崖械m@u崖崖崖q@@@@@@@Y}崖崖M@@@@@s崖崖崖崖Y@@@aS@{@@@@@e崖械s@aq@@@@Sw崖崖崖崖S]崖sGAq崖崖嘘yA嘘u划}S@@q{qiu{M崖崖M@@@e}mm@@崖芥{yyyequ崖S@Ay{we@@@Mu崖崖崖yyyy}}m@@GA@@@}崖崖y@e{崖@@@Yy崖崖崖}}w@@qy}qu}}{ysqy}崖G@{崖崖崖崖a@@@@@m崖崖M@@@m{崖y崖崖械A@@qy@@u]@w}崖崖sa崖}GY@@@ayq崖崖}@iy崖yi@@Y}i@es划划@AYq{wu}崖{y@@}a崖崖械m@@y3A@@@@@a劾}yyy}{{崖崖]@]w{}u]Y崖崖崖@@@@q崖劾@@@@Y崖崖e@@崖嘘aaey隠崖@@@@@@@@My崖崖y{@@@Au崖崖]崖崖}aA@@@@@崖崖aw羽}yyyYMs崖崖芥崖}wes{崖@@@@]1}}崖}im{{yyyq@@{{qiy崖崖崖崖芥q@GemswyyuM@m崖{}}]@@@u崖崖崖嘘}ia划s@@@@A崖u]}械{qy崖械@@aqY]u臼{{]s崖崖械q@@y咳崖Ms崖崖{a@@@@@@Sssmw嘘崖崖yy崖M@@MuM@Ai崖崖崖}uMMis]@@@@q崖崖{qe]}咳yeey劾uuy{崖}@q嘘a@@@s}崖{崖崖yiYGm}yaMYqy}yY@@u崖y臼崖崖}iu崖崖{wy{wyyy崖崖yYYy崖芥yeM@@aeu{@@Amsw崖崖崖崖@@@Aume械{m@@@M崖崖崖A@@ew{wesy羽{y}}]S划umiq崖y}崖咳{y}}wuyyemy崖崖崖yqaMSSa}m]崖崖崖械}i]s3{q@@@G劾崖崖崖yy}}ysqy崖崖崖芥}aA@@a}yseM@@Y]@Sy崖崖ys{崖崖崖崖ye]u{{}}}y@@@@Mw崖崖崖崖崖}qqsS@@@@@Gsyii崖崖崖eew崖咳}y}崖@@@@s{}}}崖}ywmuye]mw崖械A@Mmw{y}崖崖械uAiuA@@i崖划weAGSqy划崖{mey{wy}}}崖崖崖yy{}m@@Gyyq@@{崖yi}yw崖}yiYae@e崖崖}}崖uaw{yeM@@m3崖崖Y@@]}崖崖YMa{崖崖@@e劾wM@@Gmy崖}yyw{{}3崖崖wiaS@@G@@划崖崖崖yqeSMYaia@@a崖械崖崖劾a@@@@aw{meu{崖崖崖崖]@mwY@G{崖崖1yiqiiiw崖崖崖m@@@@mw}划崖崖iM@@qeeqw}}y}y{崖崖{崖y@@@i}sey1M@Gs{3芥}yuu{崖yqqsw}崖{{qais{崖yssw1}iY@Meswy{mw}崖imu崖崖3崖}mYYqeSqy}mGGm芥{{yy崖械{sqquy}yyyiYau崖3崖]@iusqwwyu{{}m]qy崖崖崖崖崖e@@@q}msm@@ew崖崖崖{崖}wMAq}{{semyywmmy崖崖崖械m@GG@Yy崖}{}wuqqs{崖{yim{{}崖}{3械wsaY]eSay}yywy械{}3崖崖3械seaS]m{w]Ge{崖劾械{yy}{wuwy}崖崖{{{yyyyy{}u@@]y3崖崖崖yaMessmswww崖崖}uMAYq}崖qiw划{{wuuwyyyqsyy嘘崖}y}yywyyy{}wuuuy}崖崖wuy嘘mGAMq崖崖swy{{{{qGGs崖3崖uy}ywyy{}{}}yiqy}}}崖崖qy}{{yy}嘘咳}SMe]Yu{{崖划咳{wuqG@AYqy崖劾}崖{wy}}}}{smeeau崖e]is崖3崖yssqiimuy}崖劾}qequwww{{{yy崖}w{{{yyywww{{y{{yy咳}}yu}崖}qS]my芥i@Aau}嘘劾咳{wuy}}{wwywwy{{yyyy崖崖}uuu}{y{uYY]my崖}嘘}yuw{}}yyy{}{}}{{{{yy}{emyyw{y}劾yuqsy}}}}{wswyy}{www}{{sq}yyyy}}{y}}ywyy}}{划嘘{wuqqiu}yy}崖}yums{{wy}劾}ys{{{隠{{}}yimuy{{{崖劾}wsswy}{yyyyy}芥{{{{}}yyuw}}yuuw{{ya@ew{}}}}yyy}{{{{{{yy}}}{yssu{崖崖械yuw{}}qaqwy{{ww}3隠{wwyyy{ww}}}y{{wwy{{}崖}{{{{{{{yy}}}}}划}}}}ysu{{y{y}}yy{yyyy}}ysuwy}}ywy{{}{{{wuy}芥{{}ywy{}1{{{}}{y}{{{yuwy{{yy}崖隠{yy}{wuuyyyyy}}崖}{yy{ywwwwy{}}}yu}嘘劾}}}{}{ywuuy}}yyy}崖{yyy{}}}}}{{}{w{{{}{}{w{}}{yyyyyyy}崖}{yyyuw}{wwy{{{{}}}{}}}y}{yyy}}}}yuu}}}}}}}}{{{{{{}yy}{yy}}}}}yyy}{}{yy}yy}{{{{{yyyyy}}}{{{{}}yy{}}}}}{{}}}y{}}yy}yy}{{{{{{}{wuy}}}}yy{{yy}{yyyyyy{{}}{{{y{{}}{{}}}}}}}}{yyy}}}}}}}}}}}}}yy}}}}}}}}}yy{{{}{{{}}}}}}}}}}}}}{y}}}{yyy}}}}}}}}}}}}{yy{}}{}yyyy{{}{{}{y{}{{}}}}}}}}{{{}{{}}}}}}}}}}}{{{}}}}}}}}}{{{}}}}}}}}}}yy{{{}}}}{{{{}}}}}}}}}}{{{{{}}{}}}}}}}{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{}{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}libKXL-1.2.4/docs/sound2.wav000066400000000000000000000107341412544137700155410ustar00rootroot00000000000000RIFFWAVEfmt ++data~~~xQj|XXssTjw~Xlf\w~oc~hc|jle/Zul棡殯憖匏ォSJ]$D6/jn|V]XzoJ_]J崑表珪|f|us荻xs]fhlTKQcx\jK|HsMhJX|\?sXwxQs|T~qaA|leaslsx・leVaezfcfn卸ln|ajsOfoTelJalKhczOz\|sn]_X_owVSozTw]Zl_~jw~Fl_KfQ]XS|sQxjxaxc~刊\s]jwlFzwao_Mjo\w]onzSn|j_|ooQ\jhns|]Xl\zz|\xhuxfaq__~c|uoaljcx工leV|~aqhaxzjhhXc|KoOc←qqn_won_oT_eKlwjwwnquJz←~~cluxs_xlllT_zocJzwfqHVuoM?qVoZl]]slljx~qzqz~qoQanwnl]aanQoz|\皓TxV~hqMz\F8\FosAc垈ShcjOVFZc&woohjKFZxqfh杷fZ~|s=h豫FfcujVKQz~ZбFlhll]l\lee\eTx_ahn_HZSfD|aF_依|Os?hl]|]lFK\XzD郵f]x~BQxK]c|zh|A]w樟sahahwj|jTQlulhjXel|xsX\ufQwVXz_ahel\Bqxos]qJew\z]nnne\Qu尿V|nQo|hneXBxwnoezjKfzZeefwZJfxo_xZaOO~VSwslЮa~ZcuHlnjshf|XSManufx\Ocn_je_eu~XOu_wxj_fojsefwsj_csjVcew~~jhx\e|~nhq~aMxszowТzl]sej|l|lwjasxhT||nu~hVcqoqjOozss|o||oqus]azqzゥxzou~q_uzszewx|loqVcuxqwhxnZc||n~xu~\Zww~~s~ue~□z]nzf_wol~~nzwhzj\wonzo|lqqeowaX|s|s~ow~\Fasqu~fVhxoqluqneqqfjoawwof|q~xfaqxqc|eqlzflu~oczwznzq]Snzxexq|__soenx~wn~el~~n]ohs|w~q]uolzwlaf~wsj||owzX\wuwcw|cVe|sfxlss~hlojflzqlownsfcw~u~nlu_juo~qlwzujusux~xc|qhuxs|zscx~ouwnZXq~suzl\nquqw~xfjxqjz~n~ws~wsnlhuol~sqxnlq|~xx~qju|u|nsuzjhnql_s~x|~~luuo||wjnz~|lnweVjz|xs|zxhoz||ssxqz~~z~szulo|wqqsxsnq~~sz~lnuz|u~xwx~zx|wnwxsu~zz|zuzsjcfx|sq|~onwuwzzwn|znfsz~~||z~~z|s|sq~|zqxssz~||xz~z|slsx|w~~qw||qu~~zxqlquw|szuwz|||wquxz|q|~|zusxwsuqllz|~qx~~xonu|~~~wqqzuuaj~xzz|z~||xnu|zzshz~sonjnlx~sx~x|~|||wzxsxuqw~|z~uqx||wswwu||||~zzxx|xnox~zzxz||wz|uw|z~zu||~~wsnowuz|z~~zwuwxzx~ww|~z~x|zuw||z|~~zxz~~|wx|xuswsswwx|~zz|xusqwzxzxxzw|~~zx~~zxwwzusxusz~xxuqw~||zz~zz~~z~~~x|zxwzzxz~~wx|x||||wuxxs|||~~~~~xwwsqsu~z~~w~zz|~|z~~|~|zzzw|~~zz~wwsossw~|~~|~~zzxz~zxzxuu|xz|||||~zxuwzz|~|zzxz~zxxzz|||||zwwz|~~zxwwuu~~~||~~~~~||zz||zz|~~~zwxz||~|xwx|~|xsswxx~~~~|~|~zz~|wwzz~||zwwxx~||~|~~|zxx~~zssssuwz|~|xxwsw|~~|zz|zz~~zzxusz~|z||z|~|zzzxxz||~|z|z||~xuwwx~~~~~~|~zwxxxw|~||~~~~|xswxxz~|z|~~~~|~~zz||~~|zxxzz||zxxwux~~zzxz|~~|zxxz|~~||zzxz|~|wuuwx|~|z|~|z|z|||~~|z|~~|~|zz||z~~~|zxzz|~xxwwzz|~~~~zxxwwxzz~~~zuuwwx|~~||z|~~|~~zxxz|~~|zzz~~|~|zz|~|~|~||~~||~~zz|~|~~~zussuwx|~~~zzxwx|~|zz|zzz||z||zz||~||xwxxz|~|zz||~|zzxzxxz|~~~||~~||~~~|~|~~|zzx|~|~|~|~~~~|~zwxwuwz|~~||~~|zxxwwzz|~|~~~~|~~~~|z||z||zxxxxz|||z|~~~~~||~||~~|zxxz|~|~~|z|z~~~~|xzxz~~~~~~||~~~||zxwxz||~~zxwwxxz||z|~~~||zxxz~|~~~|zxz|~~||~zxxxzz||~~~~~~||~||~|zz|~~~~~|zzz|||~|~~|z|zz~|z||z||~~~~|z|zz~~|zxwwxz|~~~~||~~~~||||~~~~~|zxxz|~~|~|z|~|~~~|zzxzx|~~~~~~|zxwwz||~~~z|||z||~~~||z|~~||~~~~~~||~~~~|~~|~~~~|zz|~~~~~||~~~~||~~~~~|zz|~~~||z|zlibKXL-1.2.4/docs/sound3.wav000066400000000000000000000074341412544137700155450ustar00rootroot00000000000000RIFFWAVEfmt @@dataww}勲~}wtnttnxuq{xu{i`r]\qVZkP\ncr`Bhb?_\`BfeJhWGhknwofbq雨~脈z~oED`E\zZf_,JhVq{QY_D]zlZ_渋et姓凶wtrYq梗knfD\rrxZ]M/e~\n}]\G>ecn}iWT_lq┛々kwei泡qiQh~ZrhQQ#BoZNEz}ee叩NexkwzД{zw\Po頃ewD>xt`q供VotZtzowПrx{k{QB{汐ik_e]xk終}>*QqoVnZb}EM香tfqlYtnw,z>>Nr`q鏡~>6nwtbN紘wwu}trzriAGtDYごZ3/zuJT酋xqZTu◆oQk_GJzt幡wSG\hkY2n電iQD8x'$愴KMbi厰GN蕗-`6`乍/閖kMQ0鎌;P-Ye#Q仙 9]?MGt>N剿#<數k,K6r脊<-w題9#oM E?n堡o6b>!o壙n,YJ弐0)i>q懼 ~鱸tT*G病PG識wYP09E~湛z;E針8P┴P2iQ)u是\3M杲8q>_布5T析TD$3K涜H9z意eQx-i磐Q9kV!\峻56\9Z影8VЫ愀P0BM台9QVP8DT駄K8r]eqzS?玖A K6q椏-授Bi填i)-P?}P6V替5Aq*2K紡K8革e'Tf裘q&l戚B`> J訣JT{蛛l$暸H6授JG冶o*S{hK3n社Nq /Лt5V恣3]實3 ~JG潔E5囚KE簸;\i)8廴Y-3rBJ副P E兔VVhk]!e*枳x;i鎖l/&P∨速e9Tr,2Z胆J3_殼Ptu- Q径_0<抽<8Q*w琿>?}`$愎\ 2粍H?ユw?9静~>Dx_?]}VA甜k x醒hYbiq69e刼\D_xT'B籥t堡`V`}f5P鯵QA6eоJP{Y)殄`\kibht}ZQY}オS9衵r2;尊{Z]t{bfku}]H*Mょr\on-3o郷w?M~獣f_th]V!5殼?6>f徒8<}浩*Y鞍zehtJ6Nz┸<0o:< N比\E\異uDY{k_E*e芸<6t十範n/NZ 鑿~V\rqcQWh390Q戎x99n愚_5tP`Z3?kャ>Au_)殿hK6*r汾GQ`AD;e芋JJqWSWe{b3>恍B/Db荊PB靄YDVokK\ib朴管G6iH -÷声Q5H怫bP`hxz9*]ġB2稲丹ENnk&_捨貝``uwlGJ郎wAAlc#w栫iABf倶k9Mk8H{nV)w艘幹xJY~{K/翆汐`BQ~柔Y6]~~E)Pr均P&埖襲c5E麻;G{撹f>W\)i汗8,cズ\,Afヒt!l鏡綱Q8b}W5\あYE5?隁YNcuH8淬婚_JW{┬V6_~lDMc{疳l -f╂6T謁nNDV什WQr~B8JMr薯]Snt{]*?峻eBHlむqbebrrVZYb;!Hr瘢JHo\J<8i轟x`\euEDt香后hSV{tDBltzlPJn]MKe菌ePPh⌒QPcucJe}])Gfl晉f`bi~{ZB繋Q Global variables Prev Top Next
The event to receive.
An event is specified combining the following by logical sum.
KXL_EVENT_NO_MASK
KXL_EVENT_KEY_PRESS_MASK
KXL_EVENT_KEY_RELEASE_MASK
KXL_EVENT_BUTTON_PRESS_MASK
KXL_EVENT_BUTTON_RELEASE_MASK
KXL_EVENT_BUTTON_MOTION_MASK
KXL_EVENT_EXPOSURE_MASK
The received event.
KXL_EVENT_KEY_PRESS
KXL_EVENT_KEY_RELEASE
KXL_EVENT_BUTTON_PRESS
KXL_EVENT_BUTTON_RELEASE
KXL_EVENT_BUTTON_MOTION
KXL_EVENT_EXPOSE
The received key code.
KXL_KEY_BackSpace
KXL_KEY_Tab
KXL_KEY_Return
KXL_KEY_Escape
KXL_KEY_Delete
KXL_KEY_Home
KXL_KEY_Left
KXL_KEY_Up
KXL_KEY_Right
KXL_KEY_Down
KXL_KEY_F1
KXL_KEY_F2
KXL_KEY_F3
KXL_KEY_F4
KXL_KEY_F5
KXL_KEY_F6
KXL_KEY_F7
KXL_KEY_F8
KXL_KEY_F9
KXL_KEY_F10
KXL_KEY_F11
KXL_KEY_F12
KXL_KEY_Shift_L	
KXL_KEY_Shift_R	
KXL_KEY_Control_L
KXL_KEY_Control_R
KXL_KEY_Space
KXL_KEY_Exclam
KXL_KEY_Quotedbl
KXL_KEY_Numbersign
KXL_KEY_Dollar
KXL_KEY_Percent
KXL_KEY_Ampersand
KXL_KEY_Apostrophe
KXL_KEY_Quoteright
KXL_KEY_Parenleft
KXL_KEY_Parenright
KXL_KEY_Asterisk
KXL_KEY_Plus
KXL_KEY_Comma
KXL_KEY_Minus
KXL_KEY_Period
KXL_KEY_Slash
KXL_KEY_0
KXL_KEY_1
KXL_KEY_2
KXL_KEY_3
KXL_KEY_4
KXL_KEY_5
KXL_KEY_6
KXL_KEY_7
KXL_KEY_8
KXL_KEY_9
KXL_KEY_Colon
KXL_KEY_Semicolon
KXL_KEY_Less
KXL_KEY_Equal
KXL_KEY_Greater
KXL_KEY_Question
KXL_KEY_At
KXL_KEY_A
KXL_KEY_B
KXL_KEY_C
KXL_KEY_D
KXL_KEY_E
KXL_KEY_F
KXL_KEY_G
KXL_KEY_H
KXL_KEY_I
KXL_KEY_J
KXL_KEY_K
KXL_KEY_L
KXL_KEY_M
KXL_KEY_N
KXL_KEY_O
KXL_KEY_P
KXL_KEY_Q
KXL_KEY_R
KXL_KEY_S
KXL_KEY_T
KXL_KEY_U
KXL_KEY_V
KXL_KEY_W
KXL_KEY_X
KXL_KEY_Y
KXL_KEY_Z
KXL_KEY_Bracketleft
KXL_KEY_Backslash
KXL_KEY_Bracketright
KXL_KEY_Asciicircum
KXL_KEY_Underscore
KXL_KEY_Grave
KXL_KEY_Quoteleft
KXL_KEY_a
KXL_KEY_b
KXL_KEY_c
KXL_KEY_d
KXL_KEY_e
KXL_KEY_f
KXL_KEY_g
KXL_KEY_h
KXL_KEY_i
KXL_KEY_j
KXL_KEY_k
KXL_KEY_l
KXL_KEY_m
KXL_KEY_n
KXL_KEY_o
KXL_KEY_p
KXL_KEY_q
KXL_KEY_r
KXL_KEY_s
KXL_KEY_t
KXL_KEY_u
KXL_KEY_v
KXL_KEY_w
KXL_KEY_x
KXL_KEY_y
KXL_KEY_z
KXL_KEY_Braceleft
KXL_KEY_Bar
KXL_KEY_Braceright
KXL_KEY_Asciitilde
Size of a variable.
Sint8signed char
Uint8unsigned char
Sint16signed short
Uint16unsigned short
Sint32signed long
Uint32signed long

Image structure
The image loaded or copied is stored.
Usually, it is not used other than Width and Height.
typedef struct {
  Pixmap Buffer; // Drawing image
  Pixmap Mask;   // Mask image
  GC     MaskGC; // GC of mask image
  Uint16 Width;  // Drawing width
  Uint16 Height; // Drawing height
} KXL_Image;
// Rectangle structure typedef struct { Sint16 Left; // Left Sint16 Top; // Top Uint16 Width; // Width Uint16 Height; // Height } KXL_Rect; // Polygon array typedef XPoint KXL_Polygon; // Sound control typedef enum { KXL_SOUND_PLAY, // Play sound KXL_SOUND_PLAY_LOOP, // Loop play sound KXL_SOUND_STOP, // Stop sound KXL_SOUND_STOP_ALL // Stop all sound } KXL_Command; libKXL-1.2.4/docs/vkxlevent.html000066400000000000000000000022031412544137700165140ustar00rootroot00000000000000 KXL_EVENT_xxx Prev Top Next
Name

KXL_EVENT_xxx -- The received event.

KXL_EVENT_KEY_PRESSWhen a key is press.
KXL_EVENT_KEY_RELEASEWhen a key is release.
KXL_EVENT_BUTTON_PRESSWhen a mouse button is press.
KXL_EVENT_BUTTON_RELEASEWhen a mouse button is release.
KXL_EVENT_BUTTON_MOTIONWhen a moves pressing mouse button.
KXL_EVENT_EXPOSEWhen a demand of re-drawing.


Description

It is used by KXL_GetEvents. libKXL-1.2.4/docs/vkxleventmask.html000066400000000000000000000022571412544137700174010ustar00rootroot00000000000000 KXL_EVENT_xxx_MASK Prev Top Next
Name

KXL_EVENT_xxx_MASK -- The event to receive.

KXL_EVENT_KEY_PRESS_MASKWhen a key is press.
KXL_EVENT_KEY_RELEASE_MASKWhen a key is release.
KXL_EVENT_BUTTON_PRESS_MASKWhen a mouse button is press.
KXL_EVENT_BUTTON_RELEASE_MASKWhen a mouse button is release.
KXL_EVENT_BUTTON_MOTION_MASKWhen a moves pressing mouse button.
KXL_EVENT_EXPOSURE_MASKWhen a demand of re-drawing.


Description

It is used by KXL_CreateWindow. libKXL-1.2.4/docs/vkxlimage.html000066400000000000000000000040351412544137700164620ustar00rootroot00000000000000 KXL_Image Prev Top Next
Name

KXL_Image -- Image structure.

Structure Definition
typedef struct {
  Pixmap Buffer; // Prohibition of use
  Pixmap Mask;   // Prohibition of use
  GC     MaskGC; // Prohibition of use
  Uint16 Width;  // Read-only
  Uint16 Height; // Read-only
} KXL_Image;

Structure data
BufferPixmap of a image
MaskPixmap of a mask image
MaskGCGC of a mask image
WidthWidth of the image
HeightHeight of the image

Description
It is used by KXL_LoadBitmap KXL_CopyImageRect KXL_CopyImageImm KXL_CopyImage KXL_CopyStretchImageRect KXL_CopyStretchImageImm KXL_CopyStretchImage KXL_StrechImage KXL_PutImage KXL_PutImageRect KXL_PutImageImm KXL_PutRectImage KXL_PutStretchImage KXL_PutStretchImageRect KXL_PutStretchImageImm KXL_DeleteImage libKXL-1.2.4/docs/vkxlkey.html000066400000000000000000000070471412544137700161760ustar00rootroot00000000000000 KXL_KEY_xxx Prev Top Next
Name

KXL_KEY_xxx -- The received key code.

KXL_KEY_BackSpaceKXL_KEY_TabKXL_KEY_Return
KXL_KEY_EscapeKXL_KEY_DeleteKXL_KEY_Home
KXL_KEY_LeftKXL_KEY_UpKXL_KEY_Right
KXL_KEY_DownKXL_KEY_F1KXL_KEY_F2
KXL_KEY_F3KXL_KEY_F4KXL_KEY_F5
KXL_KEY_F6KXL_KEY_F7KXL_KEY_F8
KXL_KEY_F9KXL_KEY_F10KXL_KEY_F11
KXL_KEY_F12KXL_KEY_Shift_L KXL_KEY_Shift_R
KXL_KEY_Control_LKXL_KEY_Control_RKXL_KEY_Space
KXL_KEY_ExclamKXL_KEY_QuotedblKXL_KEY_Numbersign
KXL_KEY_DollarKXL_KEY_PercentKXL_KEY_Ampersand
KXL_KEY_ApostropheKXL_KEY_QuoterightKXL_KEY_Parenleft
KXL_KEY_ParenrightKXL_KEY_AsteriskKXL_KEY_Plus
KXL_KEY_CommaKXL_KEY_MinusKXL_KEY_Period
KXL_KEY_SlashKXL_KEY_0KXL_KEY_1
KXL_KEY_2KXL_KEY_3KXL_KEY_4
KXL_KEY_5KXL_KEY_6KXL_KEY_7
KXL_KEY_8KXL_KEY_9KXL_KEY_Colon
KXL_KEY_SemicolonKXL_KEY_LessKXL_KEY_Equal
KXL_KEY_GreaterKXL_KEY_QuestionKXL_KEY_At
KXL_KEY_AKXL_KEY_BKXL_KEY_C
KXL_KEY_DKXL_KEY_EKXL_KEY_F
KXL_KEY_GKXL_KEY_HKXL_KEY_I
KXL_KEY_JKXL_KEY_KKXL_KEY_L
KXL_KEY_MKXL_KEY_NKXL_KEY_O
KXL_KEY_PKXL_KEY_QKXL_KEY_R
KXL_KEY_SKXL_KEY_TKXL_KEY_U
KXL_KEY_VKXL_KEY_WKXL_KEY_X
KXL_KEY_YKXL_KEY_ZKXL_KEY_Bracketleft
KXL_KEY_BackslashKXL_KEY_BracketrightKXL_KEY_Asciicircum
KXL_KEY_UnderscoreKXL_KEY_GraveKXL_KEY_Quoteleft
KXL_KEY_aKXL_KEY_bKXL_KEY_c
KXL_KEY_dKXL_KEY_eKXL_KEY_f
KXL_KEY_gKXL_KEY_hKXL_KEY_i
KXL_KEY_jKXL_KEY_kKXL_KEY_l
KXL_KEY_mKXL_KEY_nKXL_KEY_o
KXL_KEY_pKXL_KEY_qKXL_KEY_r
KXL_KEY_sKXL_KEY_tKXL_KEY_u
KXL_KEY_vKXL_KEY_wKXL_KEY_x
KXL_KEY_yKXL_KEY_zKXL_KEY_Braceleft
KXL_KEY_BarKXL_KEY_BracerightKXL_KEY_Asciitilde


Description

It is used by KXL_GetKey. libKXL-1.2.4/docs/vkxlpolygon.html000066400000000000000000000016011412544137700170630ustar00rootroot00000000000000 KXL_Polygon Prev Top Next
Name

KXL_Polygon -- Defines a polygon point.

Structure Definition
typedef struct {
  Sint16 x, y;
} KXL_Polygon;

Structure data
x, yThey are a position or a relative position absolutely.

Description
It is used by KXL_DrawPolygon libKXL-1.2.4/docs/vkxlrect.html000066400000000000000000000031751412544137700163410ustar00rootroot00000000000000 KXL_Rect Prev Top Next
Name

KXL_Rect -- Defines a rectangular area.

Structure Definition
typedef struct {
  Sint16 Left, Top;
  Uint16 Width, Height;
} KXL_Rect;

Structure data
Left, TopPosition of the upper-left corner of the rectangle
Width, HeightThe width and height of the rectangle

Description
It is used by KXL_ReSizeFrame KXL_UpDateRect KXL_UpDate KXL_ClearFrameRect KXL_ClearFrame KXL_CopyImageRect KXL_CopyImage KXL_CopyStretchImageRect KXL_PutImageRect KXL_PutRectImage KXL_PutStretchImageRect KXL_DirectionAdd KXL_RectIntersect libKXL-1.2.4/docs/vkxlsound.html000066400000000000000000000016751412544137700165370ustar00rootroot00000000000000 KXL_SOUND_xxx Prev Top Next
Name

KXL_SOUND_xxx -- Control of a sound.

KXL_SOUND_PLAYplay of a sound.
KXL_SOUND_PLAY_LOOPrepetition play of a sound.
KXL_SOUND_STOPstop of a sound.
KXL_SOUND_STOP_ALLall stop of a sound.


Description

It is used by KXL_PlaySound libKXL-1.2.4/ltconfig000066400000000000000000002677651412544137700144320ustar00rootroot00000000000000#! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi if test "X${echo_test_string+set}" != "Xset"; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.3 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3* | osf4*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec ;then # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux library_names_spec='${libname}.so$major ${libname}.so' soname_spec='${libname}.so' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2170: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2207: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2251: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2288: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2333: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2395: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2433: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # 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=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # 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=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: libKXL-1.2.4/src/000077500000000000000000000000001412544137700134425ustar00rootroot00000000000000libKXL-1.2.4/src/KXL.h000066400000000000000000000330431412544137700142540ustar00rootroot00000000000000#ifndef _KXLIB_H_ #define _KXLIB_H_ #include #include #include //================================================================ // Global structures and variables //================================================================ // Event mask #define KXL_EVENT_NO_MASK 0L #define KXL_EVENT_KEY_PRESS_MASK (1L<<0) #define KXL_EVENT_KEY_RELEASE_MASK (1L<<1) #define KXL_EVENT_BUTTON_PRESS_MASK (1L<<2) #define KXL_EVENT_BUTTON_RELEASE_MASK (1L<<3) #define KXL_EVENT_BUTTON_MOTION_MASK (1L<<13) #define KXL_EVENT_EXPOSURE_MASK (1L<<15) // Event #define KXL_EVENT_KEY_PRESS 2 #define KXL_EVENT_KEY_RELEASE 3 #define KXL_EVENT_BUTTON_PRESS 4 #define KXL_EVENT_BUTTON_RELEASE 5 #define KXL_EVENT_BUTTON_MOTION 6 #define KXL_EVENT_EXPOSE 12 // Key code #define KXL_KEY_BackSpace 0xff08 #define KXL_KEY_Tab 0xff09 #define KXL_KEY_Return 0xff0d #define KXL_KEY_Escape 0xff1b #define KXL_KEY_Delete 0xffff #define KXL_KEY_Home 0xff50 #define KXL_KEY_Left 0xff51 #define KXL_KEY_Up 0xff52 #define KXL_KEY_Right 0xff53 #define KXL_KEY_Down 0xff54 #define KXL_KEY_F1 0xffbe #define KXL_KEY_F2 0xffbf #define KXL_KEY_F3 0xffc0 #define KXL_KEY_F4 0xffc1 #define KXL_KEY_F5 0xffc2 #define KXL_KEY_F6 0xffc3 #define KXL_KEY_F7 0xffc4 #define KXL_KEY_F8 0xffc5 #define KXL_KEY_F9 0xffc6 #define KXL_KEY_F10 0xffc7 #define KXL_KEY_F11 0xffc8 #define KXL_KEY_F12 0xffc9 #define KXL_KEY_Shift_L 0xffe1 #define KXL_KEY_Shift_R 0xffe2 #define KXL_KEY_Control_L 0xffe3 #define KXL_KEY_Control_R 0xffe4 #define KXL_KEY_Space 0x020 // #define KXL_KEY_Exclam 0x021 // ! #define KXL_KEY_Quotedbl 0x022 // " #define KXL_KEY_Numbersign 0x023 // # #define KXL_KEY_Dollar 0x024 // $ #define KXL_KEY_Percent 0x025 // % #define KXL_KEY_Ampersand 0x026 // & #define KXL_KEY_Apostrophe 0x027 // #define KXL_KEY_Quoteright 0x027 // #define KXL_KEY_Parenleft 0x028 // ( #define KXL_KEY_Parenright 0x029 // ) #define KXL_KEY_Asterisk 0x02a // * #define KXL_KEY_Plus 0x02b // + #define KXL_KEY_Comma 0x02c // , #define KXL_KEY_Minus 0x02d // - #define KXL_KEY_Period 0x02e // . #define KXL_KEY_Slash 0x02f // / #define KXL_KEY_0 0x030 #define KXL_KEY_1 0x031 #define KXL_KEY_2 0x032 #define KXL_KEY_3 0x033 #define KXL_KEY_4 0x034 #define KXL_KEY_5 0x035 #define KXL_KEY_6 0x036 #define KXL_KEY_7 0x037 #define KXL_KEY_8 0x038 #define KXL_KEY_9 0x039 #define KXL_KEY_Colon 0x03a // : #define KXL_KEY_Semicolon 0x03b // ; #define KXL_KEY_Less 0x03c // < #define KXL_KEY_Equal 0x03d // = #define KXL_KEY_Greater 0x03e // > #define KXL_KEY_Question 0x03f // ? #define KXL_KEY_At 0x040 // @ #define KXL_KEY_A 0x041 #define KXL_KEY_B 0x042 #define KXL_KEY_C 0x043 #define KXL_KEY_D 0x044 #define KXL_KEY_E 0x045 #define KXL_KEY_F 0x046 #define KXL_KEY_G 0x047 #define KXL_KEY_H 0x048 #define KXL_KEY_I 0x049 #define KXL_KEY_J 0x04a #define KXL_KEY_K 0x04b #define KXL_KEY_L 0x04c #define KXL_KEY_M 0x04d #define KXL_KEY_N 0x04e #define KXL_KEY_O 0x04f #define KXL_KEY_P 0x050 #define KXL_KEY_Q 0x051 #define KXL_KEY_R 0x052 #define KXL_KEY_S 0x053 #define KXL_KEY_T 0x054 #define KXL_KEY_U 0x055 #define KXL_KEY_V 0x056 #define KXL_KEY_W 0x057 #define KXL_KEY_X 0x058 #define KXL_KEY_Y 0x059 #define KXL_KEY_Z 0x05a #define KXL_KEY_Bracketleft 0x05b // " #define KXL_KEY_Backslash 0x05c // '\' #define KXL_KEY_Bracketright 0x05d // # #define KXL_KEY_Asciicircum 0x05e #define KXL_KEY_Underscore 0x05f // _ #define KXL_KEY_Grave 0x060 #define KXL_KEY_Quoteleft 0x060 #define KXL_KEY_a 0x061 #define KXL_KEY_b 0x062 #define KXL_KEY_c 0x063 #define KXL_KEY_d 0x064 #define KXL_KEY_e 0x065 #define KXL_KEY_f 0x066 #define KXL_KEY_g 0x067 #define KXL_KEY_h 0x068 #define KXL_KEY_i 0x069 #define KXL_KEY_j 0x06a #define KXL_KEY_k 0x06b #define KXL_KEY_l 0x06c #define KXL_KEY_m 0x06d #define KXL_KEY_n 0x06e #define KXL_KEY_o 0x06f #define KXL_KEY_p 0x070 #define KXL_KEY_q 0x071 #define KXL_KEY_r 0x072 #define KXL_KEY_s 0x073 #define KXL_KEY_t 0x074 #define KXL_KEY_u 0x075 #define KXL_KEY_v 0x076 #define KXL_KEY_w 0x077 #define KXL_KEY_x 0x078 #define KXL_KEY_y 0x079 #define KXL_KEY_z 0x07a #define KXL_KEY_Braceleft 0x07b #define KXL_KEY_Bar 0x07c #define KXL_KEY_Braceright 0x07d #define KXL_KEY_Asciitilde 0x07e // ~ // Type of variable typedef signed char Sint8; typedef unsigned char Uint8; typedef signed short Sint16; typedef unsigned short Uint16; typedef signed long Sint32; typedef unsigned long Uint32; // Image typedef struct { Pixmap Buffer; // Drawing image Pixmap Mask; // Mask image GC MaskGC; // GC of mask image Uint16 Width; // Drawing width Uint16 Height; // Drawing height } KXL_Image; // Rectangle typedef struct { Sint16 Left; // Left Sint16 Top; // Top Uint16 Width; // Width Uint16 Height; // Height } KXL_Rect; // Polygon typedef XPoint KXL_Polygon; // Sound control typedef enum { KXL_SOUND_PLAY, // Play sound KXL_SOUND_PLAY_LOOP, // Loop play sound KXL_SOUND_STOP, // Stop sound KXL_SOUND_STOP_ALL // Stop all sound } KXL_Command; //================================================================ // Internal structures //================================================================ // Frame typedef struct { Pixmap Buffer; // Buffer GC Gc; // GC Uint16 Width; // Width Uint16 Height; // Height } KXL_Frame; // Window typedef struct { Display *Display; // Pointer of display structure Window Win; // window Uint16 Scr; // Screen number XEvent Event; // Event of X window Uint16 Depth; // Bits per pixel of X window Colormap Cmap; // Color map Uint16 Width; // Width Uint16 Height; // Height KXL_Frame *Frame; // Pointer of frame structure GC FontGC; // GC of font XFontStruct *WinFont; // Pointer of font structrue } KXL_Window; // RGBE palette typedef struct { Uint8 b, g, r, e; // Blue, Green, Red, ? } KXL_RGBE; // Bitmap header typedef struct { Uint8 magic[2]; // Bitmap magic Uint32 file_size; // File size Uint16 reserved1; // Reserved Uint16 reserved2; // Reserved Uint32 offset; // Offset of image Uint32 hed_size; // Header size Uint32 width; // Image width Uint32 height; // Image height Uint16 plane; // Plane Uint16 depth; // Bits per pixel Uint32 lzd; // Compression Uint32 image_size; // Image size Uint32 x_pixels; // Horizon resolution Uint32 y_pixels; // Vertical resolution Uint32 pals; // Palette Uint32 pals2; // Palette KXL_RGBE *rgb; // Palette data Uint32 w; // Bytes per line Uint8 *data; // Image data } KXL_BitmapHeader; //================================================================ // Internal function prototypes //================================================================ void KXL_Up_Date(Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h); void KXL_Clear_Frame(Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h); KXL_Image *KXL_Copy_Image(KXL_Image *src, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h); KXL_Image *KXL_Copy_StretchImage(KXL_Image *src, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Uint16 width, Uint16 height); void KXL_Put_Image(KXL_Image *img, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Sint16 x, Sint16 y); void KXL_Put_StretchImage(KXL_Image *img, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Uint16 w, Uint16 h, Sint16 x, Sint16 y); void KXL_CreateBitmap8to16(Uint8 *from, XImage *to, KXL_RGBE *rgb, Uint8 blend); void KXL_CreateBitmap8to24(Uint8 *from, XImage *to, KXL_RGBE *rgb, Uint8 blend); void KXL_CreateBitmap8to1(Uint8 *from, XImage *to, Uint8 blend); void KXL_ReadBitmapHeader(const char *filename, KXL_BitmapHeader *hed); Uint16 KXL_ReadU16(FILE *fp); Uint32 KXL_ReadU32(FILE *fp); #define KXL_ReadS16 (Sint16)KXL_ReadU16 #define KXL_ReadS32 (Sint32)KXL_ReadU16 //================================================================ // Global function prototypes //================================================================ //================================================================ // Visual function prototypes //================================================================ // Window functions void KXL_DisplayName(const char *name); void KXL_CreateWindow(Uint16 w, Uint16 h, const char *title, Uint32 event); void KXL_DeleteWindow(void); // Frame functions void KXL_ReSizeFrame(Uint16 w, Uint16 h); #define KXL_UpDateRect(rr) KXL_Up_Date(rr.Left, rr.Top, rr.Width, rr.Height) #define KXL_UpDateImm KXL_Up_Date #define KXL_UpDate KXL_UpDateRect // Downward compatibility #define KXL_ClearFrameRect(rr) KXL_Clear_Frame(rr.Left, rr.Top, rr.Width, rr.Height) #define KXL_ClearFrameImm KXL_Clear_Frame #define KXL_ClearFrame KXL_ClearFrameRect // Downward compatibility // Text functions void KXL_Font(const char *str, Uint8 r, Uint8 g, Uint8 b); void KXL_PutText(Sint16 x, Sint16 y, const char *str); Uint16 KXL_TextWidth(const char *str); // Drawing functions void KXL_SetDrawColor(Uint8 r, Uint8 g, Uint8 b); void KXL_DrawPoint(Sint16 left, Sint16 top); void KXL_DrawLine(Sint16 left, Sint16 top, Sint16 right, Sint16 bottom); void KXL_DrawRectangle(Sint16 left, Sint16 top, Uint16 width, Uint16 height, Bool flag); void KXL_DrawPolygon(KXL_Polygon *data, Uint16 max, Bool next, Bool flag); // Image functions KXL_Image *KXL_LoadBitmap(const char *filename, Uint8 blend); #define KXL_CopyImageRect(src, rr) KXL_Copy_Image(src, rr.Left, rr.Top, rr.Width, rr.Height) #define KXL_CopyImageImm KXL_Copy_Image #define KXL_CopyImage KXL_CopyImageRect // Downward compatibility #define KXL_CopyStretchImageRect(src, rr, w, h) KXL_Copy_StretchImage(src, rr.Left, rr.Top, rr.Width, rr.Height, w, h) #define KXL_CopyStretchImageImm KXL_Copy_StretchImage #define KXL_CopyStretchImage(src, w, h) KXL_Copy_StretchImage(src, 0, 0, src->Width, src->Height, w, h) #define KXL_StrechImage KXL_CopyStretchImage // Downward compatibility void KXL_PutImage(KXL_Image *img, Sint16 x, Sint16 y); #define KXL_PutImageRect(src, rr, x, y) KXL_Put_Image(src, rr.Left, rr.Top, rr.Width, rr.Height, x, y) #define KXL_PutImageImm KXL_Put_Image #define KXL_PutRectImage KXL_PutImageRect // Downward compatibility #define KXL_PutStretchImage(src, w, h, x, y) KXL_Put_StretchImage(src, 0, 0, src->Width, src->Height, w, h, x, y) #define KXL_PutStretchImageRect(src, rr, w, h, x, y) KXL_Put_StretchImage(src, rr.Left, rr.Top, rr.Width, rr.Height, w, h, x, y) #define KXL_PutStretchImageImm KXL_Put_StretchImage void KXL_DeleteImage(KXL_Image *img); // Event functions Bool KXL_CheckEvents(void); Uint32 KXL_GetEvents(void); Uint16 KXL_GetKey(void); Uint16 KXL_GetButton(Uint16 *x, Uint16 *y); //================================================================ // Sound function prototypes //================================================================ void KXL_InitSound(const char *path, char **fname); void KXL_EndSound(void); void KXL_PlaySound(Uint16 no, KXL_Command action); //================================================================ // Etc. function prototypes //================================================================ // Timer functions void KXL_Timer(Uint16 time); void KXL_ResetTimer(void); Bool KXL_GetTimer(void); // Memory functions void *KXL_Malloc(Uint32 size); void *KXL_Realloc(void *src, Uint32 size); void KXL_Free(void *src); // Game functions Uint16 KXL_GetDirection(KXL_Rect src, KXL_Rect target); void KXL_GetDirectionAdd(Sint16 , Sint16 *x, Sint16 *y); #define KXL_DirectionAdd(dest, cnt, add) \ cnt += add;\ dest = cnt >> 8 #define KXL_RectIntersect(m, y)\ ((m.Left < y.Left + y.Width - 1 &&\ m.Top < y.Top + y.Height - 1 &&\ y.Left < m.Left + m.Width - 1 &&\ y.Top < m.Top + m.Height - 1)\ ? True : False) #endif libKXL-1.2.4/src/KXLimage.c000066400000000000000000000135371412544137700152600ustar00rootroot00000000000000#include #include // for exit #include "KXL.h" extern KXL_Window *KXL_Root; //============================================================== // 8bppのBMPを16bpp化する // 引き数:8bpsデータ // :16bpsXイメージ // :パレット //============================================================== void KXL_CreateBitmap8to16(Uint8 *from, XImage *to, KXL_RGBE *rgb, Uint8 blend) { Uint32 x, y, offset, no; for (y = 0; y < to->height; y ++) { for (x = 0; x < to->width; x ++) { // オフセット計算 offset = (y * to->bytes_per_line) + (x << 1); no = from[y * to->width + x]; if (no == blend) { // 指定パレット番号を黒にする to->data[offset ++] = 0x00; to->data[offset ++] = 0x00; } else { // 000rrrrr, 000ggggg, 000bbbbb // | // gg0bbbbb, rrrrrggg if (!(rgb[no].r | rgb[no].g | rgb[no].b)) { // 完全な黒を無くす to->data[offset++] = 0x41; to->data[offset++] = 0x08; } else { to->data[offset++] = rgb[no].b | (rgb[no].g << 6); to->data[offset++] = (rgb[no].r << 3) | (rgb[no].g >> 2); } } } } } //============================================================== // 8bppのBMPを24bpp化する // 引き数:8bpsデータ // :24bpsXイメージ // :パレット //============================================================== void KXL_CreateBitmap8to24(Uint8 *from, XImage *to, KXL_RGBE *rgb, Uint8 blend) { Uint32 x, y, offset, no; for (y = 0; y < to->height; y ++) { for (x = 0; x < to->width; x ++) { // オフセット計算 offset = (y * to->bytes_per_line) + ((x * to->bits_per_pixel) >> 3); no = from[y * to->width + x]; if (no == blend) { // 指定パレット番号を黒にする to->data[offset ++] = 0x00; to->data[offset ++] = 0x00; to->data[offset ++] = 0x00; } else { if (!(rgb[no].r | rgb[no].g | rgb[no].b)) { // 完全な黒を無くす to->data[offset ++] = 0x01; to->data[offset ++] = 0x01; to->data[offset ++] = 0x01; } else { to->data[offset ++] = rgb[no].b; to->data[offset ++] = rgb[no].g; to->data[offset ++] = rgb[no].r; } } } } } //============================================================== // 8bppのBMPを1bpp化する // 引き数:8bpsデータ // :1bpsXイメージ //============================================================== void KXL_CreateBitmap8to1(Uint8 *from, XImage *to, Uint8 blend) { Uint16 x, y, offset, no; for (y = 0; y < to->height; y ++) { for (x = 0; x < to->width; x ++) { // オフセット計算 offset = (y * to->bytes_per_line) + (x >> 3); no = from[y * to->width + x]; if (no != blend) to->data[offset] |= 1 << (x & 7); else to->data[offset] &= ~(1 << (x & 7)); } } } //============================================================== // ビットマップヘッダ情報読み込み // 引き数:ファイル名 // :ヘッダ情報のポインタ //============================================================== void KXL_ReadBitmapHeader(const char *filename, KXL_BitmapHeader *hed) { FILE *fp; Uint16 i, j; Uint8 data; // ファイルを読み込み専用で開く if ((fp = fopen(filename,"rb")) == 0) { fprintf(stderr, "KXL error message\n'%s' is open error\n", filename); exit(1); } // ヘッダ読み込み fread(hed->magic, 1, 2, fp); if (hed->magic[0] != 'B' || hed->magic[1] != 'M') { fprintf(stderr, "KXL error message\n'%s' is not bitmap file\n", filename); exit(1); } hed->file_size = KXL_ReadU32(fp); hed->reserved1 = KXL_ReadU16(fp); hed->reserved2 = KXL_ReadU16(fp); hed->offset = KXL_ReadU32(fp); hed->hed_size = KXL_ReadU32(fp); hed->width = KXL_ReadU32(fp); hed->height = KXL_ReadU32(fp); hed->plane = KXL_ReadU16(fp); hed->depth = KXL_ReadU16(fp); // 4 or 8bpp 以外はサポート外 if (hed->depth < 4 || hed->depth > 8) { fprintf(stderr, "KXL error message\n'%s' %dbps not support\n", filename, hed->depth); exit(1); } hed->lzd = KXL_ReadU32(fp); hed->image_size = KXL_ReadU32(fp); // イメージサイズがなければ終了 if (hed->image_size == 0) { fprintf(stderr, "KXL error message\n'%s not found image size\n", filename); exit(1); } hed->x_pixels = KXL_ReadU32(fp); hed->y_pixels = KXL_ReadU32(fp); hed->pals = KXL_ReadU32(fp); hed->pals2 = KXL_ReadU32(fp); // 使用パレット数設定 hed->pals = hed->pals ? hed->pals : (1 << hed->depth); // カラーマップ取得 hed->rgb = (KXL_RGBE *)KXL_Malloc(sizeof(KXL_RGBE) * hed->pals); for (i = 0; i < hed->pals; i ++) { hed->rgb[i].b = fgetc(fp); hed->rgb[i].g = fgetc(fp); hed->rgb[i].r = fgetc(fp); hed->rgb[i].e = fgetc(fp); // Xが16bppなら補正しておく if (KXL_Root->Depth == 16) { hed->rgb[i].b /= 8; hed->rgb[i].g /= 8; hed->rgb[i].r /= 8; } } // 横幅を4の倍数で補正する hed->w = ((hed->width + 3) / 4) * 4; // データ領域確保 if (hed->depth == 8) hed->data = (Uint8 *)KXL_Malloc(hed->image_size); else hed->data = (Uint8 *)KXL_Malloc(hed->image_size * 2); // データを取得する if (hed->depth == 8) { // 8bppのbmpを読み込み格納する for (i = 0; i < hed->height; i++) { // 最終ラインから読み込む fseek(fp, hed->offset + (hed->height - i - 1) * hed->w, 0); fread(&(hed->data[i * hed->w]), hed->w, 1, fp); } } else { Uint32 w = (((hed->width / 2) + 3) / 4) * 4; // 4bppのbmpを読み込み格納する for (i = 0; i < hed->height; i++) { // 最終ラインから読み込む fseek(fp, hed->offset + (hed->height - i - 1) * w, 0); for (j = 0; j < w; j ++) { data = fgetc(fp); hed->data[i * hed->w + j * 2 + 0] = data >> 4; hed->data[i * hed->w + j * 2 + 1] = data & 0x0f; } } } hed->depth = 8; fclose(fp); } libKXL-1.2.4/src/KXLmisc.c000066400000000000000000000145241412544137700151260ustar00rootroot00000000000000#include #include #include #include #include #include "KXL.h" Bool KXL_TimerFlag; // 360度データ static Sint16 sin360[] = { 0, 4, 8, 13, 17, 22, 26, 31, 35, 40, 44, 48, 53, 57, 61, 66, 70, 74, 79, 83, 87, 91, 95, 100, 104, 108, 112, 116, 120, 124, 127, 131, 135, 139, 143, 146, 150, 154, 157, 161, 164, 167, 171, 174, 177, 181, 184, 187, 190, 193, 196, 198, 201, 204, 207, 209, 212, 214, 217, 219, 221, 223, 226, 228, 230, 232, 233, 235, 237, 238, 240, 242, 243, 244, 246, 247, 248, 249, 250, 251, 252, 252, 253, 254, 254, 255, 255, 255, 255, 255, 256, 255, 255, 255, 255, 255, 254, 254, 253, 252, 252, 251, 250, 249, 248, 247, 246, 244, 243, 242, 240, 238, 237, 235, 233, 232, 230, 228, 226, 223, 221, 219, 217, 214, 212, 209, 207, 204, 201, 198, 196, 193, 190, 187, 184, 181, 177, 174, 171, 167, 164, 161, 157, 154, 150, 146, 143, 139, 135, 131, 127, 124, 120, 116, 112, 108, 104, 100, 95, 91, 87, 83, 79, 74, 70, 66, 61, 57, 53, 48, 44, 40, 35, 31, 26, 22, 17, 13, 8, 4, 0, -4, -8, -13, -17, -22, -26, -31, -35, -40, -44, -48, -53, -57, -61, -66, -70, -74, -79, -83, -87, -91, -95, -100, -104, -108, -112, -116, -120, -124, -127, -131, -135, -139, -143, -146, -150, -154, -157, -161, -164, -167, -171, -174, -177, -181, -184, -187, -190, -193, -196, -198, -201, -204, -207, -209, -212, -214, -217, -219, -221, -223, -226, -228, -230, -232, -233, -235, -237, -238, -240, -242, -243, -244, -246, -247, -248, -249, -250, -251, -252, -252, -253, -254, -254, -255, -255, -255, -255, -255, -256, -255, -255, -255, -255, -255, -254, -254, -253, -252, -252, -251, -250, -249, -248, -247, -246, -244, -243, -242, -240, -238, -237, -235, -233, -232, -230, -228, -226, -223, -221, -219, -217, -214, -212, -209, -207, -204, -201, -198, -196, -193, -190, -187, -184, -181, -177, -174, -171, -167, -164, -161, -157, -154, -150, -146, -143, -139, -135, -131, -128, -124, -120, -116, -112, -108, -104, -100, -95, -91, -87, -83, -79, -74, -70, -66, -61, -57, -53, -48, -44, -40, -35, -31, -26, -22, -17, -13, -8, -4, 0, }; //============================================================== // タイマーフラグ取得 //============================================================== Bool KXL_GetTimer(void) { return KXL_TimerFlag; } //============================================================== // タイマーフラグリセット //============================================================== void KXL_ResetTimer(void) { KXL_TimerFlag = False; } //============================================================== // タイマーコールバック //============================================================== void KXL_TimerCallBack(int dummy) { KXL_TimerFlag = True; } //============================================================== // タイマー設定 // 引き数:フレーム数 //============================================================== void KXL_Timer(Uint16 time) { struct itimerval val={ {0, 1000000 / time}, {0, 1000000 / time}, }; signal(SIGALRM, KXL_TimerCallBack); setitimer(ITIMER_REAL, &val, NULL); KXL_TimerFlag = False; } //============================================================== // メモリ確保 // 引き数:メモリサイズ // 戻り値:確保したメモリのポインタ //============================================================== void *KXL_Malloc(Uint32 size) { void *new; new = malloc(size); if (new == NULL) { fprintf(stderr, "KXL error message\nOut Of memory!!\n"); exit(1); } return new; } //============================================================== // メモリ再確保 // 引き数:メモリのポインタ // :メモリサイズ // 戻り値:再確保したメモリのポインタ //============================================================== void *KXL_Realloc(void *src, Uint32 size) { void *new; new = realloc(src, size); if (new == NULL) { fprintf(stderr, "KXL error message\nOut Of memory!!\n"); exit(1); } return new; } //============================================================== // メモリ解放 // 引き数:メモリのポインタ //============================================================== void KXL_Free(void *src) { free(src); } //============================================================== // 方角取得 // 引き数:自分の矩形 // :相手の矩形 //============================================================== Uint16 KXL_GetDirection(KXL_Rect src, KXL_Rect target) { Uint16 k, x, y; Uint16 mx, my, yx, yy; mx = src.Left + (src.Width >> 1); my = src.Top + (src.Height >> 1); yx = target.Left + (target.Width >> 1); yy = target.Top + (target.Height >> 1); x = abs(yx - mx); y = abs(yy - my); if (yx == mx) k = (yy > my) ? 0 : 180; else if (yy == my) k = (yx > mx) ? 90 : 270; else if (yx > mx) if (yy > my) k = 90 * x / (x + y); else k = 180 - (90 * x / (x + y)); else if (yy > my) k = 360 - (90 * x / (x + y)); else k = (90 * x / (x + y)) + 180; return k; } //============================================================== // 角度による加算値設定 // 引き数:角度 // :水平加算値のポインタ // :垂直加算値のポインタ //============================================================== void KXL_GetDirectionAdd(Sint16 dir, Sint16 *x, Sint16 *y) { Sint16 dir2 = dir + 90; while (dir < 0) dir += 360; while (dir > 360) dir -= 360; *x = sin360[dir]; while (dir2 < 0) dir2 += 360; while (dir2 > 360) dir2 -= 360; *y = sin360[dir2]; } //============================================================== // 16リトルビットエンディアン読み込み // 引き数:ファイルポインタ // 戻り値:16ビット値 //============================================================== Uint16 KXL_ReadU16(FILE *fp) { Uint8 c[2]; fread(c, 1, 2, fp); return (Uint16)(c[0] + c[1] * 0x100); } //============================================================== // 32ビットリトルエンディアン読み込み // 引き数:ファイルポインタ // 戻り値:32ビット値 //============================================================== Uint32 KXL_ReadU32(FILE *fp) { Uint8 c[4]; fread(c, 1, 4, fp); return (Uint32)(c[0] + c[1] * 0x100L + c[2] * 0x10000L + c[3] * 0x1000000L); } libKXL-1.2.4/src/KXLsound.c000066400000000000000000000253211412544137700153200ustar00rootroot00000000000000#include // for exit #include // for memset, memcpy #include // for pipe, close #include #include #include #include #include #include #ifdef USE_PULSEAUDIO #include #include #endif #include "KXL.h" #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX_SOUNDS_PLAYING 16 #define SND_BLOCK_SIZE 4096 typedef struct { Bool Active; // active KXL_Command Action; // command Uint16 No; // number Uint8 *Pos; // position Uint32 Cnt; // count Uint32 Length; // length } KXL_SoundControl; struct { Uint16 ListCnt; Sint32 ID; #ifdef USE_PULSEAUDIO int Pipe[2]; pa_simple *Device; #else Sint32 Pipe[2]; Sint32 Device; #endif Uint16 PlayCnt; KXL_SoundControl PlaySound[MAX_SOUNDS_PLAYING]; Sint8 FBuff[SND_BLOCK_SIZE]; Sint32 LBuff[SND_BLOCK_SIZE]; Uint8 PBuff[SND_BLOCK_SIZE]; } KXL_SoundData; typedef struct { Uint8 *Data; Uint32 Length; } KXL_WaveList; KXL_WaveList *KXL_wavelist; Bool KXL_SoundOk; //============================================================== // サウンドサーバー //============================================================== void KXL_SoundServer(void) { Uint16 i; KXL_SoundControl Command; fd_set sound_fdset; Sint32 sample_size; Sint32 max_sample_size = 4096; Sint32 fragment_size = 4096; Sint32 arg; Uint8 *sample_ptr; // command initialize for (i = 0; i < MAX_SOUNDS_PLAYING; i ++) KXL_SoundData.PlaySound[i].Active = False; KXL_SoundData.PlayCnt = 0; // receive data clear FD_ZERO(&sound_fdset); FD_SET(KXL_SoundData.Pipe[0], &sound_fdset); // loop while (1) { FD_SET(KXL_SoundData.Pipe[0], &sound_fdset); select(KXL_SoundData.Pipe[0] + 1, &sound_fdset, NULL, NULL, NULL); if (!FD_ISSET(KXL_SoundData.Pipe[0], &sound_fdset)) continue; if (read(KXL_SoundData.Pipe[0], &Command,sizeof(Command)) != sizeof(Command)) exit(-1); if (Command.Action == KXL_SOUND_STOP_ALL) { // all stop if (!KXL_SoundData.PlayCnt) continue; for (i = 0; i < MAX_SOUNDS_PLAYING; i ++) KXL_SoundData.PlaySound[i].Active = False; KXL_SoundData.PlayCnt = 0; continue; } else if (Command.Action == KXL_SOUND_STOP) { // no. stop if (!KXL_SoundData.PlayCnt) continue; for (i = 0; i < MAX_SOUNDS_PLAYING; i ++) if (KXL_SoundData.PlaySound[i].No == Command.No) { KXL_SoundData.PlaySound[i].Active = False; KXL_SoundData.PlayCnt --; } continue; } if (KXL_SoundData.PlayCnt || Command.Active == True) { struct timeval delay = {0, 0}; #ifndef USE_PULSEAUDIO if (!KXL_SoundData.PlayCnt) { // set fragment arg = 0x00020009; if (ioctl(KXL_SoundData.Device, SNDCTL_DSP_SETFRAGMENT, &arg) >= 0) { // set format arg = AFMT_U8; if (ioctl(KXL_SoundData.Device, SNDCTL_DSP_SETFMT, &arg) >= 0) { // set monaural arg = 0; if (ioctl(KXL_SoundData.Device, SNDCTL_DSP_STEREO, &arg) >= 0) { // set sampling rate arg = 8000; if (ioctl(KXL_SoundData.Device, SNDCTL_DSP_SPEED, &arg) >= 0) { // get block size if (ioctl(KXL_SoundData.Device, SNDCTL_DSP_GETBLKSIZE, &fragment_size) >= 0) { max_sample_size = fragment_size; } } } } } } #endif if (Command.Active == True && KXL_SoundData.PlayCnt < MAX_SOUNDS_PLAYING) { for (i = 0; i < MAX_SOUNDS_PLAYING; i ++) { if (KXL_SoundData.PlaySound[i].Active == False) { KXL_SoundData.PlaySound[i] = Command; KXL_SoundData.PlayCnt ++; break; } } } while (KXL_SoundData.PlayCnt && select(KXL_SoundData.Pipe[0]+1, &sound_fdset, NULL, NULL, &delay) < 1) { FD_SET(KXL_SoundData.Pipe[0], &sound_fdset); memset(KXL_SoundData.LBuff, 0, fragment_size * sizeof(Sint32)); for (i = 0; i < MAX_SOUNDS_PLAYING; i ++) { Uint16 j; if (KXL_SoundData.PlaySound[i].Active == False) continue; sample_ptr = KXL_SoundData.PlaySound[i].Pos+KXL_SoundData.PlaySound[i].Cnt; sample_size = MIN(max_sample_size, KXL_SoundData.PlaySound[i].Length - KXL_SoundData.PlaySound[i].Cnt); KXL_SoundData.PlaySound[i].Cnt += sample_size; memcpy(KXL_SoundData.FBuff, sample_ptr, sample_size); if (KXL_SoundData.PlaySound[i].Action == KXL_SOUND_PLAY_LOOP && sample_size < max_sample_size) { KXL_SoundData.PlaySound[i].Cnt = max_sample_size - sample_size; memcpy(KXL_SoundData.FBuff + sample_size, KXL_SoundData.PlaySound[i].Pos, max_sample_size - sample_size); sample_size = max_sample_size; } for (j = 0; j < sample_size; j ++) KXL_SoundData.LBuff[j] += (Sint32)KXL_SoundData.FBuff[j]; if (KXL_SoundData.PlaySound[i].Cnt >= KXL_SoundData.PlaySound[i].Length) { if (KXL_SoundData.PlaySound[i].Action == KXL_SOUND_PLAY_LOOP) KXL_SoundData.PlaySound[i].Cnt = 0; else { KXL_SoundData.PlaySound[i].Active = False; KXL_SoundData.PlayCnt --; } } } for (i = 0; i < fragment_size; i ++) { if (KXL_SoundData.LBuff[i] < -255) KXL_SoundData.PBuff[i] = 0; else if (KXL_SoundData.LBuff[i] > 255) KXL_SoundData.PBuff[i] = 255; else KXL_SoundData.PBuff[i] = (KXL_SoundData.LBuff[i] >> 1) ^0x80; } #ifdef USE_PULSEAUDIO int error = 0; pa_simple_write(KXL_SoundData.Device, KXL_SoundData.PBuff, fragment_size, &error); if (error) fprintf(stderr, "KXL error message\nfailed to write sound data: %s\n", pa_strerror(error)); pa_simple_drain(KXL_SoundData.Device, &error); if (error) fprintf(stderr, "KXL error message\nFailed to drain sound data: %s\n", pa_strerror(error)); #else write(KXL_SoundData.Device, KXL_SoundData.PBuff, fragment_size); #endif } } } } //============================================================== // サウンド再生 // 引き数:サウンド番号 // :コマンド //============================================================== void KXL_PlaySound(Uint16 no, KXL_Command action) { KXL_SoundControl SendCommand; if (KXL_SoundOk == False) return; memset(&SendCommand, 0, sizeof(SendCommand)); SendCommand.Active = True; SendCommand.Action = action; SendCommand.No = no; SendCommand.Cnt = 0; if (action == KXL_SOUND_STOP_ALL) { SendCommand.Pos = 0; SendCommand.Length = 0; } else { SendCommand.Pos = KXL_wavelist[no].Data; SendCommand.Length = KXL_wavelist[no].Length; } write(KXL_SoundData.Pipe[1], &SendCommand, sizeof(SendCommand)); } //============================================================== // サウンドファイル読み込み // 引き数:ディレクトリ // :ファイル名 //============================================================== KXL_WaveList KXL_LoadSound(const char *path, const char *fname) { KXL_WaveList new; char filename[256]; Uint32 length; FILE *file; Uint32 i; Uint8 dummy[40]; sprintf(filename,"%s/%s.wav", path, fname); if ((file = fopen(filename,"r")) == NULL) { fprintf(stderr, "KXL error message\nKXL_LoadSound : '%s/%s.wav' open error\n", path, fname); new.Data = 0; return new; } fread(dummy, sizeof(Uint8), 40, file); new.Length = KXL_ReadU32(file); new.Data = (Uint8 *)KXL_Malloc(new.Length); fread(new.Data, sizeof(Uint8), new.Length, file); fclose(file); for (i = 0; i < new.Length; i ++) new.Data[i] ^= 0x80; return new; } //============================================================== // サウンドファイル読み込み // 引き数:ディレクトリ // :ファイル名リスト //============================================================== void KXL_LoadSoundData(const char *path, char **fname) { Uint16 i, max = 0; while (fname[max][0]) max ++; KXL_wavelist = (KXL_WaveList *)KXL_Malloc(sizeof(KXL_WaveList ) * max); for (i = 0; i < max; i ++) KXL_wavelist[i] = KXL_LoadSound(path, fname[i]); KXL_SoundData.ListCnt = max; } //============================================================== // サウンドサーバー初期化 // 引き数:ディレクトリ // :ファイル名リスト //============================================================== void KXL_InitSound(const char *path, char **fname) { KXL_SoundOk = False; KXL_LoadSoundData(path, fname); #ifndef USE_PULSEAUDIO // device check if ((KXL_SoundData.Device = open("/dev/dsp", O_WRONLY)) == -1) { fprintf(stderr, "KXL error message\nnot found sound card\n"); return; } #endif // create pipe if (pipe(KXL_SoundData.Pipe) < 0) { fprintf(stderr, "KXL error message\npipe error\n"); return; } // create child process if ((KXL_SoundData.ID = fork()) < 0) { fprintf(stderr, "KXL error message\nfork error\n"); return; } if (!KXL_SoundData.ID) { // child close(KXL_SoundData.Pipe[1]); #ifdef USE_PULSEAUDIO pa_sample_spec ss; ss.format = PA_SAMPLE_U8, ss.channels = 1; ss.rate = 8000; int error = 0; // device check KXL_SoundData.Device = pa_simple_new(NULL, "Geki2", PA_STREAM_PLAYBACK, NULL, "Music", &ss, NULL, NULL, &error ); if (!KXL_SoundData.Device || error) { fprintf(stderr, "KXL error message\nnot found sound card\n"); return; } #endif KXL_SoundServer(); exit(-1); } else { // parents close(KXL_SoundData.Pipe[0]); KXL_SoundOk = True; } } //============================================================== // サウンドサーバー終了 //============================================================== void KXL_EndSound(void) { while (KXL_SoundData.ListCnt) KXL_Free(KXL_wavelist[-- KXL_SoundData.ListCnt].Data); KXL_Free(KXL_wavelist); #ifdef USE_PULSEAUDIO if (KXL_SoundData.Device) pa_simple_free(KXL_SoundData.Device); #else if (KXL_SoundData.Device != -1) close(KXL_SoundData.Device); #endif if (KXL_SoundOk == True) { KXL_PlaySound(0, KXL_SOUND_STOP_ALL); kill(KXL_SoundData.ID, SIGTERM); } } libKXL-1.2.4/src/KXLvisual.c000066400000000000000000000572141412544137700155010ustar00rootroot00000000000000#include // for exit #include // for strlen #include #include "KXL.h" //================================================================ // Internal variables and functions //================================================================ KXL_Window *KXL_Root; char KXL_DName[1024] = ""; //============================================================== // Set GC from pixmap // arguments:Pixmap // :Pointer of GC //============================================================== void KXL_SetGC(Pixmap p, GC *gc) { *gc = XCreateGC(KXL_Root->Display, p, 0, 0); XSetGraphicsExposures(KXL_Root->Display, *gc, False); } //============================================================== // Update to window // arguments : Frame left // : Frame top // : Frame width // : Frame height //============================================================== void KXL_Up_Date(Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h) { XCopyArea(KXL_Root->Display, // from frame KXL_Root->Frame->Buffer, // to window KXL_Root->Win, // gc KXL_Root->Frame->Gc, // from frame rectangle src_l, src_t, src_w, src_h, // to window position 0, 0); //XFlush(KXL_Root->Display); XSync(KXL_Root->Display, False); } //============================================================== // Clear to frame // arguments : Frame left // : Frame top // : Frame width // : Frame height //============================================================== void KXL_Clear_Frame(Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h) { XFillRectangle(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, src_l, src_t, src_w, src_h); } //============================================================== // Copy from source image to new image // arguments : Pointer of source image // : Source image left // : Source image top // : Source image width // : Source image height // Return value : Pointer of new image //============================================================== KXL_Image *KXL_Copy_Image(KXL_Image *src, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h) { GC gc8, gc1; KXL_Image *dest; // GC作成 KXL_SetGC(src->Buffer, &gc8); KXL_SetGC(src->Mask, &gc1); // イメージにコピー dest = (KXL_Image *)KXL_Malloc(sizeof(KXL_Image)); dest->Width = src_w; dest->Height = src_h; dest->Buffer = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, src_w, src_h, KXL_Root->Depth); XCopyArea(KXL_Root->Display, src->Buffer, dest->Buffer, gc8, src_l, src_t, src_w, src_h, 0, 0); dest->Mask = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, src_w, src_h, 1); XCopyArea(KXL_Root->Display, src->Mask, dest->Mask, gc1, src_l, src_t, src_w, src_h, 0, 0); // クリップマスク作成 dest->MaskGC = XCreateGC(KXL_Root->Display, KXL_Root->Frame->Buffer, 0, 0); XSetClipMask(KXL_Root->Display, dest->MaskGC, dest->Mask); // ローカル変数解放 XFreeGC(KXL_Root->Display, gc8); XFreeGC(KXL_Root->Display, gc1); return dest; } //============================================================== // Stretch copy from source image to new image // arguments : Pointer of source image // : Source image left // : Source image top // : Source image width // : Source image height // : New image width // : New image height // Return value : Pointer of new image //============================================================== KXL_Image *KXL_Copy_StretchImage(KXL_Image *src, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Uint16 width, Uint16 height) { GC gc8, gc1; KXL_Image *dest, *tmp; Uint32 ax = ((float)src_w / (float)width) * 1000; Uint32 ay = ((float)src_h / (float)height) * 1000; Uint32 i, p, pp; Uint16 ww = src->Width < width ? width : src->Width; Uint16 w2, h2; // GC作成 KXL_SetGC(src->Buffer, &gc8); KXL_SetGC(src->Mask, &gc1); // 横の拡縮用イメージ作成 tmp = (KXL_Image *)KXL_Malloc(sizeof(KXL_Image)); tmp->Buffer = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, ww, src_h, KXL_Root->Depth); tmp->Mask = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, ww, src_h, 1); w2 = width / 2; h2 = height / 2; // 横の拡縮 for (i = 0, p = 0; i <= w2; i ++, p += ax) { pp = p / 1000; // From left to center // image XCopyArea(KXL_Root->Display, src->Buffer, tmp->Buffer, gc8, src_l + pp, src_t, 1, src_h, i, 0); // mask image XCopyArea(KXL_Root->Display, src->Mask, tmp->Mask, gc1, src_l + pp, src_t, 1, src_h, i, 0); // From right to center // image XCopyArea(KXL_Root->Display, src->Buffer, tmp->Buffer, gc8, src_l + src_w - 1 - pp, src_t, 1, src_h, width - 1 - i, 0); // mask image XCopyArea(KXL_Root->Display, src->Mask, tmp->Mask, gc1, src_l + src_w - 1 - pp, src_t, 1, src_h, width - 1 - i, 0); } // 拡縮後のイメージ作成 dest = (KXL_Image *)KXL_Malloc(sizeof(KXL_Image)); dest->Width = width; dest->Height = height; dest->Buffer = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, width, height, KXL_Root->Depth); dest->Mask = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, width, height, 1); // 縦の拡縮 for (i = 0, p = 0; i <= h2; i ++, p += ay) { pp = p / 1000; // From up to center // image XCopyArea(KXL_Root->Display, tmp->Buffer, dest->Buffer, gc8, 0, pp, width, 1, 0, i); // mask image XCopyArea(KXL_Root->Display, tmp->Mask, dest->Mask, gc1, 0, pp, width, 1, 0, i); // From bottom to center // image XCopyArea(KXL_Root->Display, tmp->Buffer, dest->Buffer, gc8, 0, src_h - 1 - pp, width, 1, 0, height - 1 - i); // mask image XCopyArea(KXL_Root->Display, tmp->Mask, dest->Mask, gc1, 0, src_h - 1 - pp, width, 1, 0, height - 1 - i); } // Create clip mask GC dest->MaskGC = XCreateGC(KXL_Root->Display, KXL_Root->Frame->Buffer, 0, 0); XSetClipMask(KXL_Root->Display, dest->MaskGC, dest->Mask); // ローカル変数解放 XFreeGC(KXL_Root->Display, gc8); XFreeGC(KXL_Root->Display, gc1); XFreePixmap(KXL_Root->Display, tmp->Buffer); XFreePixmap(KXL_Root->Display, tmp->Mask); KXL_Free(tmp); return dest; } //============================================================== // Put rectangle image // arguments : Pointer of source image // : Source image left // : Source image top // : Source image width // : Source image height // : Put left position // : Put top position //============================================================== void KXL_Put_Image(KXL_Image *img, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Sint16 x, Sint16 y) { KXL_Image *dest = KXL_Copy_Image(img, src_l, src_t, src_w, src_h); XSetClipOrigin(KXL_Root->Display, dest->MaskGC, x, y); XCopyArea(KXL_Root->Display, // from image dest->Buffer, // to frame KXL_Root->Frame->Buffer, // gc dest->MaskGC, // from image rectangle 0, 0, src_w, src_h, // to frame position x, y); KXL_DeleteImage(dest); } //============================================================== // Put rectangle stretch image // arguments : Pointer of source image // : Source image left // : Source image top // : Source image width // : Source image height // : Put image width // : Put image height // : Put left position // : Put top position //============================================================== void KXL_Put_StretchImage(KXL_Image *img, Uint16 src_l, Uint16 src_t, Uint16 src_w, Uint16 src_h, Uint16 width, Uint16 height, Sint16 x, Sint16 y) { KXL_Image *dest = KXL_Copy_StretchImage(img, src_l, src_t, src_w, src_h, width, height); XSetClipOrigin(KXL_Root->Display, dest->MaskGC, x, y); XCopyArea(KXL_Root->Display, // from image dest->Buffer, // to frame KXL_Root->Frame->Buffer, // gc dest->MaskGC, // from image rectangle 0, 0, width, height, // to frame position x, y); KXL_DeleteImage(dest); } //================================================================ // Globall functions //================================================================ //============================================================== // Set name of display // arguments : Name of display //============================================================== void KXL_DisplayName(const char *name) { sprintf(KXL_DName, "%s", name); } //============================================================== // Create window // arguments : width // : height // : title string // : Event of X //============================================================== void KXL_CreateWindow(Uint16 w, Uint16 h, const char *title, Uint32 event) { XSizeHints sh; // ウィンドウ用の領域を確保する KXL_Root = (KXL_Window *)KXL_Malloc(sizeof(KXL_Window)); KXL_Root->Display = NULL; KXL_Root->Frame = NULL; KXL_Root->WinFont = NULL; KXL_Root->FontGC = NULL; // Connect to X server if (!(KXL_Root->Display = XOpenDisplay(KXL_DName))) { fprintf(stderr, "KXL error message\nCannot open display\n"); exit(1); } // Get screen no. KXL_Root->Scr = DefaultScreen(KXL_Root->Display); // Get color map KXL_Root->Cmap = DefaultColormap(KXL_Root->Display, KXL_Root->Scr); // get bpp(bits per pixel) KXL_Root->Depth = DefaultDepth(KXL_Root->Display, KXL_Root->Scr); // Support by 16, 24, 32 if (KXL_Root->Depth < 16) { fprintf(stderr, "KXL error message\n" "%dbpp:%dbpp color not support.\n" "Please 16 or 24 or 32bpp color", KXL_Root->Depth, KXL_Root->Depth); exit(1); } // Create window KXL_Root->Win = XCreateSimpleWindow(KXL_Root->Display, RootWindow(KXL_Root->Display, 0), 0, 0, w, h, 0, WhitePixel(KXL_Root->Display, KXL_Root->Scr), BlackPixel(KXL_Root->Display, KXL_Root->Scr) ); KXL_Root->Width = w; KXL_Root->Height = h; // Set color map XSetWindowColormap(KXL_Root->Display, KXL_Root->Win, KXL_Root->Cmap); // Set event XSelectInput(KXL_Root->Display, KXL_Root->Win, event); // Set title bar XStoreName(KXL_Root->Display, KXL_Root->Win, title); // Set window hint sh.flags = PMaxSize | PMinSize; sh.min_width = w; sh.min_height = h; sh.max_width = w; sh.max_height = h; XSetWMNormalHints(KXL_Root->Display, KXL_Root->Win, &sh); // Load font KXL_Font("-adobe-courier-bold-r-normal--14-*-*-*-*-*-iso8859-1", 0xff, 0xff, 0xff); // Mapping window XMapWindow(KXL_Root->Display, KXL_Root->Win); XFlush(KXL_Root->Display); // Create frame KXL_Root->Frame = 0; KXL_ReSizeFrame(w, h); KXL_Clear_Frame(0, 0, w, h); // Auto repeat off XAutoRepeatOff(KXL_Root->Display); } //============================================================== // Delete window //============================================================== void KXL_DeleteWindow(void) { // Delete frame XFreePixmap(KXL_Root->Display, KXL_Root->Frame->Buffer); XFreeGC(KXL_Root->Display, KXL_Root->Frame->Gc); KXL_Free(KXL_Root->Frame); // Auto repeat on XAutoRepeatOn(KXL_Root->Display); // Delete font XFreeFont(KXL_Root->Display, KXL_Root->WinFont); XFreeGC(KXL_Root->Display, KXL_Root->FontGC); // Delete window XDestroyWindow(KXL_Root->Display, KXL_Root->Win); // Cutting X server XCloseDisplay(KXL_Root->Display); KXL_Free(KXL_Root); } //============================================================== // Resize frame // arguments : new frame width // : new frame height //============================================================== void KXL_ReSizeFrame(Uint16 w, Uint16 h) { if (KXL_Root->Frame) { // 既存のフレーム削除 XFreePixmap(KXL_Root->Display, KXL_Root->Frame->Buffer); XFreeGC(KXL_Root->Display, KXL_Root->Frame->Gc); KXL_Free(KXL_Root->Frame); } KXL_Root->Frame = (KXL_Frame *)KXL_Malloc(sizeof(KXL_Frame)); KXL_Root->Frame->Buffer = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, w, h, KXL_Root->Depth); KXL_Root->Frame->Gc = XCreateGC(KXL_Root->Display, KXL_Root->Frame->Buffer, 0, 0); KXL_Root->Frame->Width = w; KXL_Root->Frame->Height = h; } //============================================================== // set font name and color // arguments : Null or Name of font // : red // : green // : blue //============================================================== void KXL_Font(const char *str, Uint8 r, Uint8 g, Uint8 b) { Uint32 rgb; if (KXL_Root->Depth == 16) rgb = ((r / 8) << 12) | ((g / 8) << 6) | (b / 8); else // 24 or 32 rgb = (r << 16) | (g << 8) | b; if (str) { if (KXL_Root->WinFont) { XFreeFont(KXL_Root->Display, KXL_Root->WinFont); } if (!KXL_Root->FontGC) { KXL_Root->FontGC = XCreateGC(KXL_Root->Display, KXL_Root->Win, 0, 0); } KXL_Root->WinFont = XLoadQueryFont(KXL_Root->Display, str); if (KXL_Root->WinFont == (XFontStruct *)NULL) { fprintf(stderr, "KXL error message\n" "loading font error (%s)\n", str); exit(-1); } XSetFont(KXL_Root->Display, KXL_Root->FontGC, KXL_Root->WinFont->fid); XSetGraphicsExposures(KXL_Root->Display, KXL_Root->FontGC, False); } XSetForeground(KXL_Root->Display, KXL_Root->FontGC, rgb); } //============================================================== // Put text string // arguments : Put left position // : Put top position // : Put text string //============================================================== void KXL_PutText(Sint16 x, Sint16 y, const char *str) { XDrawString(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->FontGC, x, y, str, strlen(str)); } //============================================================== // Get text width // arguments : Text string // Return value : Text width //============================================================== Uint16 KXL_TextWidth(const char *str) { return XTextWidth(KXL_Root->WinFont, str, strlen(str)); } //============================================================== // Set drawing color // arguments : red // : green // : blue //============================================================== void KXL_SetDrawColor(Uint8 r, Uint8 g, Uint8 b) { Uint32 rgb; if (KXL_Root->Depth == 16) rgb = ((r / 8) << 12) | ((g / 8) << 6) | (b / 8); else // 24 or 32 rgb = (r << 16) | (g << 8) | b; XSetForeground(KXL_Root->Display, KXL_Root->Frame->Gc, rgb); } //============================================================== // Drawing point // arguments : left // : top //============================================================== void KXL_DrawPoint(Sint16 left, Sint16 top) { XDrawPoint(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, left, top); } //============================================================== // Drawing line // arguments : left // : top // : right // : bottom //============================================================== void KXL_DrawLine(Sint16 left, Sint16 top, Sint16 right, Sint16 bottom) { XDrawLine(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, left, top, right, bottom); } //============================================================== // Drawing rectangle // arguments : left // : top // : width // : height // : True = fill、False = not fill //============================================================== void KXL_DrawRectangle(Sint16 left, Sint16 top, Uint16 width, Uint16 height, Bool flag) { if (flag == False) // not fill XDrawRectangle(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, left, top, width, height); else // fill XFillRectangle(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, left, top, width, height); } //============================================================== // Drawing polygon // arguments : Pointer of KXLPolygon // : Max-number // : True = Absolute position, False = Relative position // : True = fill, False = not fill //============================================================== void KXL_DrawPolygon(KXL_Polygon *data, Uint16 max, Bool next, Bool flag) { if (flag == False) XDrawLines(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, data, max, next == True ? CoordModeOrigin : CoordModePrevious); else XFillPolygon(KXL_Root->Display, KXL_Root->Frame->Buffer, KXL_Root->Frame->Gc, data, max, Convex, next == True ? CoordModeOrigin : CoordModePrevious); } //============================================================== // Load bitmap file of 8bits per pixel // arguments : File name // Return value : Pointer of new image //============================================================== KXL_Image *KXL_LoadBitmap(const char *filename, Uint8 blend) { // ヘッダ情報用構造体 KXL_BitmapHeader hed; Uint32 i, j, k, l, no; KXL_Image *new; XImage *img; GC gc8, gc1; Visual *v = DefaultVisual(KXL_Root->Display, KXL_Root->Scr); // ビットマップヘッダ読込み KXL_ReadBitmapHeader(filename, &hed); // イメージサイズ設定 new = (KXL_Image *)KXL_Malloc(sizeof(KXL_Image)); new->Width = hed.w; new->Height = hed.height; // 8bpsのビットマップを24 or 16bpp化する img = XCreateImage(KXL_Root->Display, v, KXL_Root->Depth, ZPixmap, 0, 0, new->Width, new->Height, BitmapPad(KXL_Root->Display), 0); img->data = KXL_Malloc(img->bytes_per_line * new->Height); if (KXL_Root->Depth == 16) KXL_CreateBitmap8to16(hed.data, img, hed.rgb, blend); else // 24 or 32 KXL_CreateBitmap8to24(hed.data, img, hed.rgb, blend); // イメージをピックスマップにコピーする new->Buffer = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, new->Width, new->Height, KXL_Root->Depth); KXL_SetGC(new->Buffer, &gc8); XPutImage(KXL_Root->Display, new->Buffer, // to gc8, img, // from 0, 0, // to 0, 0, new->Width, new->Height); // from XDestroyImage(img); // 8bpsのビットマップを1bps化する img = XCreateImage(KXL_Root->Display, v, 1, XYPixmap, 0, 0, new->Width, new->Height, BitmapPad(KXL_Root->Display), 0); img->data = KXL_Malloc(img->bytes_per_line * new->Height); memset(img->data, 0, img->bytes_per_line * new->Height); KXL_CreateBitmap8to1(hed.data, img, blend); // マスクイメージをピックスマップにコピーする new->Mask = XCreatePixmap(KXL_Root->Display, KXL_Root->Win, new->Width, new->Height, 1); KXL_SetGC(new->Mask, &gc1); XPutImage(KXL_Root->Display, new->Mask, // to gc1, img, // from 0, 0, // to 0, 0, new->Width, new->Height); // from XDestroyImage(img); // クリップマスク作成 new->MaskGC = XCreateGC(KXL_Root->Display, KXL_Root->Frame->Buffer, 0, 0); XSetClipMask(KXL_Root->Display, new->MaskGC, new->Mask); // 作業用メモリを解放する XFreeGC(KXL_Root->Display, gc8); XFreeGC(KXL_Root->Display, gc1); KXL_Free(hed.rgb); KXL_Free(hed.data); return new; } //============================================================== // Put image // Arguments : Pointer of source image // : Put left position // : Put top position //============================================================== void KXL_PutImage(KXL_Image *img, Sint16 x, Sint16 y) { XSetClipOrigin(KXL_Root->Display, img->MaskGC, x, y); XCopyArea(KXL_Root->Display, // from image img->Buffer, // to frame KXL_Root->Frame->Buffer, // gc img->MaskGC, // from image rectangle 0, 0, img->Width, img->Height, // to frame position x, y); } //============================================================== // Delete image // Arguments : Pointer of source image //============================================================== void KXL_DeleteImage(KXL_Image *img) { XFreePixmap(KXL_Root->Display, img->Buffer); XFreePixmap(KXL_Root->Display, img->Mask); XFreeGC(KXL_Root->Display, img->MaskGC); KXL_Free(img); } //============================================================== // Check event of window // Return value : True - Outbreak, False - Nothing //============================================================== Bool KXL_CheckEvents(void) { return XCheckMaskEvent(KXL_Root->Display, ~0, &(KXL_Root->Event)); } //============================================================== // Get event number of window // Return value : Event number //============================================================== Uint32 KXL_GetEvents(void) { return KXL_Root->Event.type; } //============================================================== // Get key code // Return value : Key code //============================================================== Uint16 KXL_GetKey(void) { return XLookupKeysym(&(KXL_Root->Event.xkey), 0); } //============================================================== // Get mouse button information // Arguments : Left position // : Top position // Return value : Button number //============================================================== Uint16 KXL_GetButton(Uint16 *x, Uint16 *y) { *x = KXL_Root->Event.xbutton.x; *y = KXL_Root->Event.xbutton.y; return KXL_Root->Event.type == KXL_EVENT_BUTTON_MOTION ? 0 : KXL_Root->Event.xbutton.button; } libKXL-1.2.4/src/Makefile.am000066400000000000000000000003171412544137700154770ustar00rootroot00000000000000lib_LTLIBRARIES = libKXL.la libKXL_la_SOURCES = KXLmisc.c KXLsound.c KXLvisual.c KXLimage.c include_HEADERS = KXL.h libKXL_la_CFLAGS = -DUSE_PULSEAUDIO libKXL_la_LDFLAGS = -lpulse-simple -release $(VERSION)